9394{
9396 {
9397 return true;
9398 }
9399};
9400
9401
9402
9404{
9408
9410
9413
9414
9415
9416
9417
9426
9432
9437
9442
9463 protected bool m_IsResultOfSplit
9464
9466
9471
9472
9473
9475
9479
9480
9481
9483
9486
9487
9488
9494
9495
9503
9506
9507
9509
9510
9512
9513
9518
9519
9524
9525
9527
9528
9530 {
9535
9536 if (!
GetGame().IsDedicatedServer())
9537 {
9539 {
9541
9543 {
9545 }
9546 }
9547
9550 }
9551
9552 m_OldLocation = null;
9553
9555 {
9557 }
9558
9559 if (ConfigIsExisting("headSelectionsToHide"))
9560 {
9563 }
9564
9566 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9567 {
9569 }
9570
9572
9573 m_IsResultOfSplit = false;
9574
9576 }
9577
9579 {
9580 super.InitItemVariables();
9581
9587 m_Count = ConfigGetInt(
"count");
9588
9591
9596
9599
9604
9616
9620
9621
9624 if (ConfigIsExisting("canBeSplit"))
9625 {
9628 }
9629
9631 if (ConfigIsExisting("itemBehaviour"))
9633
9634
9637 RegisterNetSyncVariableInt("m_VarLiquidType");
9638 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9639
9640 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9641 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9642 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9643
9644 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9645 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9646 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9647 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9648
9649 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9650 RegisterNetSyncVariableBool("m_IsTakeable");
9651 RegisterNetSyncVariableBool("m_IsHologram");
9652
9655 {
9658 }
9659
9661
9663 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9665
9666 }
9667
9669 {
9671 }
9672
9674 {
9677 {
9682 }
9683 }
9684
9685 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9686 {
9688 {
9691 }
9692
9694 }
9695
9697 {
9703 }
9704
9706
9708 {
9710
9711 if (!action)
9712 {
9713 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9714 return;
9715 }
9716
9718 if (!ai)
9719 {
9721 return;
9722 }
9723
9725 if (!action_array)
9726 {
9727 action_array = new array<ActionBase_Basic>;
9729 }
9730 if (LogManager.IsActionLogEnable())
9731 {
9732 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9733 }
9734
9735 if (action_array.Find(action) != -1)
9736 {
9737 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9738 }
9739 else
9740 {
9741 action_array.Insert(action);
9742 }
9743 }
9744
9746 {
9748 ActionBase action = player.GetActionManager().GetAction(actionName);
9751
9752 if (action_array)
9753 {
9754 action_array.RemoveItem(action);
9755 }
9756 }
9757
9758
9759
9761 {
9762 ActionOverrideData overrideData = new ActionOverrideData();
9766
9768 if (!actionMap)
9769 {
9772 }
9773
9774 actionMap.Insert(this.
Type(), overrideData);
9775
9776 }
9777
9779
9781
9782
9784 {
9787
9790
9791 string config_to_search = "CfgVehicles";
9792 string muzzle_owner_config;
9793
9795 {
9796 if (IsInherited(Weapon))
9797 config_to_search = "CfgWeapons";
9798
9799 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9800
9801 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9802
9804
9805 if (config_OnFire_subclass_count > 0)
9806 {
9807 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9808
9809 for (int i = 0; i < config_OnFire_subclass_count; i++)
9810 {
9811 string particle_class = "";
9813 string config_OnFire_entry = config_OnFire_class + particle_class;
9814 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9815 WPOF_array.Insert(WPOF);
9816 }
9817
9818
9820 }
9821 }
9822
9824 {
9825 config_to_search = "CfgWeapons";
9826 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9827
9828 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9829
9831
9832 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9833 {
9834 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9835
9836 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9837 {
9838 string particle_class2 = "";
9840 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9841 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9842 WPOBE_array.Insert(WPOBE);
9843 }
9844
9845
9847 }
9848 }
9849 }
9850
9851
9853 {
9856
9858 {
9859 string config_to_search = "CfgVehicles";
9860
9861 if (IsInherited(Weapon))
9862 config_to_search = "CfgWeapons";
9863
9864 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9865 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9866
9867 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9868 {
9869
9871
9873 {
9875 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9877 return;
9878 }
9879
9882
9883
9884
9886 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9887
9888 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9889 {
9890 string particle_class = "";
9892 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9894
9895 if (entry_type == CT_CLASS)
9896 {
9897 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9898 WPOOH_array.Insert(WPOF);
9899 }
9900 }
9901
9902
9904 }
9905 }
9906 }
9907
9909 {
9911 }
9912
9914 {
9916 {
9918
9921
9924
9925 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9926 }
9927 }
9928
9930 {
9932 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9933
9935 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9936
9938 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9939
9941 {
9943 }
9944 }
9945
9947 {
9949 }
9950
9952 {
9955 else
9957
9959 {
9962 }
9963 else
9964 {
9967
9970 }
9971
9973 }
9974
9976 {
9978 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9979 }
9980
9982 {
9984 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9986 }
9987
9989 {
9991 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9992 }
9993
9995 {
9998
9999 OverheatingParticle OP = new OverheatingParticle();
10004
10006 }
10007
10009 {
10012
10013 return -1;
10014 }
10015
10017 {
10019 {
10022
10023 for (int i = count; i > 0; --i)
10024 {
10025 int id = i - 1;
10028
10031
10032 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10033 {
10034 if (p)
10035 {
10038 }
10039 }
10040 }
10041 }
10042 }
10043
10045 {
10047 {
10049 {
10050 int id = i - 1;
10052
10053 if (OP)
10054 {
10056
10057 if (p)
10058 {
10060 }
10061
10062 delete OP;
10063 }
10064 }
10065
10068 }
10069 }
10070
10073 {
10074 return 0.0;
10075 }
10076
10077
10079 {
10080 return 250;
10081 }
10082
10084 {
10085 return 0;
10086 }
10087
10090 {
10092 return true;
10093
10094 return false;
10095 }
10096
10099 {
10102
10104 {
10106 }
10107 else
10108 {
10109
10111 }
10112
10114 }
10115
10122 {
10123 return -1;
10124 }
10125
10126
10127
10128
10130 {
10132 {
10134 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10135
10136 if (r_index >= 0)
10137 {
10138 InventoryLocation r_il = new InventoryLocation;
10139 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10140
10141 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10144 {
10145 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10146 }
10148 {
10149 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10150 }
10151
10152 }
10153
10154 player.GetHumanInventory().ClearUserReservedLocation(this);
10155 }
10156
10159 }
10160
10161
10162
10163
10165 {
10166 return ItemBase.m_DebugActionsMask;
10167 }
10168
10170 {
10171 return ItemBase.m_DebugActionsMask & mask;
10172 }
10173
10175 {
10176 ItemBase.m_DebugActionsMask = mask;
10177 }
10178
10180 {
10181 ItemBase.m_DebugActionsMask |= mask;
10182 }
10183
10185 {
10186 ItemBase.m_DebugActionsMask &= ~mask;
10187 }
10188
10190 {
10192 {
10194 }
10195 else
10196 {
10198 }
10199 }
10200
10201
10203 {
10204 if (GetEconomyProfile())
10205 {
10206 float q_max = GetEconomyProfile().GetQuantityMax();
10207 if (q_max > 0)
10208 {
10209 float q_min = GetEconomyProfile().GetQuantityMin();
10210 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10211
10213 {
10214 ComponentEnergyManager comp = GetCompEM();
10216 {
10218 }
10219 }
10221 {
10223
10224 }
10225
10226 }
10227 }
10228 }
10229
10232 {
10233 EntityAI parent = GetHierarchyParent();
10234
10235 if (parent)
10236 {
10237 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10238 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10239 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10240 }
10241 }
10242
10245 {
10246 EntityAI parent = GetHierarchyParent();
10247
10248 if (parent)
10249 {
10250 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10251 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10252 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10253 }
10254 }
10255
10257 {
10258
10259
10260
10261
10263
10265 {
10266 if (ScriptInputUserData.CanStoreInputUserData())
10267 {
10268 ScriptInputUserData ctx = new ScriptInputUserData;
10274 ctx.
Write(use_stack_max);
10277
10279 {
10280 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10281 }
10282 }
10283 }
10284 else if (!
GetGame().IsMultiplayer())
10285 {
10287 }
10288 }
10289
10291 {
10293 }
10294
10296 {
10298 }
10299
10301 {
10303 }
10304
10306 {
10307
10308 return false;
10309 }
10310
10312 {
10313 return false;
10314 }
10315
10319 {
10320 return false;
10321 }
10322
10324 {
10325 return "";
10326 }
10327
10329
10331 {
10332 return false;
10333 }
10334
10336 {
10337 return true;
10338 }
10339
10340
10341
10343 {
10344 return true;
10345 }
10346
10348 {
10349 return true;
10350 }
10351
10353 {
10354 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10356 }
10357
10359 {
10361 }
10362
10364 {
10366 if (!is_being_placed)
10368 SetSynchDirty();
10369 }
10370
10371
10373
10375 {
10377 }
10378
10380 {
10382 }
10383
10385 {
10386 return 1;
10387 }
10388
10390 {
10391 return false;
10392 }
10393
10395 {
10397 SetSynchDirty();
10398 }
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10435 {
10436 super.OnMovedInsideCargo(container);
10437
10438 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10439 }
10440
10441 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10442 {
10443 super.EEItemLocationChanged(oldLoc,newLoc);
10444
10445 PlayerBase new_player = null;
10446 PlayerBase old_player = null;
10447
10448 if (newLoc.GetParent())
10449 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10450
10451 if (oldLoc.GetParent())
10452 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10453
10455 {
10456 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10457
10458 if (r_index >= 0)
10459 {
10460 InventoryLocation r_il = new InventoryLocation;
10461 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10462
10463 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10466 {
10467 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10468 }
10470 {
10471 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10472 }
10473
10474 }
10475 }
10476
10478 {
10479 if (new_player)
10480 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10481
10482 if (new_player == old_player)
10483 {
10484
10485 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10486 {
10488 {
10489 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10490 {
10491 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10492 }
10493 }
10494 else
10495 {
10496 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10497 }
10498 }
10499
10500 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10501 {
10502 int type = oldLoc.GetType();
10504 {
10505 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10506 }
10508 {
10509 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10510 }
10511 }
10512 if (!m_OldLocation)
10513 {
10514 m_OldLocation = new InventoryLocation;
10515 }
10516 m_OldLocation.Copy(oldLoc);
10517 }
10518 else
10519 {
10520 if (m_OldLocation)
10521 {
10522 m_OldLocation.Reset();
10523 }
10524 }
10525
10527 }
10528 else
10529 {
10530 if (new_player)
10531 {
10532 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10533 if (res_index >= 0)
10534 {
10535 InventoryLocation il = new InventoryLocation;
10536 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10538 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10541 {
10542 il.
GetParent().GetOnReleaseLock().Invoke(it);
10543 }
10545 {
10547 }
10548
10549 }
10550 }
10552 {
10553
10555 }
10556
10557 if (m_OldLocation)
10558 {
10559 m_OldLocation.Reset();
10560 }
10561 }
10562 }
10563
10564 override void EOnContact(IEntity other, Contact extra)
10565 {
10567 {
10568 int liquidType = -1;
10570 if (impactSpeed > 0.0)
10571 {
10573 #ifndef SERVER
10575 #else
10577 SetSynchDirty();
10578 #endif
10580 }
10581 }
10582
10583 #ifdef SERVER
10584 if (GetCompEM() && GetCompEM().IsPlugged())
10585 {
10586 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10587 GetCompEM().UnplugThis();
10588 }
10589 #endif
10590 }
10591
10593
10595 {
10597 }
10598
10600 {
10601
10602 }
10603
10605 {
10606 super.OnItemLocationChanged(old_owner, new_owner);
10607
10608 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10609 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10610
10611 if (!relatedPlayer && playerNew)
10612 relatedPlayer = playerNew;
10613
10614 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10615 {
10617 if (actionMgr)
10618 {
10619 ActionBase currentAction = actionMgr.GetRunningAction();
10620 if (currentAction)
10622 }
10623 }
10624
10625 Man ownerPlayerOld = null;
10626 Man ownerPlayerNew = null;
10627
10628 if (old_owner)
10629 {
10630 if (old_owner.
IsMan())
10631 {
10632 ownerPlayerOld = Man.Cast(old_owner);
10633 }
10634 else
10635 {
10636 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10637 }
10638 }
10639 else
10640 {
10642 {
10644
10645 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10646 {
10647 GetCompEM().UnplugThis();
10648 }
10649 }
10650 }
10651
10652 if (new_owner)
10653 {
10654 if (new_owner.
IsMan())
10655 {
10656 ownerPlayerNew = Man.Cast(new_owner);
10657 }
10658 else
10659 {
10660 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10661 }
10662 }
10663
10664 if (ownerPlayerOld != ownerPlayerNew)
10665 {
10666 if (ownerPlayerOld)
10667 {
10668 array<EntityAI> subItemsExit = new array<EntityAI>;
10670 for (int i = 0; i < subItemsExit.Count(); i++)
10671 {
10674 }
10675 }
10676
10677 if (ownerPlayerNew)
10678 {
10679 array<EntityAI> subItemsEnter = new array<EntityAI>;
10681 for (int j = 0; j < subItemsEnter.Count(); j++)
10682 {
10685 }
10686 }
10687 }
10688 else if (ownerPlayerNew != null)
10689 {
10690 PlayerBase nplayer;
10691 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10692 {
10693 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10695 for (int k = 0; k < subItemsUpdate.Count(); k++)
10696 {
10698 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10699 }
10700 }
10701 }
10702
10703 if (old_owner)
10704 old_owner.OnChildItemRemoved(this);
10705 if (new_owner)
10706 new_owner.OnChildItemReceived(this);
10707 }
10708
10709
10711 {
10712 super.EEDelete(parent);
10713 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10714 if (player)
10715 {
10717
10718 if (player.IsAlive())
10719 {
10720 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10721 if (r_index >= 0)
10722 {
10723 InventoryLocation r_il = new InventoryLocation;
10724 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10725
10726 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10729 {
10730 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10731 }
10733 {
10734 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10735 }
10736
10737 }
10738
10739 player.RemoveQuickBarEntityShortcut(this);
10740 }
10741 }
10742 }
10743
10745 {
10746 super.EEKilled(killer);
10747
10750 {
10751 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10752 {
10753 if (IsMagazine())
10754 {
10755 if (Magazine.Cast(this).GetAmmoCount() > 0)
10756 {
10758 }
10759 }
10760 else
10761 {
10763 }
10764 }
10765 }
10766 }
10767
10769 {
10770 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10771
10772 super.OnWasAttached(parent, slot_id);
10773
10776
10778 }
10779
10781 {
10782 super.OnWasDetached(parent, slot_id);
10783
10786 }
10787
10789 {
10790 int idx;
10793
10794 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10795 if (inventory_slots.Count() < 1)
10796 {
10797 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10798 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10799 }
10800 else
10801 {
10802 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10803 }
10804
10805 idx = inventory_slots.Find(slot);
10806 if (idx < 0)
10807 return "";
10808
10809 return attach_types.Get(idx);
10810 }
10811
10813 {
10814 int idx = -1;
10815 string slot;
10816
10819
10820 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10821 if (inventory_slots.Count() < 1)
10822 {
10823 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10824 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10825 }
10826 else
10827 {
10828 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10829 if (detach_types.Count() < 1)
10830 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10831 }
10832
10833 for (int i = 0; i < inventory_slots.Count(); i++)
10834 {
10835 slot = inventory_slots.Get(i);
10836 }
10837
10838 if (slot != "")
10839 {
10840 if (detach_types.Count() == 1)
10841 idx = 0;
10842 else
10843 idx = inventory_slots.Find(slot);
10844 }
10845 if (idx < 0)
10846 return "";
10847
10848 return detach_types.Get(idx);
10849 }
10850
10852 {
10853
10855
10856
10857 float min_time = 1;
10858 float max_time = 3;
10859 float delay = Math.RandomFloat(min_time, max_time);
10860
10861 explode_timer.Run(delay, this, "DoAmmoExplosion");
10862 }
10863
10865 {
10866 Magazine magazine = Magazine.Cast(this);
10867 int pop_sounds_count = 6;
10868 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10869
10870
10871 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10872 string sound_name = pop_sounds[ sound_idx ];
10874
10875
10876 magazine.ServerAddAmmoCount(-1);
10877
10878
10879 float min_temp_to_explode = 100;
10880
10881 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10882 {
10884 }
10885 }
10886
10887
10888 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10889 {
10890 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10891
10892 const int CHANCE_DAMAGE_CARGO = 4;
10893 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10894 const int CHANCE_DAMAGE_NOTHING = 2;
10895
10897 {
10898 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10899 int chances;
10900 int rnd;
10901
10902 if (GetInventory().GetCargo())
10903 {
10904 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10905 rnd = Math.RandomInt(0,chances);
10906
10907 if (rnd < CHANCE_DAMAGE_CARGO)
10908 {
10910 }
10911 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10912 {
10914 }
10915 }
10916 else
10917 {
10918 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10919 rnd = Math.RandomInt(0,chances);
10920
10921 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10922 {
10924 }
10925 }
10926 }
10927 }
10928
10930 {
10931 if (GetInventory().GetCargo())
10932 {
10933 int item_count = GetInventory().GetCargo().GetItemCount();
10934 if (item_count > 0)
10935 {
10936 int random_pick = Math.RandomInt(0, item_count);
10938 if (!item.IsExplosive())
10939 {
10940 item.AddHealth("","",damage);
10941 return true;
10942 }
10943 }
10944 }
10945 return false;
10946 }
10947
10949 {
10950 int attachment_count = GetInventory().AttachmentCount();
10951 if (attachment_count > 0)
10952 {
10953 int random_pick = Math.RandomInt(0, attachment_count);
10954 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10955 if (!attachment.IsExplosive())
10956 {
10957 attachment.AddHealth("","",damage);
10958 return true;
10959 }
10960 }
10961 return false;
10962 }
10963
10965 {
10967 }
10968
10970 {
10972 return GetInventory().CanRemoveEntity();
10973
10974 return false;
10975 }
10976
10978 {
10980 return;
10981
10983 {
10984 if (ScriptInputUserData.CanStoreInputUserData())
10985 {
10986 ScriptInputUserData ctx = new ScriptInputUserData;
10991 ctx.
Write(destination_entity);
10993 ctx.
Write(slot_id);
10995 }
10996 }
10997 else if (!
GetGame().IsMultiplayer())
10998 {
11000 }
11001 }
11002
11004 {
11006 return;
11007
11008 float split_quantity_new;
11012 InventoryLocation loc = new InventoryLocation;
11013
11014 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11015 {
11017 split_quantity_new = stack_max;
11018 else
11020
11021 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11022 if (new_item)
11023 {
11024 new_item.SetResultOfSplit(true);
11025 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11027 new_item.SetQuantity(split_quantity_new);
11028 }
11029 }
11030 else if (destination_entity && slot_id == -1)
11031 {
11032 if (quantity > stack_max)
11033 split_quantity_new = stack_max;
11034 else
11035 split_quantity_new = quantity;
11036
11038 {
11041 }
11042
11043 if (new_item)
11044 {
11045 new_item.SetResultOfSplit(true);
11046 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11048 new_item.SetQuantity(split_quantity_new);
11049 }
11050 }
11051 else
11052 {
11053 if (stack_max != 0)
11054 {
11056 {
11058 }
11059
11060 if (split_quantity_new == 0)
11061 {
11062 if (!
GetGame().IsMultiplayer())
11063 player.PhysicalPredictiveDropItem(this);
11064 else
11065 player.ServerDropEntity(this);
11066 return;
11067 }
11068
11070
11071 if (new_item)
11072 {
11073 new_item.SetResultOfSplit(true);
11074 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11076 new_item.SetQuantity(stack_max);
11077 new_item.PlaceOnSurface();
11078 }
11079 }
11080 }
11081 }
11082
11084 {
11086 return;
11087
11088 float split_quantity_new;
11092 InventoryLocation loc = new InventoryLocation;
11093
11094 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11095 {
11097 split_quantity_new = stack_max;
11098 else
11100
11101 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11102 if (new_item)
11103 {
11104 new_item.SetResultOfSplit(true);
11105 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11107 new_item.SetQuantity(split_quantity_new);
11108 }
11109 }
11110 else if (destination_entity && slot_id == -1)
11111 {
11112 if (quantity > stack_max)
11113 split_quantity_new = stack_max;
11114 else
11115 split_quantity_new = quantity;
11116
11118 {
11121 }
11122
11123 if (new_item)
11124 {
11125 new_item.SetResultOfSplit(true);
11126 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11128 new_item.SetQuantity(split_quantity_new);
11129 }
11130 }
11131 else
11132 {
11133 if (stack_max != 0)
11134 {
11136 {
11138 }
11139
11141
11142 if (new_item)
11143 {
11144 new_item.SetResultOfSplit(true);
11145 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11147 new_item.SetQuantity(stack_max);
11148 new_item.PlaceOnSurface();
11149 }
11150 }
11151 }
11152 }
11153
11155 {
11157 return;
11158
11160 {
11161 if (ScriptInputUserData.CanStoreInputUserData())
11162 {
11163 ScriptInputUserData ctx = new ScriptInputUserData;
11168 dst.WriteToContext(ctx);
11170 }
11171 }
11172 else if (!
GetGame().IsMultiplayer())
11173 {
11175 }
11176 }
11177
11179 {
11181 return;
11182
11184 {
11185 if (ScriptInputUserData.CanStoreInputUserData())
11186 {
11187 ScriptInputUserData ctx = new ScriptInputUserData;
11192 ctx.
Write(destination_entity);
11198 }
11199 }
11200 else if (!
GetGame().IsMultiplayer())
11201 {
11203 }
11204 }
11205
11207 {
11209 }
11210
11212 {
11214 return this;
11215
11217 float split_quantity_new;
11219 if (dst.IsValid())
11220 {
11221 int slot_id = dst.GetSlot();
11223
11224 if (quantity > stack_max)
11225 split_quantity_new = stack_max;
11226 else
11227 split_quantity_new = quantity;
11228
11230
11231 if (new_item)
11232 {
11233 new_item.SetResultOfSplit(true);
11234 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11237 }
11238
11239 return new_item;
11240 }
11241
11242 return null;
11243 }
11244
11246 {
11248 return;
11249
11251 float split_quantity_new;
11253 if (destination_entity)
11254 {
11256 if (quantity > stackable)
11257 split_quantity_new = stackable;
11258 else
11259 split_quantity_new = quantity;
11260
11261 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11262 if (new_item)
11263 {
11264 new_item.SetResultOfSplit(true);
11265 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11267 new_item.SetQuantity(split_quantity_new);
11268 }
11269 }
11270 }
11271
11273 {
11275 return;
11276
11278 {
11279 if (ScriptInputUserData.CanStoreInputUserData())
11280 {
11281 ScriptInputUserData ctx = new ScriptInputUserData;
11286 ItemBase destination_entity =
this;
11287 ctx.
Write(destination_entity);
11291 }
11292 }
11293 else if (!
GetGame().IsMultiplayer())
11294 {
11296 }
11297 }
11298
11300 {
11302 return;
11303
11305 float split_quantity_new;
11307 if (player)
11308 {
11310 if (quantity > stackable)
11311 split_quantity_new = stackable;
11312 else
11313 split_quantity_new = quantity;
11314
11315 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11316 new_item =
ItemBase.Cast(in_hands);
11317 if (new_item)
11318 {
11319 new_item.SetResultOfSplit(true);
11320 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11322 new_item.SetQuantity(split_quantity_new);
11323 }
11324 }
11325 }
11326
11328 {
11330 return;
11331
11333 float split_quantity_new = Math.Floor(quantity * 0.5);
11334
11336
11337 if (new_item)
11338 {
11339 if (new_item.GetQuantityMax() < split_quantity_new)
11340 {
11341 split_quantity_new = new_item.GetQuantityMax();
11342 }
11343
11344 new_item.SetResultOfSplit(true);
11345 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11346
11348 {
11351 }
11352 else
11353 {
11356 }
11357 }
11358 }
11359
11361 {
11363 return;
11364
11366 float split_quantity_new = Math.Floor(quantity / 2);
11367
11368 InventoryLocation invloc = new InventoryLocation;
11370
11372 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11373
11374 if (new_item)
11375 {
11376 if (new_item.GetQuantityMax() < split_quantity_new)
11377 {
11378 split_quantity_new = new_item.GetQuantityMax();
11379 }
11381 {
11384 }
11385 else
11386 {
11389 }
11390 }
11391 }
11392
11395 {
11396 SetWeightDirty();
11398
11399 if (parent)
11400 parent.OnAttachmentQuantityChangedEx(this, delta);
11401
11403 {
11405 {
11407 }
11409 {
11410 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11412 }
11413 }
11414
11415 }
11416
11419 {
11420
11421 }
11422
11425 {
11427 }
11428
11430 {
11431 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11432
11434 {
11435 if (newLevel == GameConstants.STATE_RUINED)
11436 {
11438 EntityAI parent = GetHierarchyParent();
11439 if (parent && parent.IsFireplace())
11440 {
11441 CargoBase cargo = GetInventory().GetCargo();
11442 if (cargo)
11443 {
11445 {
11447 }
11448 }
11449 }
11450 }
11451
11453 {
11454
11456 return;
11457 }
11458
11459 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11460 {
11462 }
11463 }
11464 }
11465
11466
11468 {
11469 super.OnRightClick();
11470
11472 {
11474 {
11475 if (ScriptInputUserData.CanStoreInputUserData())
11476 {
11477 vector m4[4];
11479
11480 EntityAI root = GetHierarchyRoot();
11481
11482 InventoryLocation dst = new InventoryLocation;
11484 {
11485 if (root)
11486 {
11487 root.GetTransform(m4);
11489 }
11490 else
11491 GetInventory().GetCurrentInventoryLocation(dst);
11492 }
11493 else
11494 {
11496
11497
11498 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11499 {
11500 if (root)
11501 {
11502 root.GetTransform(m4);
11504 }
11505 else
11506 GetInventory().GetCurrentInventoryLocation(dst);
11507 }
11508 else
11509 {
11510 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11511 }
11512 }
11513
11514 ScriptInputUserData ctx = new ScriptInputUserData;
11522 }
11523 }
11524 else if (!
GetGame().IsMultiplayer())
11525 {
11527 }
11528 }
11529 }
11530
11531 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11532 {
11533
11534 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11535 return false;
11536
11537 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11538 return false;
11539
11540
11542 return false;
11543
11544
11545 Magazine mag = Magazine.Cast(this);
11546 if (mag)
11547 {
11548 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11549 return false;
11550
11551 if (stack_max_limit)
11552 {
11553 Magazine other_mag = Magazine.Cast(other_item);
11554 if (other_item)
11555 {
11556 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11557 return false;
11558 }
11559
11560 }
11561 }
11562 else
11563 {
11564
11566 return false;
11567
11569 return false;
11570 }
11571
11572 PlayerBase player = null;
11573 if (CastTo(player, GetHierarchyRootPlayer()))
11574 {
11575 if (player.GetInventory().HasAttachment(this))
11576 return false;
11577
11578 if (player.IsItemsToDelete())
11579 return false;
11580 }
11581
11582 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11583 return false;
11584
11585 int slotID;
11587 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11588 return false;
11589
11590 return true;
11591 }
11592
11594 {
11596 }
11597
11599 {
11600 return m_IsResultOfSplit;
11601 }
11602
11604 {
11605 m_IsResultOfSplit = value;
11606 }
11607
11609 {
11611 }
11612
11614 {
11615 float other_item_quantity = other_item.GetQuantity();
11616 float this_free_space;
11617
11619
11621
11622 if (other_item_quantity > this_free_space)
11623 {
11624 return this_free_space;
11625 }
11626 else
11627 {
11628 return other_item_quantity;
11629 }
11630 }
11631
11633 {
11635 }
11636
11638 {
11640 return;
11641
11642 if (!IsMagazine() && other_item)
11643 {
11645 if (quantity_used != 0)
11646 {
11647 float hp1 = GetHealth01("","");
11648 float hp2 = other_item.GetHealth01("","");
11649 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11650 hpResult = hpResult / (
GetQuantity() + quantity_used);
11651
11652 hpResult *= GetMaxHealth();
11653 Math.Round(hpResult);
11654 SetHealth("", "Health", hpResult);
11655
11657 other_item.AddQuantity(-quantity_used);
11658 }
11659 }
11661 }
11662
11664 {
11665 #ifdef SERVER
11666 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11667 GetHierarchyParent().IncreaseLifetimeUp();
11668 #endif
11669 };
11670
11672 {
11673 PlayerBase p = PlayerBase.Cast(player);
11674
11675 array<int> recipesIds = p.m_Recipes;
11676 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11677 if (moduleRecipesManager)
11678 {
11679 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11680 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11681 }
11682
11683 for (int i = 0;i < recipesIds.Count(); i++)
11684 {
11685 int key = recipesIds.Get(i);
11686 string recipeName = moduleRecipesManager.GetRecipeName(key);
11688 }
11689 }
11690
11691
11692 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11693 {
11694 super.GetDebugActions(outputList);
11695
11696
11701
11702
11706
11710
11711
11714
11715
11717 {
11720 }
11721
11723
11726
11730 }
11731
11732
11733
11734
11736 {
11737 super.OnAction(action_id, player, ctx);
11738 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11739 {
11740 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11741 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11742 PlayerBase p = PlayerBase.Cast(player);
11743 if (
EActions.RECIPES_RANGE_START < 1000)
11744 {
11745 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11746 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11747 }
11748 }
11749 #ifndef SERVER
11750 else if (action_id ==
EActions.WATCH_PLAYER)
11751 {
11752 PluginDeveloper.SetDeveloperItemClientEx(player);
11753 }
11754 #endif
11756 {
11757 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11758 {
11759 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11760 OnDebugButtonPressServer(id + 1);
11761 }
11762
11763 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11764 {
11765 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11767 }
11768
11769 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11770 {
11771 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11773 }
11774
11775 else if (action_id ==
EActions.ADD_QUANTITY)
11776 {
11777 if (IsMagazine())
11778 {
11779 Magazine mag = Magazine.Cast(this);
11780 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11781 }
11782 else
11783 {
11785 }
11786
11787 if (m_EM)
11788 {
11789 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11790 }
11791
11792 }
11793
11794 else if (action_id ==
EActions.REMOVE_QUANTITY)
11795 {
11796 if (IsMagazine())
11797 {
11798 Magazine mag2 = Magazine.Cast(this);
11799 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11800 }
11801 else
11802 {
11804 }
11805 if (m_EM)
11806 {
11807 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11808 }
11809
11810 }
11811
11812 else if (action_id ==
EActions.SET_QUANTITY_0)
11813 {
11815
11816 if (m_EM)
11817 {
11818 m_EM.SetEnergy(0);
11819 }
11820 }
11821
11822 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11823 {
11825
11826 if (m_EM)
11827 {
11828 m_EM.SetEnergy(m_EM.GetEnergyMax());
11829 }
11830 }
11831
11832 else if (action_id ==
EActions.ADD_HEALTH)
11833 {
11834 AddHealth("","",GetMaxHealth("","Health")/5);
11835 }
11836 else if (action_id ==
EActions.REMOVE_HEALTH)
11837 {
11838 AddHealth("","",-GetMaxHealth("","Health")/5);
11839 }
11840 else if (action_id ==
EActions.DESTROY_HEALTH)
11841 {
11842 SetHealth01("","",0);
11843 }
11844 else if (action_id ==
EActions.WATCH_ITEM)
11845 {
11847 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11848 #ifdef DEVELOPER
11849 SetDebugDeveloper_item(this);
11850 #endif
11851 }
11852
11853 else if (action_id ==
EActions.ADD_TEMPERATURE)
11854 {
11855 AddTemperature(20);
11856
11857 }
11858
11859 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11860 {
11861 AddTemperature(-20);
11862
11863 }
11864
11865 else if (action_id ==
EActions.FLIP_FROZEN)
11866 {
11867 SetFrozen(!GetIsFrozen());
11868
11869 }
11870
11871 else if (action_id ==
EActions.ADD_WETNESS)
11872 {
11874
11875 }
11876
11877 else if (action_id ==
EActions.REMOVE_WETNESS)
11878 {
11880
11881 }
11882
11883 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11884 {
11887
11888
11889 }
11890
11891 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11892 {
11895 }
11896
11897 else if (action_id ==
EActions.MAKE_SPECIAL)
11898 {
11899 auto debugParams = DebugSpawnParams.WithPlayer(player);
11900 OnDebugSpawnEx(debugParams);
11901 }
11902
11903 else if (action_id ==
EActions.DELETE)
11904 {
11905 Delete();
11906 }
11907
11908 }
11909
11910
11911 return false;
11912 }
11913
11914
11915
11916
11920
11923
11924
11925
11927 {
11928 return false;
11929 }
11930
11931
11933 {
11934 return true;
11935 }
11936
11937
11939 {
11940 return true;
11941 }
11942
11943
11944
11946 {
11947 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11949 }
11950
11953 {
11954 return null;
11955 }
11956
11958 {
11959 return false;
11960 }
11961
11963 {
11964 return false;
11965 }
11966
11970
11971
11973 {
11974 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11975 return module_repairing.CanRepair(this, item_repair_kit);
11976 }
11977
11978
11979 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11980 {
11981 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11982 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11983 }
11984
11985
11987 {
11988
11989
11990
11991
11992
11993
11994
11995
11996 return 1;
11997 }
11998
11999
12000
12002 {
12004 }
12005
12006
12007
12009 {
12011 }
12012
12013
12022 {
12023 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12024
12025 if (player)
12026 {
12027 player.MessageStatus(text);
12028 }
12029 }
12030
12031
12040 {
12041 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12042
12043 if (player)
12044 {
12045 player.MessageAction(text);
12046 }
12047 }
12048
12049
12058 {
12059 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12060
12061 if (player)
12062 {
12063 player.MessageFriendly(text);
12064 }
12065 }
12066
12067
12076 {
12077 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12078
12079 if (player)
12080 {
12081 player.MessageImportant(text);
12082 }
12083 }
12084
12086 {
12087 return true;
12088 }
12089
12090
12091 override bool KindOf(
string tag)
12092 {
12093 bool found = false;
12094 string item_name = this.
GetType();
12097
12098 int array_size = item_tag_array.Count();
12099 for (int i = 0; i < array_size; i++)
12100 {
12101 if (item_tag_array.Get(i) == tag)
12102 {
12103 found = true;
12104 break;
12105 }
12106 }
12107 return found;
12108 }
12109
12110
12112 {
12113
12114 super.OnRPC(sender, rpc_type,ctx);
12115
12116
12117 switch (rpc_type)
12118 {
12119 #ifndef SERVER
12120 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12121 Param2<bool, string> p = new Param2<bool, string>(false, "");
12122
12124 return;
12125
12126 bool play = p.param1;
12127 string soundSet = p.param2;
12128
12129 if (play)
12130 {
12132 {
12134 {
12136 }
12137 }
12138 else
12139 {
12141 }
12142 }
12143 else
12144 {
12146 }
12147
12148 break;
12149 #endif
12150
12151 }
12152
12154 {
12156 }
12157 }
12158
12159
12160
12161
12163 {
12164 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12165 return plugin.GetID(
name);
12166 }
12167
12169 {
12170 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12171 return plugin.GetName(id);
12172 }
12173
12176 {
12177
12178
12179 int varFlags;
12180 if (!ctx.
Read(varFlags))
12181 return;
12182
12183 if (varFlags & ItemVariableFlags.FLOAT)
12184 {
12186 }
12187 }
12188
12190 {
12191
12192 super.SerializeNumericalVars(floats_out);
12193
12194
12195
12197 {
12199 }
12200
12202 {
12204 }
12205
12207 {
12209 }
12210
12212 {
12217 }
12218
12220 {
12222 }
12223 }
12224
12226 {
12227
12228 super.DeSerializeNumericalVars(floats);
12229
12230
12231 int index = 0;
12232 int mask = Math.Round(floats.Get(index));
12233
12234 index++;
12235
12237 {
12239 {
12241 }
12242 else
12243 {
12244 float quantity = floats.Get(index);
12245 SetQuantity(quantity,
true,
false,
false,
false);
12246 }
12247 index++;
12248 }
12249
12251 {
12252 float wet = floats.Get(index);
12254 index++;
12255 }
12256
12258 {
12259 int liquidtype = Math.Round(floats.Get(index));
12261 index++;
12262 }
12263
12265 {
12267 index++;
12269 index++;
12271 index++;
12273 index++;
12274 }
12275
12277 {
12278 int cleanness = Math.Round(floats.Get(index));
12280 index++;
12281 }
12282 }
12283
12285 {
12286 super.WriteVarsToCTX(ctx);
12287
12288
12290 {
12292 }
12293
12295 {
12297 }
12298
12300 {
12302 }
12303
12305 {
12306 int r,g,b,a;
12312 }
12313
12315 {
12317 }
12318 }
12319
12321 {
12322 if (!super.ReadVarsFromCTX(ctx,version))
12323 return false;
12324
12325 int intValue;
12326 float value;
12327
12328 if (version < 140)
12329 {
12330 if (!ctx.
Read(intValue))
12331 return false;
12332
12333 m_VariablesMask = intValue;
12334 }
12335
12337 {
12338 if (!ctx.
Read(value))
12339 return false;
12340
12342 {
12344 }
12345 else
12346 {
12348 }
12349 }
12350
12351 if (version < 140)
12352 {
12354 {
12355 if (!ctx.
Read(value))
12356 return false;
12357 SetTemperatureDirect(value);
12358 }
12359 }
12360
12362 {
12363 if (!ctx.
Read(value))
12364 return false;
12366 }
12367
12369 {
12370 if (!ctx.
Read(intValue))
12371 return false;
12373 }
12374
12376 {
12377 int r,g,b,a;
12379 return false;
12381 return false;
12383 return false;
12385 return false;
12386
12388 }
12389
12391 {
12392 if (!ctx.
Read(intValue))
12393 return false;
12395 }
12396
12397 if (version >= 138 && version < 140)
12398 {
12400 {
12401 if (!ctx.
Read(intValue))
12402 return false;
12403 SetFrozen(intValue);
12404 }
12405 }
12406
12407 return true;
12408 }
12409
12410
12412 {
12415 {
12417 }
12418
12419 if (!super.OnStoreLoad(ctx, version))
12420 {
12422 return false;
12423 }
12424
12425 if (version >= 114)
12426 {
12427 bool hasQuickBarIndexSaved;
12428
12429 if (!ctx.
Read(hasQuickBarIndexSaved))
12430 {
12432 return false;
12433 }
12434
12435 if (hasQuickBarIndexSaved)
12436 {
12437 int itmQBIndex;
12438
12439
12440 if (!ctx.
Read(itmQBIndex))
12441 {
12443 return false;
12444 }
12445
12446 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12447 if (itmQBIndex != -1 && parentPlayer)
12448 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12449 }
12450 }
12451 else
12452 {
12453
12454 PlayerBase player;
12455 int itemQBIndex;
12456 if (version ==
int.
MAX)
12457 {
12458 if (!ctx.
Read(itemQBIndex))
12459 {
12461 return false;
12462 }
12463 }
12464 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12465 {
12466
12467 if (!ctx.
Read(itemQBIndex))
12468 {
12470 return false;
12471 }
12472 if (itemQBIndex != -1 && player)
12473 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12474 }
12475 }
12476
12477 if (version < 140)
12478 {
12479
12480 if (!LoadVariables(ctx, version))
12481 {
12483 return false;
12484 }
12485 }
12486
12487
12489 {
12491 return false;
12492 }
12493 if (version >= 132)
12494 {
12496 if (raib)
12497 {
12499 {
12501 return false;
12502 }
12503 }
12504 }
12505
12507 return true;
12508 }
12509
12510
12511
12513 {
12514 super.OnStoreSave(ctx);
12515
12516 PlayerBase player;
12517 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12518 {
12520
12521 int itemQBIndex = -1;
12522 itemQBIndex = player.FindQuickBarEntityIndex(this);
12523 ctx.
Write(itemQBIndex);
12524 }
12525 else
12526 {
12528 }
12529
12531
12533 if (raib)
12534 {
12536 }
12537 }
12538
12539
12541 {
12542 super.AfterStoreLoad();
12543
12545 {
12547 }
12548
12550 {
12553 }
12554 }
12555
12557 {
12558 super.EEOnAfterLoad();
12559
12561 {
12563 }
12564
12567 }
12568
12570 {
12571 return false;
12572 }
12573
12574
12575
12577 {
12579 {
12580 #ifdef PLATFORM_CONSOLE
12581
12583 {
12585 if (menu)
12586 {
12588 }
12589 }
12590 #endif
12591 }
12592
12594 {
12597 }
12598
12600 {
12601 SetWeightDirty();
12603 }
12605 {
12608 }
12609
12611 {
12614 }
12616 {
12619 }
12620
12621 super.OnVariablesSynchronized();
12622 }
12623
12624
12625
12627 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12628 {
12629 if (!IsServerCheck(allow_client))
12630 return false;
12631
12633 return false;
12634
12637
12638 if (value <= (min + 0.001))
12639 value = min;
12640
12641 if (value == min)
12642 {
12643 if (destroy_config)
12644 {
12645 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12646 if (dstr)
12647 {
12649 this.Delete();
12650 return true;
12651 }
12652 }
12653 else if (destroy_forced)
12654 {
12656 this.Delete();
12657 return true;
12658 }
12659
12661 }
12662
12665
12667 {
12669
12670 if (delta)
12672 }
12673
12675
12676 return false;
12677 }
12678
12679
12681 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12682 {
12684 }
12685
12687 {
12690 }
12691
12693 {
12696 }
12697
12700 {
12701 float value_clamped = Math.Clamp(value, 0, 1);
12703 SetQuantity(result, destroy_config, destroy_forced);
12704 }
12705
12706
12709 {
12711 }
12712
12714 {
12716 }
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12728 {
12729 int slot = -1;
12730 if (GetInventory())
12731 {
12732 InventoryLocation il = new InventoryLocation;
12733 GetInventory().GetCurrentInventoryLocation(il);
12735 }
12736
12738 }
12739
12741 {
12742 float quantity_max = 0;
12743
12745 {
12746 if (attSlotID != -1)
12747 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12748
12749 if (quantity_max <= 0)
12751 }
12752
12753 if (quantity_max <= 0)
12755
12756 return quantity_max;
12757 }
12758
12760 {
12762 }
12763
12765 {
12767 }
12768
12769
12771 {
12773 }
12774
12776 {
12778 }
12779
12781 {
12783 }
12784
12785
12787 {
12788
12789 float weightEx = GetWeightEx();
12790 float special = GetInventoryAndCargoWeight();
12791 return weightEx - special;
12792 }
12793
12794
12796 {
12798 }
12799
12801 {
12803 {
12804 #ifdef DEVELOPER
12805 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12806 {
12807 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12809 }
12810 #endif
12811
12812 return GetQuantity() * GetConfigWeightModified();
12813 }
12814 else if (HasEnergyManager())
12815 {
12816 #ifdef DEVELOPER
12817 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12818 {
12819 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12820 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12821 }
12822 #endif
12823 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12824 }
12825 else
12826 {
12827 #ifdef DEVELOPER
12828 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12829 {
12830 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12831 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12832 }
12833 #endif
12834 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12835 }
12836 }
12837
12840 {
12841 int item_count = 0;
12843
12844 if (GetInventory().GetCargo() != NULL)
12845 {
12846 item_count = GetInventory().GetCargo().GetItemCount();
12847 }
12848
12849 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12850 {
12851 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12852 if (item)
12853 item_count += item.GetNumberOfItems();
12854 }
12855 return item_count;
12856 }
12857
12860 {
12861 float weight = 0;
12862 float wetness = 1;
12863 if (include_wetness)
12866 {
12867 weight = wetness * m_ConfigWeight;
12868 }
12870 {
12871 weight = 1;
12872 }
12873 return weight;
12874 }
12875
12876
12877
12879 {
12880 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12881 {
12882 GameInventory inv = GetInventory();
12883 array<EntityAI> items = new array<EntityAI>;
12885 for (int i = 0; i < items.Count(); i++)
12886 {
12888 if (item)
12889 {
12891 }
12892 }
12893 }
12894 }
12895
12896
12897
12898
12900 {
12901 float energy = 0;
12902 if (HasEnergyManager())
12903 {
12904 energy = GetCompEM().GetEnergy();
12905 }
12906 return energy;
12907 }
12908
12909
12911 {
12912 super.OnEnergyConsumed();
12913
12915 }
12916
12918 {
12919 super.OnEnergyAdded();
12920
12922 }
12923
12924
12926 {
12927 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12928 {
12930 {
12931 float energy_0to1 = GetCompEM().GetEnergy0To1();
12933 }
12934 }
12935 }
12936
12937
12939 {
12940 return ConfigGetFloat("heatIsolation");
12941 }
12942
12944 {
12946 }
12947
12949 {
12950 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12951 if (
GetGame().ConfigIsExisting(paramPath))
12953
12954 return 0.0;
12955 }
12956
12958 {
12959 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12960 if (
GetGame().ConfigIsExisting(paramPath))
12962
12963 return 0.0;
12964 }
12965
12966 override void SetWet(
float value,
bool allow_client =
false)
12967 {
12968 if (!IsServerCheck(allow_client))
12969 return;
12970
12973
12975
12976 m_VarWet = Math.Clamp(value, min, max);
12977
12979 {
12982 }
12983 }
12984
12985 override void AddWet(
float value)
12986 {
12988 }
12989
12991 {
12993 }
12994
12996 {
12998 }
12999
13001 {
13003 }
13004
13006 {
13008 }
13009
13011 {
13013 }
13014
13015 override void OnWetChanged(
float newVal,
float oldVal)
13016 {
13019 if (newLevel != oldLevel)
13020 {
13022 }
13023 }
13024
13026 {
13027 SetWeightDirty();
13028 }
13029
13031 {
13032 return GetWetLevelInternal(
m_VarWet);
13033 }
13034
13035
13036
13038 {
13040 }
13041
13043 {
13045 }
13046
13048 {
13050 }
13051
13053 {
13055 }
13056
13057
13058
13060 {
13061 if (ConfigIsExisting("itemModelLength"))
13062 {
13063 return ConfigGetFloat("itemModelLength");
13064 }
13065 return 0;
13066 }
13067
13069 {
13070 if (ConfigIsExisting("itemAttachOffset"))
13071 {
13072 return ConfigGetFloat("itemAttachOffset");
13073 }
13074 return 0;
13075 }
13076
13077 override void SetCleanness(
int value,
bool allow_client =
false)
13078 {
13079 if (!IsServerCheck(allow_client))
13080 return;
13081
13083
13085
13088 }
13089
13091 {
13093 }
13094
13096 {
13097 return true;
13098 }
13099
13100
13101
13102
13104 {
13106 }
13107
13109 {
13111 }
13112
13113
13114
13115
13116 override void SetColor(
int r,
int g,
int b,
int a)
13117 {
13123 }
13125 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13126 {
13131 }
13132
13134 {
13136 }
13137
13140 {
13141 int r,g,b,a;
13143 r = r/255;
13144 g = g/255;
13145 b = b/255;
13146 a = a/255;
13147 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13148 }
13149
13150
13151
13152 override void SetLiquidType(
int value,
bool allow_client =
false)
13153 {
13154 if (!IsServerCheck(allow_client))
13155 return;
13156
13161 }
13162
13164 {
13165 return ConfigGetInt("varLiquidTypeInit");
13166 }
13167
13169 {
13171 }
13172
13174 {
13176 SetFrozen(false);
13177 }
13178
13181 {
13182 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13183 }
13184
13185
13188 {
13189 PlayerBase nplayer;
13190 if (PlayerBase.CastTo(nplayer, player))
13191 {
13193
13194 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13195 }
13196 }
13197
13198
13201 {
13202 PlayerBase nplayer;
13203 if (PlayerBase.CastTo(nplayer,player))
13204 {
13205
13206 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13207
13208 }
13209
13210
13211 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13212
13213
13214 if (HasEnergyManager())
13215 {
13216 GetCompEM().UpdatePlugState();
13217 }
13218 }
13219
13220
13222 {
13223 super.OnPlacementStarted(player);
13224
13226 }
13227
13228 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13229 {
13231 {
13232 m_AdminLog.OnPlacementComplete(player,
this);
13233 }
13234
13235 super.OnPlacementComplete(player, position, orientation);
13236 }
13237
13238
13239
13240
13241
13243 {
13245 {
13246 return true;
13247 }
13248 else
13249 {
13250 return false;
13251 }
13252 }
13253
13254
13256 {
13258 {
13260 }
13261 }
13262
13263
13265 {
13267 }
13268
13270 {
13272 }
13273
13274 override void InsertAgent(
int agent,
float count = 1)
13275 {
13276 if (count < 1)
13277 return;
13278
13280 }
13281
13284 {
13286 }
13287
13288
13290 {
13292 }
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13336 {
13338 return false;
13339 return true;
13340 }
13341
13343 {
13344
13346 }
13347
13348
13351 {
13352 super.CheckForRoofLimited(timeTresholdMS);
13353
13355 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13356 {
13357 m_PreviousRoofTestTime = time;
13358 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13359 }
13360 }
13361
13362
13364 {
13366 {
13367 return 0;
13368 }
13369
13370 if (GetInventory().GetAttachmentSlotsCount() != 0)
13371 {
13372 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13373 if (filter)
13374 return filter.GetProtectionLevel(type, false, system);
13375 else
13376 return 0;
13377 }
13378
13379 string subclassPath, entryName;
13380
13381 switch (type)
13382 {
13384 entryName = "biological";
13385 break;
13387 entryName = "chemical";
13388 break;
13389 default:
13390 entryName = "biological";
13391 break;
13392 }
13393
13394 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13395
13397 }
13398
13399
13400
13403 {
13404 if (!IsMagazine())
13406
13408 }
13409
13410
13411
13412
13413
13418 {
13419 return true;
13420 }
13421
13423 {
13425 }
13426
13427
13428
13429
13430
13432 {
13433 if (parent)
13434 {
13435 if (parent.IsInherited(DayZInfected))
13436 return true;
13437
13438 if (!parent.IsRuined())
13439 return true;
13440 }
13441
13442 return true;
13443 }
13444
13446 {
13447 if (!super.CanPutAsAttachment(parent))
13448 {
13449 return false;
13450 }
13451
13452 if (!IsRuined() && !parent.IsRuined())
13453 {
13454 return true;
13455 }
13456
13457 return false;
13458 }
13459
13461 {
13462
13463
13464
13465
13466 return super.CanReceiveItemIntoCargo(item);
13467 }
13468
13470 {
13471
13472
13473
13474
13475 GameInventory attachmentInv = attachment.GetInventory();
13477 {
13478 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13479 return false;
13480 }
13481
13482 InventoryLocation loc = new InventoryLocation();
13483 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13484 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13485 return false;
13486
13487 return super.CanReceiveAttachment(attachment, slotId);
13488 }
13489
13491 {
13492 if (!super.CanReleaseAttachment(attachment))
13493 return false;
13494
13495 return GetInventory().AreChildrenAccessible();
13496 }
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13519 {
13520 int id = muzzle_owner.GetMuzzleID();
13521 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13522
13523 if (WPOF_array)
13524 {
13525 for (int i = 0; i < WPOF_array.Count(); i++)
13526 {
13527 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13528
13529 if (WPOF)
13530 {
13531 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13532 }
13533 }
13534 }
13535 }
13536
13537
13539 {
13540 int id = muzzle_owner.GetMuzzleID();
13542
13543 if (WPOBE_array)
13544 {
13545 for (int i = 0; i < WPOBE_array.Count(); i++)
13546 {
13547 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13548
13549 if (WPOBE)
13550 {
13551 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13552 }
13553 }
13554 }
13555 }
13556
13557
13559 {
13560 int id = muzzle_owner.GetMuzzleID();
13561 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13562
13563 if (WPOOH_array)
13564 {
13565 for (int i = 0; i < WPOOH_array.Count(); i++)
13566 {
13567 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13568
13569 if (WPOOH)
13570 {
13571 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13572 }
13573 }
13574 }
13575 }
13576
13577
13579 {
13580 int id = muzzle_owner.GetMuzzleID();
13581 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13582
13583 if (WPOOH_array)
13584 {
13585 for (int i = 0; i < WPOOH_array.Count(); i++)
13586 {
13587 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13588
13589 if (WPOOH)
13590 {
13591 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13592 }
13593 }
13594 }
13595 }
13596
13597
13599 {
13600 int id = muzzle_owner.GetMuzzleID();
13601 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13602
13603 if (WPOOH_array)
13604 {
13605 for (int i = 0; i < WPOOH_array.Count(); i++)
13606 {
13607 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13608
13609 if (WPOOH)
13610 {
13611 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13612 }
13613 }
13614 }
13615 }
13616
13617
13618
13620 {
13622 {
13623 return true;
13624 }
13625
13626 return false;
13627 }
13628
13630 {
13632 {
13633 return true;
13634 }
13635
13636 return false;
13637 }
13638
13640 {
13642 {
13643 return true;
13644 }
13645
13646 return false;
13647 }
13648
13650 {
13651 return false;
13652 }
13653
13656 {
13657 return UATimeSpent.DEFAULT_DEPLOY;
13658 }
13659
13660
13661
13662
13664 {
13666 SetSynchDirty();
13667 }
13668
13670 {
13672 }
13673
13674
13676 {
13677 return false;
13678 }
13679
13682 {
13683 string att_type = "None";
13684
13685 if (ConfigIsExisting("soundAttType"))
13686 {
13687 att_type = ConfigGetString("soundAttType");
13688 }
13689
13691 }
13692
13694 {
13696 }
13697
13698
13699
13700
13701
13705
13707 {
13710
13712 }
13713
13714
13716 {
13718 return;
13719
13721
13724
13727
13728 SoundParameters params = new SoundParameters();
13732 }
13733
13734
13736 {
13738 return;
13739
13741 SetSynchDirty();
13742
13745 }
13746
13747
13749 {
13751 return;
13752
13754 SetSynchDirty();
13755
13758 }
13759
13761 {
13763 }
13764
13766 {
13768 }
13769
13772 {
13773 if (!
GetGame().IsDedicatedServer())
13774 {
13775 if (ConfigIsExisting("attachSoundSet"))
13776 {
13777 string cfg_path = "";
13778 string soundset = "";
13779 string type_name =
GetType();
13780
13783 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13784 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13785
13786 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13787 {
13788 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13789 {
13790 if (cfg_slot_array[i] == slot_type)
13791 {
13792 soundset = cfg_soundset_array[i];
13793 break;
13794 }
13795 }
13796 }
13797
13798 if (soundset != "")
13799 {
13800 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13802 }
13803 }
13804 }
13805 }
13806
13808 {
13809
13810 }
13811
13812 void OnApply(PlayerBase player);
13813
13815 {
13816 return 1.0;
13817 };
13818
13820 {
13822 }
13823
13825 {
13827 }
13828
13830
13832 {
13833 SetDynamicPhysicsLifeTime(0.01);
13835 }
13836
13838 {
13839 array<string> zone_names = new array<string>;
13840 GetDamageZones(zone_names);
13841 for (int i = 0; i < zone_names.Count(); i++)
13842 {
13843 SetHealthMax(zone_names.Get(i),"Health");
13844 }
13845 SetHealthMax("","Health");
13846 }
13847
13850 {
13851 float global_health = GetHealth01("","Health");
13852 array<string> zones = new array<string>;
13853 GetDamageZones(zones);
13854
13855 for (int i = 0; i < zones.Count(); i++)
13856 {
13857 SetHealth01(zones.Get(i),"Health",global_health);
13858 }
13859 }
13860
13863 {
13864 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13865 }
13866
13868 {
13869 if (!hasRootAsPlayer)
13870 {
13871 if (refParentIB)
13872 {
13873
13874 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13875 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13876
13877 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13878 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13879
13882 }
13883 else
13884 {
13885
13888 }
13889 }
13890 }
13891
13893 {
13895 {
13896 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13897 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13898 {
13899 float heatPermCoef = 1.0;
13901 while (ent)
13902 {
13903 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13904 ent = ent.GetHierarchyParent();
13905 }
13906
13907 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13908 }
13909 }
13910 }
13911
13913 {
13914
13915 EntityAI parent = GetHierarchyParent();
13916 if (!parent)
13917 {
13918 hasParent = false;
13919 hasRootAsPlayer = false;
13920 }
13921 else
13922 {
13923 hasParent = true;
13924 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13925 refParentIB =
ItemBase.Cast(parent);
13926 }
13927 }
13928
13929 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13930 {
13931
13932 }
13933
13935 {
13936
13937 return false;
13938 }
13939
13941 {
13942
13943
13944 return false;
13945 }
13946
13948 {
13949
13950 return false;
13951 }
13952
13955 {
13956 return !GetIsFrozen() &&
IsOpen();
13957 }
13958
13960 {
13961 bool hasParent = false, hasRootAsPlayer = false;
13963
13964 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13965 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13966
13967 if (wwtu || foodDecay)
13968 {
13972
13973 if (processWetness || processTemperature || processDecay)
13974 {
13976
13977 if (processWetness)
13978 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13979
13980 if (processTemperature)
13982
13983 if (processDecay)
13984 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13985 }
13986 }
13987 }
13988
13991 {
13993 }
13994
13996 {
13999
14000 return super.GetTemperatureFreezeThreshold();
14001 }
14002
14004 {
14007
14008 return super.GetTemperatureThawThreshold();
14009 }
14010
14012 {
14015
14016 return super.GetItemOverheatThreshold();
14017 }
14018
14020 {
14022 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14023
14024 return super.GetTemperatureFreezeTime();
14025 }
14026
14028 {
14030 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14031
14032 return super.GetTemperatureThawTime();
14033 }
14034
14039
14041 {
14042 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14043 }
14044
14046 {
14047 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14048 }
14049
14052 {
14054 }
14055
14057 {
14059 }
14060
14062 {
14064 }
14065
14068 {
14069 return null;
14070 }
14071
14074 {
14075 return false;
14076 }
14077
14079 {
14081 {
14084 if (!trg)
14085 {
14087 explosive = this;
14088 }
14089
14090 explosive.PairRemote(trg);
14092
14093 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14094 trg.SetPersistentPairID(persistentID);
14095 explosive.SetPersistentPairID(persistentID);
14096
14097 return true;
14098 }
14099 return false;
14100 }
14101
14104 {
14105 float ret = 1.0;
14108 ret *= GetHealth01();
14109
14110 return ret;
14111 }
14112
14113 #ifdef DEVELOPER
14114 override void SetDebugItem()
14115 {
14116 super.SetDebugItem();
14117 _itemBase = this;
14118 }
14119
14121 {
14122 string text = super.GetDebugText();
14123
14125 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14126
14127 return text;
14128 }
14129 #endif
14130
14132 {
14133 return true;
14134 }
14135
14137
14139
14141 {
14144 }
14145
14146
14154
14170}
14171
14173{
14175 if (entity)
14176 {
14177 bool is_item = entity.IsInherited(
ItemBase);
14178 if (is_item && full_quantity)
14179 {
14182 }
14183 }
14184 else
14185 {
14187 return NULL;
14188 }
14189 return entity;
14190}
14191
14193{
14194 if (item)
14195 {
14196 if (health > 0)
14197 item.SetHealth("", "", health);
14198
14199 if (item.CanHaveTemperature())
14200 {
14202 if (item.CanFreeze())
14203 item.SetFrozen(false);
14204 }
14205
14206 if (item.HasEnergyManager())
14207 {
14208 if (quantity >= 0)
14209 {
14210 item.GetCompEM().SetEnergy0To1(quantity);
14211 }
14212 else
14213 {
14215 }
14216 }
14217 else if (item.IsMagazine())
14218 {
14219 Magazine mag = Magazine.Cast(item);
14220 if (quantity >= 0)
14221 {
14222 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14223 }
14224 else
14225 {
14227 }
14228
14229 }
14230 else
14231 {
14232 if (quantity >= 0)
14233 {
14234 item.SetQuantityNormalized(quantity, false);
14235 }
14236 else
14237 {
14239 }
14240
14241 }
14242 }
14243}
14244
14245#ifdef DEVELOPER
14247#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.