9450{
9452 {
9453 return true;
9454 }
9455};
9456
9457
9458
9460{
9464
9466
9469
9470
9471
9472
9473
9482
9488
9493
9498
9519 protected bool m_IsResultOfSplit
9520
9522
9527
9528
9529
9531
9535
9536
9537
9539
9542
9543
9544
9550
9551
9559
9562
9563
9565
9566
9568
9569
9574
9575
9580
9581
9583
9584
9586 {
9591
9592 if (!
GetGame().IsDedicatedServer())
9593 {
9595 {
9597
9599 {
9601 }
9602 }
9603
9606 }
9607
9608 m_OldLocation = null;
9609
9611 {
9613 }
9614
9615 if (ConfigIsExisting("headSelectionsToHide"))
9616 {
9619 }
9620
9622 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9623 {
9625 }
9626
9628
9629 m_IsResultOfSplit = false;
9630
9632 }
9633
9635 {
9636 super.InitItemVariables();
9637
9643 m_Count = ConfigGetInt(
"count");
9644
9647
9652
9655
9660
9672
9676
9677
9680 if (ConfigIsExisting("canBeSplit"))
9681 {
9684 }
9685
9687 if (ConfigIsExisting("itemBehaviour"))
9689
9690
9693 RegisterNetSyncVariableInt("m_VarLiquidType");
9694 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9695
9696 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9697 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9698 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9699
9700 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9701 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9702 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9703 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9704
9705 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9706 RegisterNetSyncVariableBool("m_IsTakeable");
9707 RegisterNetSyncVariableBool("m_IsHologram");
9708
9711 {
9714 }
9715
9717
9719 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9721
9722 }
9723
9725 {
9727 }
9728
9730 {
9733 {
9738 }
9739 }
9740
9741 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9742 {
9744 {
9747 }
9748
9750 }
9751
9753 {
9759 }
9760
9762
9764 {
9766
9767 if (!action)
9768 {
9769 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9770 return;
9771 }
9772
9774 if (!ai)
9775 {
9777 return;
9778 }
9779
9781 if (!action_array)
9782 {
9783 action_array = new array<ActionBase_Basic>;
9785 }
9786 if (LogManager.IsActionLogEnable())
9787 {
9788 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9789 }
9790
9791 if (action_array.Find(action) != -1)
9792 {
9793 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9794 }
9795 else
9796 {
9797 action_array.Insert(action);
9798 }
9799 }
9800
9802 {
9804 ActionBase action = player.GetActionManager().GetAction(actionName);
9807
9808 if (action_array)
9809 {
9810 action_array.RemoveItem(action);
9811 }
9812 }
9813
9814
9815
9817 {
9818 ActionOverrideData overrideData = new ActionOverrideData();
9822
9824 if (!actionMap)
9825 {
9828 }
9829
9830 actionMap.Insert(this.
Type(), overrideData);
9831
9832 }
9833
9835
9837
9838
9840 {
9843
9846
9847 string config_to_search = "CfgVehicles";
9848 string muzzle_owner_config;
9849
9851 {
9852 if (IsInherited(Weapon))
9853 config_to_search = "CfgWeapons";
9854
9855 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9856
9857 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9858
9860
9861 if (config_OnFire_subclass_count > 0)
9862 {
9863 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9864
9865 for (int i = 0; i < config_OnFire_subclass_count; i++)
9866 {
9867 string particle_class = "";
9869 string config_OnFire_entry = config_OnFire_class + particle_class;
9870 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9871 WPOF_array.Insert(WPOF);
9872 }
9873
9874
9876 }
9877 }
9878
9880 {
9881 config_to_search = "CfgWeapons";
9882 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9883
9884 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9885
9887
9888 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9889 {
9890 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9891
9892 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9893 {
9894 string particle_class2 = "";
9896 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9897 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9898 WPOBE_array.Insert(WPOBE);
9899 }
9900
9901
9903 }
9904 }
9905 }
9906
9907
9909 {
9912
9914 {
9915 string config_to_search = "CfgVehicles";
9916
9917 if (IsInherited(Weapon))
9918 config_to_search = "CfgWeapons";
9919
9920 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9921 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9922
9923 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9924 {
9925
9927
9929 {
9931 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9933 return;
9934 }
9935
9938
9939
9940
9942 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9943
9944 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9945 {
9946 string particle_class = "";
9948 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9950
9951 if (entry_type == CT_CLASS)
9952 {
9953 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9954 WPOOH_array.Insert(WPOF);
9955 }
9956 }
9957
9958
9960 }
9961 }
9962 }
9963
9965 {
9967 }
9968
9970 {
9972 {
9974
9977
9980
9981 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9982 }
9983 }
9984
9986 {
9988 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9989
9991 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9992
9994 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9995
9997 {
9999 }
10000 }
10001
10003 {
10005 }
10006
10008 {
10011 else
10013
10015 {
10018 }
10019 else
10020 {
10023
10026 }
10027
10029 }
10030
10032 {
10034 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10035 }
10036
10038 {
10040 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10042 }
10043
10045 {
10047 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10048 }
10049
10051 {
10054
10055 OverheatingParticle OP = new OverheatingParticle();
10060
10062 }
10063
10065 {
10068
10069 return -1;
10070 }
10071
10073 {
10075 {
10078
10079 for (int i = count; i > 0; --i)
10080 {
10081 int id = i - 1;
10084
10087
10088 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10089 {
10090 if (p)
10091 {
10094 }
10095 }
10096 }
10097 }
10098 }
10099
10101 {
10103 {
10105 {
10106 int id = i - 1;
10108
10109 if (OP)
10110 {
10112
10113 if (p)
10114 {
10116 }
10117
10118 delete OP;
10119 }
10120 }
10121
10124 }
10125 }
10126
10129 {
10130 return 0.0;
10131 }
10132
10133
10135 {
10136 return 250;
10137 }
10138
10140 {
10141 return 0;
10142 }
10143
10146 {
10148 return true;
10149
10150 return false;
10151 }
10152
10155 {
10158
10160 {
10162 }
10163 else
10164 {
10165
10167 }
10168
10170 }
10171
10178 {
10179 return -1;
10180 }
10181
10182
10183
10184
10186 {
10188 {
10190 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10191
10192 if (r_index >= 0)
10193 {
10194 InventoryLocation r_il = new InventoryLocation;
10195 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10196
10197 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10200 {
10201 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10202 }
10204 {
10205 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10206 }
10207
10208 }
10209
10210 player.GetHumanInventory().ClearUserReservedLocation(this);
10211 }
10212
10215 }
10216
10217
10218
10219
10221 {
10222 return ItemBase.m_DebugActionsMask;
10223 }
10224
10226 {
10227 return ItemBase.m_DebugActionsMask & mask;
10228 }
10229
10231 {
10232 ItemBase.m_DebugActionsMask = mask;
10233 }
10234
10236 {
10237 ItemBase.m_DebugActionsMask |= mask;
10238 }
10239
10241 {
10242 ItemBase.m_DebugActionsMask &= ~mask;
10243 }
10244
10246 {
10248 {
10250 }
10251 else
10252 {
10254 }
10255 }
10256
10257
10259 {
10260 if (GetEconomyProfile())
10261 {
10262 float q_max = GetEconomyProfile().GetQuantityMax();
10263 if (q_max > 0)
10264 {
10265 float q_min = GetEconomyProfile().GetQuantityMin();
10266 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10267
10269 {
10270 ComponentEnergyManager comp = GetCompEM();
10272 {
10274 }
10275 }
10277 {
10279
10280 }
10281
10282 }
10283 }
10284 }
10285
10288 {
10289 EntityAI parent = GetHierarchyParent();
10290
10291 if (parent)
10292 {
10293 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10294 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10295 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10296 }
10297 }
10298
10301 {
10302 EntityAI parent = GetHierarchyParent();
10303
10304 if (parent)
10305 {
10306 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10307 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10308 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10309 }
10310 }
10311
10313 {
10314
10315
10316
10317
10319
10321 {
10322 if (ScriptInputUserData.CanStoreInputUserData())
10323 {
10324 ScriptInputUserData ctx = new ScriptInputUserData;
10330 ctx.
Write(use_stack_max);
10333
10335 {
10336 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10337 }
10338 }
10339 }
10340 else if (!
GetGame().IsMultiplayer())
10341 {
10343 }
10344 }
10345
10347 {
10349 }
10350
10352 {
10354 }
10355
10357 {
10359 }
10360
10362 {
10363
10364 return false;
10365 }
10366
10368 {
10369 return false;
10370 }
10371
10375 {
10376 return false;
10377 }
10378
10380 {
10381 return "";
10382 }
10383
10385
10387 {
10388 return false;
10389 }
10390
10392 {
10393 return true;
10394 }
10395
10396
10397
10399 {
10400 return true;
10401 }
10402
10404 {
10405 return true;
10406 }
10407
10409 {
10410 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10412 }
10413
10415 {
10417 }
10418
10420 {
10422 if (!is_being_placed)
10424 SetSynchDirty();
10425 }
10426
10427
10429
10431 {
10433 }
10434
10436 {
10438 }
10439
10441 {
10442 return 1;
10443 }
10444
10446 {
10447 return false;
10448 }
10449
10451 {
10453 SetSynchDirty();
10454 }
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10491 {
10492 super.OnMovedInsideCargo(container);
10493
10494 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10495 }
10496
10497 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10498 {
10499 super.EEItemLocationChanged(oldLoc,newLoc);
10500
10501 PlayerBase new_player = null;
10502 PlayerBase old_player = null;
10503
10504 if (newLoc.GetParent())
10505 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10506
10507 if (oldLoc.GetParent())
10508 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10509
10511 {
10512 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10513
10514 if (r_index >= 0)
10515 {
10516 InventoryLocation r_il = new InventoryLocation;
10517 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10518
10519 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10522 {
10523 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10524 }
10526 {
10527 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10528 }
10529
10530 }
10531 }
10532
10534 {
10535 if (new_player)
10536 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10537
10538 if (new_player == old_player)
10539 {
10540
10541 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10542 {
10544 {
10545 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10546 {
10547 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10548 }
10549 }
10550 else
10551 {
10552 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10553 }
10554 }
10555
10556 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10557 {
10558 int type = oldLoc.GetType();
10560 {
10561 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10562 }
10564 {
10565 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10566 }
10567 }
10568 if (!m_OldLocation)
10569 {
10570 m_OldLocation = new InventoryLocation;
10571 }
10572 m_OldLocation.Copy(oldLoc);
10573 }
10574 else
10575 {
10576 if (m_OldLocation)
10577 {
10578 m_OldLocation.Reset();
10579 }
10580 }
10581
10583 }
10584 else
10585 {
10586 if (new_player)
10587 {
10588 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10589 if (res_index >= 0)
10590 {
10591 InventoryLocation il = new InventoryLocation;
10592 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10594 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10597 {
10598 il.
GetParent().GetOnReleaseLock().Invoke(it);
10599 }
10601 {
10603 }
10604
10605 }
10606 }
10608 {
10609
10611 }
10612
10613 if (m_OldLocation)
10614 {
10615 m_OldLocation.Reset();
10616 }
10617 }
10618 }
10619
10620 override void EOnContact(IEntity other, Contact extra)
10621 {
10623 {
10624 int liquidType = -1;
10626 if (impactSpeed > 0.0)
10627 {
10629 #ifndef SERVER
10631 #else
10633 SetSynchDirty();
10634 #endif
10636 }
10637 }
10638
10639 #ifdef SERVER
10640 if (GetCompEM() && GetCompEM().IsPlugged())
10641 {
10642 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10643 GetCompEM().UnplugThis();
10644 }
10645 #endif
10646 }
10647
10649
10651 {
10653 }
10654
10656 {
10657
10658 }
10659
10661 {
10662 super.OnItemLocationChanged(old_owner, new_owner);
10663
10664 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10665 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10666
10667 if (!relatedPlayer && playerNew)
10668 relatedPlayer = playerNew;
10669
10670 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10671 {
10673 if (actionMgr)
10674 {
10675 ActionBase currentAction = actionMgr.GetRunningAction();
10676 if (currentAction)
10678 }
10679 }
10680
10681 Man ownerPlayerOld = null;
10682 Man ownerPlayerNew = null;
10683
10684 if (old_owner)
10685 {
10686 if (old_owner.
IsMan())
10687 {
10688 ownerPlayerOld = Man.Cast(old_owner);
10689 }
10690 else
10691 {
10692 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10693 }
10694 }
10695 else
10696 {
10698 {
10700
10701 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10702 {
10703 GetCompEM().UnplugThis();
10704 }
10705 }
10706 }
10707
10708 if (new_owner)
10709 {
10710 if (new_owner.
IsMan())
10711 {
10712 ownerPlayerNew = Man.Cast(new_owner);
10713 }
10714 else
10715 {
10716 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10717 }
10718 }
10719
10720 if (ownerPlayerOld != ownerPlayerNew)
10721 {
10722 if (ownerPlayerOld)
10723 {
10724 array<EntityAI> subItemsExit = new array<EntityAI>;
10726 for (int i = 0; i < subItemsExit.Count(); i++)
10727 {
10730 }
10731 }
10732
10733 if (ownerPlayerNew)
10734 {
10735 array<EntityAI> subItemsEnter = new array<EntityAI>;
10737 for (int j = 0; j < subItemsEnter.Count(); j++)
10738 {
10741 }
10742 }
10743 }
10744 else if (ownerPlayerNew != null)
10745 {
10746 PlayerBase nplayer;
10747 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10748 {
10749 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10751 for (int k = 0; k < subItemsUpdate.Count(); k++)
10752 {
10754 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10755 }
10756 }
10757 }
10758
10759 if (old_owner)
10760 old_owner.OnChildItemRemoved(this);
10761 if (new_owner)
10762 new_owner.OnChildItemReceived(this);
10763 }
10764
10765
10767 {
10768 super.EEDelete(parent);
10769 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10770 if (player)
10771 {
10773
10774 if (player.IsAlive())
10775 {
10776 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10777 if (r_index >= 0)
10778 {
10779 InventoryLocation r_il = new InventoryLocation;
10780 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10781
10782 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10785 {
10786 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10787 }
10789 {
10790 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10791 }
10792
10793 }
10794
10795 player.RemoveQuickBarEntityShortcut(this);
10796 }
10797 }
10798 }
10799
10801 {
10802 super.EEKilled(killer);
10803
10806 {
10807 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10808 {
10809 if (IsMagazine())
10810 {
10811 if (Magazine.Cast(this).GetAmmoCount() > 0)
10812 {
10814 }
10815 }
10816 else
10817 {
10819 }
10820 }
10821 }
10822 }
10823
10825 {
10826 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10827
10828 super.OnWasAttached(parent, slot_id);
10829
10832
10834 }
10835
10837 {
10838 super.OnWasDetached(parent, slot_id);
10839
10842 }
10843
10845 {
10846 int idx;
10849
10850 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10851 if (inventory_slots.Count() < 1)
10852 {
10853 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10854 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10855 }
10856 else
10857 {
10858 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10859 }
10860
10861 idx = inventory_slots.Find(slot);
10862 if (idx < 0)
10863 return "";
10864
10865 return attach_types.Get(idx);
10866 }
10867
10869 {
10870 int idx = -1;
10871 string slot;
10872
10875
10876 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10877 if (inventory_slots.Count() < 1)
10878 {
10879 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10880 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10881 }
10882 else
10883 {
10884 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10885 if (detach_types.Count() < 1)
10886 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10887 }
10888
10889 for (int i = 0; i < inventory_slots.Count(); i++)
10890 {
10891 slot = inventory_slots.Get(i);
10892 }
10893
10894 if (slot != "")
10895 {
10896 if (detach_types.Count() == 1)
10897 idx = 0;
10898 else
10899 idx = inventory_slots.Find(slot);
10900 }
10901 if (idx < 0)
10902 return "";
10903
10904 return detach_types.Get(idx);
10905 }
10906
10908 {
10909
10911
10912
10913 float min_time = 1;
10914 float max_time = 3;
10915 float delay = Math.RandomFloat(min_time, max_time);
10916
10917 explode_timer.Run(delay, this, "DoAmmoExplosion");
10918 }
10919
10921 {
10922 Magazine magazine = Magazine.Cast(this);
10923 int pop_sounds_count = 6;
10924 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10925
10926
10927 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10928 string sound_name = pop_sounds[ sound_idx ];
10930
10931
10932 magazine.ServerAddAmmoCount(-1);
10933
10934
10935 float min_temp_to_explode = 100;
10936
10937 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10938 {
10940 }
10941 }
10942
10943
10944 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10945 {
10946 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10947
10948 const int CHANCE_DAMAGE_CARGO = 4;
10949 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10950 const int CHANCE_DAMAGE_NOTHING = 2;
10951
10953 {
10954 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10955 int chances;
10956 int rnd;
10957
10958 if (GetInventory().GetCargo())
10959 {
10960 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10961 rnd = Math.RandomInt(0,chances);
10962
10963 if (rnd < CHANCE_DAMAGE_CARGO)
10964 {
10966 }
10967 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10968 {
10970 }
10971 }
10972 else
10973 {
10974 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10975 rnd = Math.RandomInt(0,chances);
10976
10977 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10978 {
10980 }
10981 }
10982 }
10983 }
10984
10986 {
10987 if (GetInventory().GetCargo())
10988 {
10989 int item_count = GetInventory().GetCargo().GetItemCount();
10990 if (item_count > 0)
10991 {
10992 int random_pick = Math.RandomInt(0, item_count);
10994 if (!item.IsExplosive())
10995 {
10996 item.AddHealth("","",damage);
10997 return true;
10998 }
10999 }
11000 }
11001 return false;
11002 }
11003
11005 {
11006 int attachment_count = GetInventory().AttachmentCount();
11007 if (attachment_count > 0)
11008 {
11009 int random_pick = Math.RandomInt(0, attachment_count);
11010 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11011 if (!attachment.IsExplosive())
11012 {
11013 attachment.AddHealth("","",damage);
11014 return true;
11015 }
11016 }
11017 return false;
11018 }
11019
11021 {
11023 }
11024
11026 {
11028 return GetInventory().CanRemoveEntity();
11029
11030 return false;
11031 }
11032
11034 {
11036 return;
11037
11039 {
11040 if (ScriptInputUserData.CanStoreInputUserData())
11041 {
11042 ScriptInputUserData ctx = new ScriptInputUserData;
11047 ctx.
Write(destination_entity);
11049 ctx.
Write(slot_id);
11051 }
11052 }
11053 else if (!
GetGame().IsMultiplayer())
11054 {
11056 }
11057 }
11058
11060 {
11062 return;
11063
11064 float split_quantity_new;
11068 InventoryLocation loc = new InventoryLocation;
11069
11070 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11071 {
11073 split_quantity_new = stack_max;
11074 else
11076
11077 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11078 if (new_item)
11079 {
11080 new_item.SetResultOfSplit(true);
11081 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11083 new_item.SetQuantity(split_quantity_new);
11084 }
11085 }
11086 else if (destination_entity && slot_id == -1)
11087 {
11088 if (quantity > stack_max)
11089 split_quantity_new = stack_max;
11090 else
11091 split_quantity_new = quantity;
11092
11094 {
11097 }
11098
11099 if (new_item)
11100 {
11101 new_item.SetResultOfSplit(true);
11102 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11104 new_item.SetQuantity(split_quantity_new);
11105 }
11106 }
11107 else
11108 {
11109 if (stack_max != 0)
11110 {
11112 {
11114 }
11115
11116 if (split_quantity_new == 0)
11117 {
11118 if (!
GetGame().IsMultiplayer())
11119 player.PhysicalPredictiveDropItem(this);
11120 else
11121 player.ServerDropEntity(this);
11122 return;
11123 }
11124
11126
11127 if (new_item)
11128 {
11129 new_item.SetResultOfSplit(true);
11130 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11132 new_item.SetQuantity(stack_max);
11133 new_item.PlaceOnSurface();
11134 }
11135 }
11136 }
11137 }
11138
11140 {
11142 return;
11143
11144 float split_quantity_new;
11148 InventoryLocation loc = new InventoryLocation;
11149
11150 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11151 {
11153 split_quantity_new = stack_max;
11154 else
11156
11157 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11158 if (new_item)
11159 {
11160 new_item.SetResultOfSplit(true);
11161 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11163 new_item.SetQuantity(split_quantity_new);
11164 }
11165 }
11166 else if (destination_entity && slot_id == -1)
11167 {
11168 if (quantity > stack_max)
11169 split_quantity_new = stack_max;
11170 else
11171 split_quantity_new = quantity;
11172
11174 {
11177 }
11178
11179 if (new_item)
11180 {
11181 new_item.SetResultOfSplit(true);
11182 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11184 new_item.SetQuantity(split_quantity_new);
11185 }
11186 }
11187 else
11188 {
11189 if (stack_max != 0)
11190 {
11192 {
11194 }
11195
11197
11198 if (new_item)
11199 {
11200 new_item.SetResultOfSplit(true);
11201 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11203 new_item.SetQuantity(stack_max);
11204 new_item.PlaceOnSurface();
11205 }
11206 }
11207 }
11208 }
11209
11211 {
11213 return;
11214
11216 {
11217 if (ScriptInputUserData.CanStoreInputUserData())
11218 {
11219 ScriptInputUserData ctx = new ScriptInputUserData;
11224 dst.WriteToContext(ctx);
11226 }
11227 }
11228 else if (!
GetGame().IsMultiplayer())
11229 {
11231 }
11232 }
11233
11235 {
11237 return;
11238
11240 {
11241 if (ScriptInputUserData.CanStoreInputUserData())
11242 {
11243 ScriptInputUserData ctx = new ScriptInputUserData;
11248 ctx.
Write(destination_entity);
11254 }
11255 }
11256 else if (!
GetGame().IsMultiplayer())
11257 {
11259 }
11260 }
11261
11263 {
11265 }
11266
11268 {
11270 return this;
11271
11273 float split_quantity_new;
11275 if (dst.IsValid())
11276 {
11277 int slot_id = dst.GetSlot();
11279
11280 if (quantity > stack_max)
11281 split_quantity_new = stack_max;
11282 else
11283 split_quantity_new = quantity;
11284
11286
11287 if (new_item)
11288 {
11289 new_item.SetResultOfSplit(true);
11290 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11293 }
11294
11295 return new_item;
11296 }
11297
11298 return null;
11299 }
11300
11302 {
11304 return;
11305
11307 float split_quantity_new;
11309 if (destination_entity)
11310 {
11312 if (quantity > stackable)
11313 split_quantity_new = stackable;
11314 else
11315 split_quantity_new = quantity;
11316
11317 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11318 if (new_item)
11319 {
11320 new_item.SetResultOfSplit(true);
11321 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11323 new_item.SetQuantity(split_quantity_new);
11324 }
11325 }
11326 }
11327
11329 {
11331 return;
11332
11334 {
11335 if (ScriptInputUserData.CanStoreInputUserData())
11336 {
11337 ScriptInputUserData ctx = new ScriptInputUserData;
11342 ItemBase destination_entity =
this;
11343 ctx.
Write(destination_entity);
11347 }
11348 }
11349 else if (!
GetGame().IsMultiplayer())
11350 {
11352 }
11353 }
11354
11356 {
11358 return;
11359
11361 float split_quantity_new;
11363 if (player)
11364 {
11366 if (quantity > stackable)
11367 split_quantity_new = stackable;
11368 else
11369 split_quantity_new = quantity;
11370
11371 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11372 new_item =
ItemBase.Cast(in_hands);
11373 if (new_item)
11374 {
11375 new_item.SetResultOfSplit(true);
11376 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11378 new_item.SetQuantity(split_quantity_new);
11379 }
11380 }
11381 }
11382
11384 {
11386 return;
11387
11389 float split_quantity_new = Math.Floor(quantity * 0.5);
11390
11392
11393 if (new_item)
11394 {
11395 if (new_item.GetQuantityMax() < split_quantity_new)
11396 {
11397 split_quantity_new = new_item.GetQuantityMax();
11398 }
11399
11400 new_item.SetResultOfSplit(true);
11401 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11402
11404 {
11407 }
11408 else
11409 {
11412 }
11413 }
11414 }
11415
11417 {
11419 return;
11420
11422 float split_quantity_new = Math.Floor(quantity / 2);
11423
11424 InventoryLocation invloc = new InventoryLocation;
11426
11428 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11429
11430 if (new_item)
11431 {
11432 if (new_item.GetQuantityMax() < split_quantity_new)
11433 {
11434 split_quantity_new = new_item.GetQuantityMax();
11435 }
11437 {
11440 }
11441 else
11442 {
11445 }
11446 }
11447 }
11448
11451 {
11452 SetWeightDirty();
11454
11455 if (parent)
11456 parent.OnAttachmentQuantityChangedEx(this, delta);
11457
11459 {
11461 {
11463 }
11465 {
11466 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11468 }
11469 }
11470
11471 }
11472
11475 {
11476
11477 }
11478
11481 {
11483 }
11484
11486 {
11487 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11488
11490 {
11491 if (newLevel == GameConstants.STATE_RUINED)
11492 {
11494 EntityAI parent = GetHierarchyParent();
11495 if (parent && parent.IsFireplace())
11496 {
11497 CargoBase cargo = GetInventory().GetCargo();
11498 if (cargo)
11499 {
11501 {
11503 }
11504 }
11505 }
11506 }
11507
11509 {
11510
11512 return;
11513 }
11514
11515 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11516 {
11518 }
11519 }
11520 }
11521
11522
11524 {
11525 super.OnRightClick();
11526
11528 {
11530 {
11531 if (ScriptInputUserData.CanStoreInputUserData())
11532 {
11533 vector m4[4];
11535
11536 EntityAI root = GetHierarchyRoot();
11537
11538 InventoryLocation dst = new InventoryLocation;
11540 {
11541 if (root)
11542 {
11543 root.GetTransform(m4);
11545 }
11546 else
11547 GetInventory().GetCurrentInventoryLocation(dst);
11548 }
11549 else
11550 {
11552
11553
11554 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11555 {
11556 if (root)
11557 {
11558 root.GetTransform(m4);
11560 }
11561 else
11562 GetInventory().GetCurrentInventoryLocation(dst);
11563 }
11564 else
11565 {
11566 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11567 }
11568 }
11569
11570 ScriptInputUserData ctx = new ScriptInputUserData;
11578 }
11579 }
11580 else if (!
GetGame().IsMultiplayer())
11581 {
11583 }
11584 }
11585 }
11586
11587 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11588 {
11589
11590 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11591 return false;
11592
11593 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11594 return false;
11595
11596
11598 return false;
11599
11600
11601 Magazine mag = Magazine.Cast(this);
11602 if (mag)
11603 {
11604 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11605 return false;
11606
11607 if (stack_max_limit)
11608 {
11609 Magazine other_mag = Magazine.Cast(other_item);
11610 if (other_item)
11611 {
11612 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11613 return false;
11614 }
11615
11616 }
11617 }
11618 else
11619 {
11620
11622 return false;
11623
11625 return false;
11626 }
11627
11628 PlayerBase player = null;
11629 if (CastTo(player, GetHierarchyRootPlayer()))
11630 {
11631 if (player.GetInventory().HasAttachment(this))
11632 return false;
11633
11634 if (player.IsItemsToDelete())
11635 return false;
11636 }
11637
11638 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11639 return false;
11640
11641 int slotID;
11643 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11644 return false;
11645
11646 return true;
11647 }
11648
11650 {
11652 }
11653
11655 {
11656 return m_IsResultOfSplit;
11657 }
11658
11660 {
11661 m_IsResultOfSplit = value;
11662 }
11663
11665 {
11667 }
11668
11670 {
11671 float other_item_quantity = other_item.GetQuantity();
11672 float this_free_space;
11673
11675
11677
11678 if (other_item_quantity > this_free_space)
11679 {
11680 return this_free_space;
11681 }
11682 else
11683 {
11684 return other_item_quantity;
11685 }
11686 }
11687
11689 {
11691 }
11692
11694 {
11696 return;
11697
11698 if (!IsMagazine() && other_item)
11699 {
11701 if (quantity_used != 0)
11702 {
11703 float hp1 = GetHealth01("","");
11704 float hp2 = other_item.GetHealth01("","");
11705 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11706 hpResult = hpResult / (
GetQuantity() + quantity_used);
11707
11708 hpResult *= GetMaxHealth();
11709 Math.Round(hpResult);
11710 SetHealth("", "Health", hpResult);
11711
11713 other_item.AddQuantity(-quantity_used);
11714 }
11715 }
11717 }
11718
11720 {
11721 #ifdef SERVER
11722 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11723 GetHierarchyParent().IncreaseLifetimeUp();
11724 #endif
11725 };
11726
11728 {
11729 PlayerBase p = PlayerBase.Cast(player);
11730
11731 array<int> recipesIds = p.m_Recipes;
11732 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11733 if (moduleRecipesManager)
11734 {
11735 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11736 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11737 }
11738
11739 for (int i = 0;i < recipesIds.Count(); i++)
11740 {
11741 int key = recipesIds.Get(i);
11742 string recipeName = moduleRecipesManager.GetRecipeName(key);
11744 }
11745 }
11746
11747
11748 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11749 {
11750 super.GetDebugActions(outputList);
11751
11752
11757
11758
11762
11766
11767
11770
11771
11773 {
11776 }
11777
11779
11782
11786 }
11787
11788
11789
11790
11792 {
11793 super.OnAction(action_id, player, ctx);
11794 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11795 {
11796 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11797 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11798 PlayerBase p = PlayerBase.Cast(player);
11799 if (
EActions.RECIPES_RANGE_START < 1000)
11800 {
11801 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11802 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11803 }
11804 }
11805 #ifndef SERVER
11806 else if (action_id ==
EActions.WATCH_PLAYER)
11807 {
11808 PluginDeveloper.SetDeveloperItemClientEx(player);
11809 }
11810 #endif
11812 {
11813 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11814 {
11815 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11816 OnDebugButtonPressServer(id + 1);
11817 }
11818
11819 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11820 {
11821 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11823 }
11824
11825 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11826 {
11827 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11829 }
11830
11831 else if (action_id ==
EActions.ADD_QUANTITY)
11832 {
11833 if (IsMagazine())
11834 {
11835 Magazine mag = Magazine.Cast(this);
11836 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11837 }
11838 else
11839 {
11841 }
11842
11843 if (m_EM)
11844 {
11845 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11846 }
11847
11848 }
11849
11850 else if (action_id ==
EActions.REMOVE_QUANTITY)
11851 {
11852 if (IsMagazine())
11853 {
11854 Magazine mag2 = Magazine.Cast(this);
11855 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11856 }
11857 else
11858 {
11860 }
11861 if (m_EM)
11862 {
11863 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11864 }
11865
11866 }
11867
11868 else if (action_id ==
EActions.SET_QUANTITY_0)
11869 {
11871
11872 if (m_EM)
11873 {
11874 m_EM.SetEnergy(0);
11875 }
11876 }
11877
11878 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11879 {
11881
11882 if (m_EM)
11883 {
11884 m_EM.SetEnergy(m_EM.GetEnergyMax());
11885 }
11886 }
11887
11888 else if (action_id ==
EActions.ADD_HEALTH)
11889 {
11890 AddHealth("","",GetMaxHealth("","Health")/5);
11891 }
11892 else if (action_id ==
EActions.REMOVE_HEALTH)
11893 {
11894 AddHealth("","",-GetMaxHealth("","Health")/5);
11895 }
11896 else if (action_id ==
EActions.DESTROY_HEALTH)
11897 {
11898 SetHealth01("","",0);
11899 }
11900 else if (action_id ==
EActions.WATCH_ITEM)
11901 {
11903 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11904 #ifdef DEVELOPER
11905 SetDebugDeveloper_item(this);
11906 #endif
11907 }
11908
11909 else if (action_id ==
EActions.ADD_TEMPERATURE)
11910 {
11911 AddTemperature(20);
11912
11913 }
11914
11915 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11916 {
11917 AddTemperature(-20);
11918
11919 }
11920
11921 else if (action_id ==
EActions.FLIP_FROZEN)
11922 {
11923 SetFrozen(!GetIsFrozen());
11924
11925 }
11926
11927 else if (action_id ==
EActions.ADD_WETNESS)
11928 {
11930
11931 }
11932
11933 else if (action_id ==
EActions.REMOVE_WETNESS)
11934 {
11936
11937 }
11938
11939 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11940 {
11943
11944
11945 }
11946
11947 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11948 {
11951 }
11952
11953 else if (action_id ==
EActions.MAKE_SPECIAL)
11954 {
11955 auto debugParams = DebugSpawnParams.WithPlayer(player);
11956 OnDebugSpawnEx(debugParams);
11957 }
11958
11959 else if (action_id ==
EActions.DELETE)
11960 {
11961 Delete();
11962 }
11963
11964 }
11965
11966
11967 return false;
11968 }
11969
11970
11971
11972
11976
11979
11980
11981
11983 {
11984 return false;
11985 }
11986
11987
11989 {
11990 return true;
11991 }
11992
11993
11995 {
11996 return true;
11997 }
11998
11999
12000
12002 {
12003 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12005 }
12006
12009 {
12010 return null;
12011 }
12012
12014 {
12015 return false;
12016 }
12017
12019 {
12020 return false;
12021 }
12022
12026
12027
12029 {
12030 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12031 return module_repairing.CanRepair(this, item_repair_kit);
12032 }
12033
12034
12035 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12036 {
12037 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12038 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12039 }
12040
12041
12043 {
12044
12045
12046
12047
12048
12049
12050
12051
12052 return 1;
12053 }
12054
12055
12056
12058 {
12060 }
12061
12062
12063
12065 {
12067 }
12068
12069
12078 {
12079 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12080
12081 if (player)
12082 {
12083 player.MessageStatus(text);
12084 }
12085 }
12086
12087
12096 {
12097 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12098
12099 if (player)
12100 {
12101 player.MessageAction(text);
12102 }
12103 }
12104
12105
12114 {
12115 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12116
12117 if (player)
12118 {
12119 player.MessageFriendly(text);
12120 }
12121 }
12122
12123
12132 {
12133 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12134
12135 if (player)
12136 {
12137 player.MessageImportant(text);
12138 }
12139 }
12140
12142 {
12143 return true;
12144 }
12145
12146
12147 override bool KindOf(
string tag)
12148 {
12149 bool found = false;
12150 string item_name = this.
GetType();
12153
12154 int array_size = item_tag_array.Count();
12155 for (int i = 0; i < array_size; i++)
12156 {
12157 if (item_tag_array.Get(i) == tag)
12158 {
12159 found = true;
12160 break;
12161 }
12162 }
12163 return found;
12164 }
12165
12166
12168 {
12169
12170 super.OnRPC(sender, rpc_type,ctx);
12171
12172
12173 switch (rpc_type)
12174 {
12175 #ifndef SERVER
12176 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12177 Param2<bool, string> p = new Param2<bool, string>(false, "");
12178
12180 return;
12181
12182 bool play = p.param1;
12183 string soundSet = p.param2;
12184
12185 if (play)
12186 {
12188 {
12190 {
12192 }
12193 }
12194 else
12195 {
12197 }
12198 }
12199 else
12200 {
12202 }
12203
12204 break;
12205 #endif
12206
12207 }
12208
12210 {
12212 }
12213 }
12214
12215
12216
12217
12219 {
12220 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12221 return plugin.GetID(
name);
12222 }
12223
12225 {
12226 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12227 return plugin.GetName(id);
12228 }
12229
12232 {
12233
12234
12235 int varFlags;
12236 if (!ctx.
Read(varFlags))
12237 return;
12238
12239 if (varFlags & ItemVariableFlags.FLOAT)
12240 {
12242 }
12243 }
12244
12246 {
12247
12248 super.SerializeNumericalVars(floats_out);
12249
12250
12251
12253 {
12255 }
12256
12258 {
12260 }
12261
12263 {
12265 }
12266
12268 {
12273 }
12274
12276 {
12278 }
12279 }
12280
12282 {
12283
12284 super.DeSerializeNumericalVars(floats);
12285
12286
12287 int index = 0;
12288 int mask = Math.Round(floats.Get(index));
12289
12290 index++;
12291
12293 {
12295 {
12297 }
12298 else
12299 {
12300 float quantity = floats.Get(index);
12301 SetQuantity(quantity,
true,
false,
false,
false);
12302 }
12303 index++;
12304 }
12305
12307 {
12308 float wet = floats.Get(index);
12310 index++;
12311 }
12312
12314 {
12315 int liquidtype = Math.Round(floats.Get(index));
12317 index++;
12318 }
12319
12321 {
12323 index++;
12325 index++;
12327 index++;
12329 index++;
12330 }
12331
12333 {
12334 int cleanness = Math.Round(floats.Get(index));
12336 index++;
12337 }
12338 }
12339
12341 {
12342 super.WriteVarsToCTX(ctx);
12343
12344
12346 {
12348 }
12349
12351 {
12353 }
12354
12356 {
12358 }
12359
12361 {
12362 int r,g,b,a;
12368 }
12369
12371 {
12373 }
12374 }
12375
12377 {
12378 if (!super.ReadVarsFromCTX(ctx,version))
12379 return false;
12380
12381 int intValue;
12382 float value;
12383
12384 if (version < 140)
12385 {
12386 if (!ctx.
Read(intValue))
12387 return false;
12388
12389 m_VariablesMask = intValue;
12390 }
12391
12393 {
12394 if (!ctx.
Read(value))
12395 return false;
12396
12398 {
12400 }
12401 else
12402 {
12404 }
12405 }
12406
12407 if (version < 140)
12408 {
12410 {
12411 if (!ctx.
Read(value))
12412 return false;
12413 SetTemperatureDirect(value);
12414 }
12415 }
12416
12418 {
12419 if (!ctx.
Read(value))
12420 return false;
12422 }
12423
12425 {
12426 if (!ctx.
Read(intValue))
12427 return false;
12429 }
12430
12432 {
12433 int r,g,b,a;
12435 return false;
12437 return false;
12439 return false;
12441 return false;
12442
12444 }
12445
12447 {
12448 if (!ctx.
Read(intValue))
12449 return false;
12451 }
12452
12453 if (version >= 138 && version < 140)
12454 {
12456 {
12457 if (!ctx.
Read(intValue))
12458 return false;
12459 SetFrozen(intValue);
12460 }
12461 }
12462
12463 return true;
12464 }
12465
12466
12468 {
12471 {
12473 }
12474
12475 if (!super.OnStoreLoad(ctx, version))
12476 {
12478 return false;
12479 }
12480
12481 if (version >= 114)
12482 {
12483 bool hasQuickBarIndexSaved;
12484
12485 if (!ctx.
Read(hasQuickBarIndexSaved))
12486 {
12488 return false;
12489 }
12490
12491 if (hasQuickBarIndexSaved)
12492 {
12493 int itmQBIndex;
12494
12495
12496 if (!ctx.
Read(itmQBIndex))
12497 {
12499 return false;
12500 }
12501
12502 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12503 if (itmQBIndex != -1 && parentPlayer)
12504 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12505 }
12506 }
12507 else
12508 {
12509
12510 PlayerBase player;
12511 int itemQBIndex;
12512 if (version ==
int.
MAX)
12513 {
12514 if (!ctx.
Read(itemQBIndex))
12515 {
12517 return false;
12518 }
12519 }
12520 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12521 {
12522
12523 if (!ctx.
Read(itemQBIndex))
12524 {
12526 return false;
12527 }
12528 if (itemQBIndex != -1 && player)
12529 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12530 }
12531 }
12532
12533 if (version < 140)
12534 {
12535
12536 if (!LoadVariables(ctx, version))
12537 {
12539 return false;
12540 }
12541 }
12542
12543
12545 {
12547 return false;
12548 }
12549 if (version >= 132)
12550 {
12552 if (raib)
12553 {
12555 {
12557 return false;
12558 }
12559 }
12560 }
12561
12563 return true;
12564 }
12565
12566
12567
12569 {
12570 super.OnStoreSave(ctx);
12571
12572 PlayerBase player;
12573 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12574 {
12576
12577 int itemQBIndex = -1;
12578 itemQBIndex = player.FindQuickBarEntityIndex(this);
12579 ctx.
Write(itemQBIndex);
12580 }
12581 else
12582 {
12584 }
12585
12587
12589 if (raib)
12590 {
12592 }
12593 }
12594
12595
12597 {
12598 super.AfterStoreLoad();
12599
12601 {
12603 }
12604
12606 {
12609 }
12610 }
12611
12613 {
12614 super.EEOnAfterLoad();
12615
12617 {
12619 }
12620
12623 }
12624
12626 {
12627 return false;
12628 }
12629
12630
12631
12633 {
12635 {
12636 #ifdef PLATFORM_CONSOLE
12637
12639 {
12641 if (menu)
12642 {
12644 }
12645 }
12646 #endif
12647 }
12648
12650 {
12653 }
12654
12656 {
12657 SetWeightDirty();
12659 }
12661 {
12664 }
12665
12667 {
12670 }
12672 {
12675 }
12676
12677 super.OnVariablesSynchronized();
12678 }
12679
12680
12681
12683 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12684 {
12685 if (!IsServerCheck(allow_client))
12686 return false;
12687
12689 return false;
12690
12693
12694 if (value <= (min + 0.001))
12695 value = min;
12696
12697 if (value == min)
12698 {
12699 if (destroy_config)
12700 {
12701 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12702 if (dstr)
12703 {
12705 this.Delete();
12706 return true;
12707 }
12708 }
12709 else if (destroy_forced)
12710 {
12712 this.Delete();
12713 return true;
12714 }
12715
12717 }
12718
12721
12723 {
12725
12726 if (delta)
12728 }
12729
12731
12732 return false;
12733 }
12734
12735
12737 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12738 {
12740 }
12741
12743 {
12746 }
12747
12749 {
12752 }
12753
12756 {
12757 float value_clamped = Math.Clamp(value, 0, 1);
12759 SetQuantity(result, destroy_config, destroy_forced);
12760 }
12761
12762
12765 {
12767 }
12768
12770 {
12772 }
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12784 {
12785 int slot = -1;
12786 if (GetInventory())
12787 {
12788 InventoryLocation il = new InventoryLocation;
12789 GetInventory().GetCurrentInventoryLocation(il);
12791 }
12792
12794 }
12795
12797 {
12798 float quantity_max = 0;
12799
12801 {
12802 if (attSlotID != -1)
12803 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12804
12805 if (quantity_max <= 0)
12807 }
12808
12809 if (quantity_max <= 0)
12811
12812 return quantity_max;
12813 }
12814
12816 {
12818 }
12819
12821 {
12823 }
12824
12825
12827 {
12829 }
12830
12832 {
12834 }
12835
12837 {
12839 }
12840
12841
12843 {
12844
12845 float weightEx = GetWeightEx();
12846 float special = GetInventoryAndCargoWeight();
12847 return weightEx - special;
12848 }
12849
12850
12852 {
12854 }
12855
12857 {
12859 {
12860 #ifdef DEVELOPER
12861 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12862 {
12863 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12865 }
12866 #endif
12867
12868 return GetQuantity() * GetConfigWeightModified();
12869 }
12870 else if (HasEnergyManager())
12871 {
12872 #ifdef DEVELOPER
12873 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12874 {
12875 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12876 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12877 }
12878 #endif
12879 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12880 }
12881 else
12882 {
12883 #ifdef DEVELOPER
12884 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12885 {
12886 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12887 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12888 }
12889 #endif
12890 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12891 }
12892 }
12893
12896 {
12897 int item_count = 0;
12899
12900 if (GetInventory().GetCargo() != NULL)
12901 {
12902 item_count = GetInventory().GetCargo().GetItemCount();
12903 }
12904
12905 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12906 {
12907 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12908 if (item)
12909 item_count += item.GetNumberOfItems();
12910 }
12911 return item_count;
12912 }
12913
12916 {
12917 float weight = 0;
12918 float wetness = 1;
12919 if (include_wetness)
12922 {
12923 weight = wetness * m_ConfigWeight;
12924 }
12926 {
12927 weight = 1;
12928 }
12929 return weight;
12930 }
12931
12932
12933
12935 {
12936 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12937 {
12938 GameInventory inv = GetInventory();
12939 array<EntityAI> items = new array<EntityAI>;
12941 for (int i = 0; i < items.Count(); i++)
12942 {
12944 if (item)
12945 {
12947 }
12948 }
12949 }
12950 }
12951
12952
12953
12954
12956 {
12957 float energy = 0;
12958 if (HasEnergyManager())
12959 {
12960 energy = GetCompEM().GetEnergy();
12961 }
12962 return energy;
12963 }
12964
12965
12967 {
12968 super.OnEnergyConsumed();
12969
12971 }
12972
12974 {
12975 super.OnEnergyAdded();
12976
12978 }
12979
12980
12982 {
12983 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12984 {
12986 {
12987 float energy_0to1 = GetCompEM().GetEnergy0To1();
12989 }
12990 }
12991 }
12992
12993
12995 {
12996 return ConfigGetFloat("heatIsolation");
12997 }
12998
13000 {
13002 }
13003
13005 {
13006 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13007 if (
GetGame().ConfigIsExisting(paramPath))
13009
13010 return 0.0;
13011 }
13012
13014 {
13015 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13016 if (
GetGame().ConfigIsExisting(paramPath))
13018
13019 return 0.0;
13020 }
13021
13022 override void SetWet(
float value,
bool allow_client =
false)
13023 {
13024 if (!IsServerCheck(allow_client))
13025 return;
13026
13029
13031
13032 m_VarWet = Math.Clamp(value, min, max);
13033
13035 {
13038 }
13039 }
13040
13041 override void AddWet(
float value)
13042 {
13044 }
13045
13047 {
13049 }
13050
13052 {
13054 }
13055
13057 {
13059 }
13060
13062 {
13064 }
13065
13067 {
13069 }
13070
13071 override void OnWetChanged(
float newVal,
float oldVal)
13072 {
13075 if (newLevel != oldLevel)
13076 {
13078 }
13079 }
13080
13082 {
13083 SetWeightDirty();
13084 }
13085
13087 {
13088 return GetWetLevelInternal(
m_VarWet);
13089 }
13090
13091
13092
13094 {
13096 }
13097
13099 {
13101 }
13102
13104 {
13106 }
13107
13109 {
13111 }
13112
13113
13114
13116 {
13117 if (ConfigIsExisting("itemModelLength"))
13118 {
13119 return ConfigGetFloat("itemModelLength");
13120 }
13121 return 0;
13122 }
13123
13125 {
13126 if (ConfigIsExisting("itemAttachOffset"))
13127 {
13128 return ConfigGetFloat("itemAttachOffset");
13129 }
13130 return 0;
13131 }
13132
13133 override void SetCleanness(
int value,
bool allow_client =
false)
13134 {
13135 if (!IsServerCheck(allow_client))
13136 return;
13137
13139
13141
13144 }
13145
13147 {
13149 }
13150
13152 {
13153 return true;
13154 }
13155
13156
13157
13158
13160 {
13162 }
13163
13165 {
13167 }
13168
13169
13170
13171
13172 override void SetColor(
int r,
int g,
int b,
int a)
13173 {
13179 }
13181 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13182 {
13187 }
13188
13190 {
13192 }
13193
13196 {
13197 int r,g,b,a;
13199 r = r/255;
13200 g = g/255;
13201 b = b/255;
13202 a = a/255;
13203 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13204 }
13205
13206
13207
13208 override void SetLiquidType(
int value,
bool allow_client =
false)
13209 {
13210 if (!IsServerCheck(allow_client))
13211 return;
13212
13217 }
13218
13220 {
13221 return ConfigGetInt("varLiquidTypeInit");
13222 }
13223
13225 {
13227 }
13228
13230 {
13232 SetFrozen(false);
13233 }
13234
13237 {
13238 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13239 }
13240
13241
13244 {
13245 PlayerBase nplayer;
13246 if (PlayerBase.CastTo(nplayer, player))
13247 {
13249
13250 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13251 }
13252 }
13253
13254
13257 {
13258 PlayerBase nplayer;
13259 if (PlayerBase.CastTo(nplayer,player))
13260 {
13261
13262 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13263
13264 }
13265
13266
13267 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13268
13269
13270 if (HasEnergyManager())
13271 {
13272 GetCompEM().UpdatePlugState();
13273 }
13274 }
13275
13276
13278 {
13279 super.OnPlacementStarted(player);
13280
13282 }
13283
13284 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13285 {
13287 {
13288 m_AdminLog.OnPlacementComplete(player,
this);
13289 }
13290
13291 super.OnPlacementComplete(player, position, orientation);
13292 }
13293
13294
13295
13296
13297
13299 {
13301 {
13302 return true;
13303 }
13304 else
13305 {
13306 return false;
13307 }
13308 }
13309
13310
13312 {
13314 {
13316 }
13317 }
13318
13319
13321 {
13323 }
13324
13326 {
13328 }
13329
13330 override void InsertAgent(
int agent,
float count = 1)
13331 {
13332 if (count < 1)
13333 return;
13334
13336 }
13337
13340 {
13342 }
13343
13344
13346 {
13348 }
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13392 {
13394 return false;
13395 return true;
13396 }
13397
13399 {
13400
13402 }
13403
13404
13407 {
13408 super.CheckForRoofLimited(timeTresholdMS);
13409
13411 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13412 {
13413 m_PreviousRoofTestTime = time;
13414 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13415 }
13416 }
13417
13418
13420 {
13422 {
13423 return 0;
13424 }
13425
13426 if (GetInventory().GetAttachmentSlotsCount() != 0)
13427 {
13428 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13429 if (filter)
13430 return filter.GetProtectionLevel(type, false, system);
13431 else
13432 return 0;
13433 }
13434
13435 string subclassPath, entryName;
13436
13437 switch (type)
13438 {
13440 entryName = "biological";
13441 break;
13443 entryName = "chemical";
13444 break;
13445 default:
13446 entryName = "biological";
13447 break;
13448 }
13449
13450 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13451
13453 }
13454
13455
13456
13459 {
13460 if (!IsMagazine())
13462
13464 }
13465
13466
13467
13468
13469
13474 {
13475 return true;
13476 }
13477
13479 {
13481 }
13482
13483
13484
13485
13486
13488 {
13489 if (parent)
13490 {
13491 if (parent.IsInherited(DayZInfected))
13492 return true;
13493
13494 if (!parent.IsRuined())
13495 return true;
13496 }
13497
13498 return true;
13499 }
13500
13502 {
13503 if (!super.CanPutAsAttachment(parent))
13504 {
13505 return false;
13506 }
13507
13508 if (!IsRuined() && !parent.IsRuined())
13509 {
13510 return true;
13511 }
13512
13513 return false;
13514 }
13515
13517 {
13518
13519
13520
13521
13522 return super.CanReceiveItemIntoCargo(item);
13523 }
13524
13526 {
13527
13528
13529
13530
13531 GameInventory attachmentInv = attachment.GetInventory();
13533 {
13534 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13535 return false;
13536 }
13537
13538 InventoryLocation loc = new InventoryLocation();
13539 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13540 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13541 return false;
13542
13543 return super.CanReceiveAttachment(attachment, slotId);
13544 }
13545
13547 {
13548 if (!super.CanReleaseAttachment(attachment))
13549 return false;
13550
13551 return GetInventory().AreChildrenAccessible();
13552 }
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13575 {
13576 int id = muzzle_owner.GetMuzzleID();
13577 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13578
13579 if (WPOF_array)
13580 {
13581 for (int i = 0; i < WPOF_array.Count(); i++)
13582 {
13583 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13584
13585 if (WPOF)
13586 {
13587 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13588 }
13589 }
13590 }
13591 }
13592
13593
13595 {
13596 int id = muzzle_owner.GetMuzzleID();
13598
13599 if (WPOBE_array)
13600 {
13601 for (int i = 0; i < WPOBE_array.Count(); i++)
13602 {
13603 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13604
13605 if (WPOBE)
13606 {
13607 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13608 }
13609 }
13610 }
13611 }
13612
13613
13615 {
13616 int id = muzzle_owner.GetMuzzleID();
13617 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13618
13619 if (WPOOH_array)
13620 {
13621 for (int i = 0; i < WPOOH_array.Count(); i++)
13622 {
13623 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13624
13625 if (WPOOH)
13626 {
13627 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13628 }
13629 }
13630 }
13631 }
13632
13633
13635 {
13636 int id = muzzle_owner.GetMuzzleID();
13637 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13638
13639 if (WPOOH_array)
13640 {
13641 for (int i = 0; i < WPOOH_array.Count(); i++)
13642 {
13643 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13644
13645 if (WPOOH)
13646 {
13647 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13648 }
13649 }
13650 }
13651 }
13652
13653
13655 {
13656 int id = muzzle_owner.GetMuzzleID();
13657 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13658
13659 if (WPOOH_array)
13660 {
13661 for (int i = 0; i < WPOOH_array.Count(); i++)
13662 {
13663 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13664
13665 if (WPOOH)
13666 {
13667 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13668 }
13669 }
13670 }
13671 }
13672
13673
13674
13676 {
13678 {
13679 return true;
13680 }
13681
13682 return false;
13683 }
13684
13686 {
13688 {
13689 return true;
13690 }
13691
13692 return false;
13693 }
13694
13696 {
13698 {
13699 return true;
13700 }
13701
13702 return false;
13703 }
13704
13706 {
13707 return false;
13708 }
13709
13712 {
13713 return UATimeSpent.DEFAULT_DEPLOY;
13714 }
13715
13716
13717
13718
13720 {
13722 SetSynchDirty();
13723 }
13724
13726 {
13728 }
13729
13730
13732 {
13733 return false;
13734 }
13735
13738 {
13739 string att_type = "None";
13740
13741 if (ConfigIsExisting("soundAttType"))
13742 {
13743 att_type = ConfigGetString("soundAttType");
13744 }
13745
13747 }
13748
13750 {
13752 }
13753
13754
13755
13756
13757
13761
13763 {
13766
13768 }
13769
13770
13772 {
13774 return;
13775
13777
13780
13783
13784 SoundParameters params = new SoundParameters();
13788 }
13789
13790
13792 {
13794 return;
13795
13797 SetSynchDirty();
13798
13801 }
13802
13803
13805 {
13807 return;
13808
13810 SetSynchDirty();
13811
13814 }
13815
13817 {
13819 }
13820
13822 {
13824 }
13825
13828 {
13829 if (!
GetGame().IsDedicatedServer())
13830 {
13831 if (ConfigIsExisting("attachSoundSet"))
13832 {
13833 string cfg_path = "";
13834 string soundset = "";
13835 string type_name =
GetType();
13836
13839 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13840 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13841
13842 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13843 {
13844 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13845 {
13846 if (cfg_slot_array[i] == slot_type)
13847 {
13848 soundset = cfg_soundset_array[i];
13849 break;
13850 }
13851 }
13852 }
13853
13854 if (soundset != "")
13855 {
13856 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13858 }
13859 }
13860 }
13861 }
13862
13864 {
13865
13866 }
13867
13868 void OnApply(PlayerBase player);
13869
13871 {
13872 return 1.0;
13873 };
13874
13876 {
13878 }
13879
13881 {
13883 }
13884
13886
13888 {
13889 SetDynamicPhysicsLifeTime(0.01);
13891 }
13892
13894 {
13895 array<string> zone_names = new array<string>;
13896 GetDamageZones(zone_names);
13897 for (int i = 0; i < zone_names.Count(); i++)
13898 {
13899 SetHealthMax(zone_names.Get(i),"Health");
13900 }
13901 SetHealthMax("","Health");
13902 }
13903
13906 {
13907 float global_health = GetHealth01("","Health");
13908 array<string> zones = new array<string>;
13909 GetDamageZones(zones);
13910
13911 for (int i = 0; i < zones.Count(); i++)
13912 {
13913 SetHealth01(zones.Get(i),"Health",global_health);
13914 }
13915 }
13916
13919 {
13920 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13921 }
13922
13924 {
13925 if (!hasRootAsPlayer)
13926 {
13927 if (refParentIB)
13928 {
13929
13930 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13931 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13932
13933 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13934 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13935
13938 }
13939 else
13940 {
13941
13944 }
13945 }
13946 }
13947
13949 {
13951 {
13952 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13953 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13954 {
13955 float heatPermCoef = 1.0;
13957 while (ent)
13958 {
13959 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13960 ent = ent.GetHierarchyParent();
13961 }
13962
13963 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13964 }
13965 }
13966 }
13967
13969 {
13970
13971 EntityAI parent = GetHierarchyParent();
13972 if (!parent)
13973 {
13974 hasParent = false;
13975 hasRootAsPlayer = false;
13976 }
13977 else
13978 {
13979 hasParent = true;
13980 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13981 refParentIB =
ItemBase.Cast(parent);
13982 }
13983 }
13984
13985 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13986 {
13987
13988 }
13989
13991 {
13992
13993 return false;
13994 }
13995
13997 {
13998
13999
14000 return false;
14001 }
14002
14004 {
14005
14006 return false;
14007 }
14008
14011 {
14012 return !GetIsFrozen() &&
IsOpen();
14013 }
14014
14016 {
14017 bool hasParent = false, hasRootAsPlayer = false;
14019
14020 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14021 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14022
14023 if (wwtu || foodDecay)
14024 {
14028
14029 if (processWetness || processTemperature || processDecay)
14030 {
14032
14033 if (processWetness)
14034 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14035
14036 if (processTemperature)
14038
14039 if (processDecay)
14040 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14041 }
14042 }
14043 }
14044
14047 {
14049 }
14050
14052 {
14055
14056 return super.GetTemperatureFreezeThreshold();
14057 }
14058
14060 {
14063
14064 return super.GetTemperatureThawThreshold();
14065 }
14066
14068 {
14071
14072 return super.GetItemOverheatThreshold();
14073 }
14074
14076 {
14078 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14079
14080 return super.GetTemperatureFreezeTime();
14081 }
14082
14084 {
14086 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14087
14088 return super.GetTemperatureThawTime();
14089 }
14090
14095
14097 {
14098 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14099 }
14100
14102 {
14103 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14104 }
14105
14108 {
14110 }
14111
14113 {
14115 }
14116
14118 {
14120 }
14121
14124 {
14125 return null;
14126 }
14127
14130 {
14131 return false;
14132 }
14133
14135 {
14137 {
14140 if (!trg)
14141 {
14143 explosive = this;
14144 }
14145
14146 explosive.PairRemote(trg);
14148
14149 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14150 trg.SetPersistentPairID(persistentID);
14151 explosive.SetPersistentPairID(persistentID);
14152
14153 return true;
14154 }
14155 return false;
14156 }
14157
14160 {
14161 float ret = 1.0;
14164 ret *= GetHealth01();
14165
14166 return ret;
14167 }
14168
14169 #ifdef DEVELOPER
14170 override void SetDebugItem()
14171 {
14172 super.SetDebugItem();
14173 _itemBase = this;
14174 }
14175
14177 {
14178 string text = super.GetDebugText();
14179
14181 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14182
14183 return text;
14184 }
14185 #endif
14186
14188 {
14189 return true;
14190 }
14191
14193
14195
14197 {
14200 }
14201
14202
14210
14226}
14227
14229{
14231 if (entity)
14232 {
14233 bool is_item = entity.IsInherited(
ItemBase);
14234 if (is_item && full_quantity)
14235 {
14238 }
14239 }
14240 else
14241 {
14243 return NULL;
14244 }
14245 return entity;
14246}
14247
14249{
14250 if (item)
14251 {
14252 if (health > 0)
14253 item.SetHealth("", "", health);
14254
14255 if (item.CanHaveTemperature())
14256 {
14258 if (item.CanFreeze())
14259 item.SetFrozen(false);
14260 }
14261
14262 if (item.HasEnergyManager())
14263 {
14264 if (quantity >= 0)
14265 {
14266 item.GetCompEM().SetEnergy0To1(quantity);
14267 }
14268 else
14269 {
14271 }
14272 }
14273 else if (item.IsMagazine())
14274 {
14275 Magazine mag = Magazine.Cast(item);
14276 if (quantity >= 0)
14277 {
14278 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14279 }
14280 else
14281 {
14283 }
14284
14285 }
14286 else
14287 {
14288 if (quantity >= 0)
14289 {
14290 item.SetQuantityNormalized(quantity, false);
14291 }
14292 else
14293 {
14295 }
14296
14297 }
14298 }
14299}
14300
14301#ifdef DEVELOPER
14303#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.