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 {
10979
10981 return false;
10982
10983
10985 return false;
10986
10987
10988
10990 if (delta == 0)
10991 return false;
10992
10993
10994 return true;
10995 }
10996
10998 {
11000 {
11001 if (ScriptInputUserData.CanStoreInputUserData())
11002 {
11003 ScriptInputUserData ctx = new ScriptInputUserData;
11008 ctx.
Write(destination_entity);
11010 ctx.
Write(slot_id);
11012 }
11013 }
11014 else if (!
GetGame().IsMultiplayer())
11015 {
11017 }
11018 }
11019
11021 {
11022 float split_quantity_new;
11026 InventoryLocation loc = new InventoryLocation;
11027
11028 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11029 {
11031 split_quantity_new = stack_max;
11032 else
11034
11036 {
11037 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11038 if (new_item)
11039 {
11040 new_item.SetResultOfSplit(true);
11041 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11043 new_item.
SetQuantity(split_quantity_new,
false,
true);
11044 }
11045 }
11046 }
11047 else if (destination_entity && slot_id == -1)
11048 {
11049 if (quantity > stack_max)
11050 split_quantity_new = stack_max;
11051 else
11052 split_quantity_new = quantity;
11053
11055 {
11057 {
11060 }
11061
11062 if (new_item)
11063 {
11064 new_item.SetResultOfSplit(true);
11065 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11067 new_item.
SetQuantity(split_quantity_new,
false,
true);
11068 }
11069 }
11070 }
11071 else
11072 {
11073 if (stack_max != 0)
11074 {
11076 {
11078 }
11079
11080 if (split_quantity_new == 0)
11081 {
11082 if (!
GetGame().IsMultiplayer())
11083 player.PhysicalPredictiveDropItem(this);
11084 else
11085 player.ServerDropEntity(this);
11086 return;
11087 }
11088
11090 {
11092
11093 if (new_item)
11094 {
11095 new_item.SetResultOfSplit(true);
11096 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11099 new_item.PlaceOnSurface();
11100 }
11101 }
11102 }
11103 }
11104 }
11105
11107 {
11108 float split_quantity_new;
11112 InventoryLocation loc = new InventoryLocation;
11113
11114 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11115 {
11117 split_quantity_new = stack_max;
11118 else
11120
11122 {
11123 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11124 if (new_item)
11125 {
11126 new_item.SetResultOfSplit(true);
11127 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11129 new_item.
SetQuantity(split_quantity_new,
false,
true);
11130 }
11131 }
11132 }
11133 else if (destination_entity && slot_id == -1)
11134 {
11135 if (quantity > stack_max)
11136 split_quantity_new = stack_max;
11137 else
11138 split_quantity_new = quantity;
11139
11141 {
11143 {
11146 }
11147
11148 if (new_item)
11149 {
11150 new_item.SetResultOfSplit(true);
11151 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11153 new_item.
SetQuantity(split_quantity_new,
false,
true);
11154 }
11155 }
11156 }
11157 else
11158 {
11159 if (stack_max != 0)
11160 {
11162 {
11164 }
11165
11167 {
11169
11170 if (new_item)
11171 {
11172 new_item.SetResultOfSplit(true);
11173 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11176 new_item.PlaceOnSurface();
11177 }
11178 }
11179 }
11180 }
11181 }
11182
11184 {
11186 {
11187 if (ScriptInputUserData.CanStoreInputUserData())
11188 {
11189 ScriptInputUserData ctx = new ScriptInputUserData;
11194 dst.WriteToContext(ctx);
11196 }
11197 }
11198 else if (!
GetGame().IsMultiplayer())
11199 {
11201 }
11202 }
11203
11205 {
11207 {
11208 if (ScriptInputUserData.CanStoreInputUserData())
11209 {
11210 ScriptInputUserData ctx = new ScriptInputUserData;
11215 ctx.
Write(destination_entity);
11221 }
11222 }
11223 else if (!
GetGame().IsMultiplayer())
11224 {
11226 }
11227 }
11228
11230 {
11232 }
11233
11235 {
11237 float split_quantity_new;
11239 if (dst.IsValid())
11240 {
11241 int slot_id = dst.GetSlot();
11243
11244 if (quantity > stack_max)
11245 split_quantity_new = stack_max;
11246 else
11247 split_quantity_new = quantity;
11248
11250 {
11252
11253 if (new_item)
11254 {
11255 new_item.SetResultOfSplit(true);
11256 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11258 new_item.
SetQuantity(split_quantity_new,
false,
true);
11259 }
11260
11261 return new_item;
11262 }
11263 }
11264
11265 return null;
11266 }
11267
11269 {
11271 float split_quantity_new;
11273 if (destination_entity)
11274 {
11276 if (quantity > stackable)
11277 split_quantity_new = stackable;
11278 else
11279 split_quantity_new = quantity;
11280
11282 {
11283 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11284 if (new_item)
11285 {
11286 new_item.SetResultOfSplit(true);
11287 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11289 new_item.
SetQuantity(split_quantity_new,
false,
true);
11290 }
11291 }
11292 }
11293 }
11294
11296 {
11298 {
11299 if (ScriptInputUserData.CanStoreInputUserData())
11300 {
11301 ScriptInputUserData ctx = new ScriptInputUserData;
11306 ItemBase destination_entity =
this;
11307 ctx.
Write(destination_entity);
11311 }
11312 }
11313 else if (!
GetGame().IsMultiplayer())
11314 {
11316 }
11317 }
11318
11320 {
11322 float split_quantity_new;
11324 if (player)
11325 {
11327 if (quantity > stackable)
11328 split_quantity_new = stackable;
11329 else
11330 split_quantity_new = quantity;
11331
11333 {
11334 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11335 new_item =
ItemBase.Cast(in_hands);
11336 if (new_item)
11337 {
11338 new_item.SetResultOfSplit(true);
11339 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11341 new_item.SetQuantity(split_quantity_new, false, true);
11342 }
11343 }
11344 }
11345 }
11346
11348 {
11350 float split_quantity_new = Math.Floor(quantity * 0.5);
11351
11353 return;
11354
11356
11357 if (new_item)
11358 {
11359 if (new_item.GetQuantityMax() < split_quantity_new)
11360 {
11361 split_quantity_new = new_item.GetQuantityMax();
11362 }
11363
11364 new_item.SetResultOfSplit(true);
11365 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11366
11368 {
11371 }
11372 else
11373 {
11375 new_item.
SetQuantity(split_quantity_new,
false,
true);
11376 }
11377 }
11378 }
11379
11381 {
11383 float split_quantity_new = Math.Floor(quantity / 2);
11384
11386 return;
11387
11388 InventoryLocation invloc = new InventoryLocation;
11390
11392 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11393
11394 if (new_item)
11395 {
11396 if (new_item.GetQuantityMax() < split_quantity_new)
11397 {
11398 split_quantity_new = new_item.GetQuantityMax();
11399 }
11401 {
11404 }
11405 else if (split_quantity_new > 1)
11406 {
11408 new_item.
SetQuantity(split_quantity_new,
false,
true);
11409 }
11410 }
11411 }
11412
11415 {
11416 SetWeightDirty();
11418
11419 if (parent)
11420 parent.OnAttachmentQuantityChangedEx(this, delta);
11421
11423 {
11425 {
11427 }
11429 {
11430 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11432 }
11433 }
11434
11435 }
11436
11439 {
11440
11441 }
11442
11445 {
11447 }
11448
11450 {
11451 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11452
11454 {
11455 if (newLevel == GameConstants.STATE_RUINED)
11456 {
11458 EntityAI parent = GetHierarchyParent();
11459 if (parent && parent.IsFireplace())
11460 {
11461 CargoBase cargo = GetInventory().GetCargo();
11462 if (cargo)
11463 {
11465 {
11467 }
11468 }
11469 }
11470 }
11471
11473 {
11474
11476 return;
11477 }
11478
11479 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11480 {
11482 }
11483 }
11484 }
11485
11486
11488 {
11489 super.OnRightClick();
11490
11492 {
11494 {
11495 if (ScriptInputUserData.CanStoreInputUserData())
11496 {
11497 EntityAI root = GetHierarchyRoot();
11498 Man playerOwner = GetHierarchyRootPlayer();
11499 InventoryLocation dst = new InventoryLocation;
11500
11501
11502 if (!playerOwner && root && root == this)
11503 {
11505 }
11506 else
11507 {
11508
11509 GetInventory().GetCurrentInventoryLocation(dst);
11511 {
11514 {
11516 }
11517 else
11518 {
11520
11521
11522 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11523 {
11525 }
11526 else
11527 {
11528 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11529 }
11530 }
11531 }
11532 }
11533
11534 ScriptInputUserData ctx = new ScriptInputUserData;
11542 }
11543 }
11544 else if (!
GetGame().IsMultiplayer())
11545 {
11547 }
11548 }
11549 }
11550
11552 {
11553 if (root)
11554 {
11555 vector m4[4];
11556 root.GetTransform(m4);
11557 dst.SetGround(this, m4);
11558 }
11559 else
11560 {
11561 GetInventory().GetCurrentInventoryLocation(dst);
11562 }
11563 }
11564
11565 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11566 {
11567
11568 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11569 return false;
11570
11571 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11572 return false;
11573
11574
11576 return false;
11577
11578
11579 Magazine mag = Magazine.Cast(this);
11580 if (mag)
11581 {
11582 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11583 return false;
11584
11585 if (stack_max_limit)
11586 {
11587 Magazine other_mag = Magazine.Cast(other_item);
11588 if (other_item)
11589 {
11590 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11591 return false;
11592 }
11593
11594 }
11595 }
11596 else
11597 {
11598
11600 return false;
11601
11603 return false;
11604 }
11605
11606 PlayerBase player = null;
11607 if (CastTo(player, GetHierarchyRootPlayer()))
11608 {
11609 if (player.GetInventory().HasAttachment(this))
11610 return false;
11611
11612 if (player.IsItemsToDelete())
11613 return false;
11614 }
11615
11616 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11617 return false;
11618
11619 int slotID;
11621 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11622 return false;
11623
11624 return true;
11625 }
11626
11628 {
11630 }
11631
11633 {
11634 return m_IsResultOfSplit;
11635 }
11636
11638 {
11639 m_IsResultOfSplit = value;
11640 }
11641
11643 {
11645 }
11646
11648 {
11649 float other_item_quantity = other_item.GetQuantity();
11650 float this_free_space;
11651
11653
11655
11656 if (other_item_quantity > this_free_space)
11657 {
11658 return this_free_space;
11659 }
11660 else
11661 {
11662 return other_item_quantity;
11663 }
11664 }
11665
11667 {
11669 }
11670
11672 {
11674 return;
11675
11676 if (!IsMagazine() && other_item)
11677 {
11679 if (quantity_used != 0)
11680 {
11681 float hp1 = GetHealth01("","");
11682 float hp2 = other_item.GetHealth01("","");
11683 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11684 hpResult = hpResult / (
GetQuantity() + quantity_used);
11685
11686 hpResult *= GetMaxHealth();
11687 Math.Round(hpResult);
11688 SetHealth("", "Health", hpResult);
11689
11691 other_item.AddQuantity(-quantity_used);
11692 }
11693 }
11695 }
11696
11698 {
11699 #ifdef SERVER
11700 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11701 GetHierarchyParent().IncreaseLifetimeUp();
11702 #endif
11703 };
11704
11706 {
11707 PlayerBase p = PlayerBase.Cast(player);
11708
11709 array<int> recipesIds = p.m_Recipes;
11710 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11711 if (moduleRecipesManager)
11712 {
11713 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11714 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11715 }
11716
11717 for (int i = 0;i < recipesIds.Count(); i++)
11718 {
11719 int key = recipesIds.Get(i);
11720 string recipeName = moduleRecipesManager.GetRecipeName(key);
11722 }
11723 }
11724
11725
11726 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11727 {
11728 super.GetDebugActions(outputList);
11729
11730
11736
11737
11742
11747
11748
11752
11753
11755 {
11759 }
11760
11763
11764
11768
11770
11771 InventoryLocation loc = new InventoryLocation();
11772 GetInventory().GetCurrentInventoryLocation(loc);
11774 {
11775 if (Gizmo_IsSupported())
11778 }
11779
11781 }
11782
11783
11784
11785
11787 {
11788 super.OnAction(action_id, player, ctx);
11789
11791 {
11792 switch (action_id)
11793 {
11796 return true;
11799 return true;
11800 }
11801 }
11802
11804 {
11805 switch (action_id)
11806 {
11808 Delete();
11809 return true;
11810 }
11811 }
11812
11813 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11814 {
11815 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11816 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11817 PlayerBase p = PlayerBase.Cast(player);
11818 if (
EActions.RECIPES_RANGE_START < 1000)
11819 {
11820 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11821 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11822 }
11823 }
11824 #ifndef SERVER
11825 else if (action_id ==
EActions.WATCH_PLAYER)
11826 {
11827 PluginDeveloper.SetDeveloperItemClientEx(player);
11828 }
11829 #endif
11831 {
11832 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11833 {
11834 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11835 OnDebugButtonPressServer(id + 1);
11836 }
11837
11838 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11839 {
11840 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11842 }
11843
11844 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11845 {
11846 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11848 }
11849
11850 else if (action_id ==
EActions.ADD_QUANTITY)
11851 {
11852 if (IsMagazine())
11853 {
11854 Magazine mag = Magazine.Cast(this);
11855 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11856 }
11857 else
11858 {
11860 }
11861
11862 if (m_EM)
11863 {
11864 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11865 }
11866
11867 }
11868
11869 else if (action_id ==
EActions.REMOVE_QUANTITY)
11870 {
11871 if (IsMagazine())
11872 {
11873 Magazine mag2 = Magazine.Cast(this);
11874 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11875 }
11876 else
11877 {
11879 }
11880 if (m_EM)
11881 {
11882 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11883 }
11884
11885 }
11886
11887 else if (action_id ==
EActions.SET_QUANTITY_0)
11888 {
11890
11891 if (m_EM)
11892 {
11893 m_EM.SetEnergy(0);
11894 }
11895 }
11896
11897 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11898 {
11900
11901 if (m_EM)
11902 {
11903 m_EM.SetEnergy(m_EM.GetEnergyMax());
11904 }
11905 }
11906
11907 else if (action_id ==
EActions.ADD_HEALTH)
11908 {
11909 AddHealth("","",GetMaxHealth("","Health")/5);
11910 }
11911 else if (action_id ==
EActions.REMOVE_HEALTH)
11912 {
11913 AddHealth("","",-GetMaxHealth("","Health")/5);
11914 }
11915 else if (action_id ==
EActions.DESTROY_HEALTH)
11916 {
11917 SetHealth01("","",0);
11918 }
11919 else if (action_id ==
EActions.WATCH_ITEM)
11920 {
11922 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11923 #ifdef DEVELOPER
11924 SetDebugDeveloper_item(this);
11925 #endif
11926 }
11927
11928 else if (action_id ==
EActions.ADD_TEMPERATURE)
11929 {
11930 AddTemperature(20);
11931
11932 }
11933
11934 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11935 {
11936 AddTemperature(-20);
11937
11938 }
11939
11940 else if (action_id ==
EActions.FLIP_FROZEN)
11941 {
11942 SetFrozen(!GetIsFrozen());
11943
11944 }
11945
11946 else if (action_id ==
EActions.ADD_WETNESS)
11947 {
11949
11950 }
11951
11952 else if (action_id ==
EActions.REMOVE_WETNESS)
11953 {
11955
11956 }
11957
11958 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11959 {
11962
11963
11964 }
11965
11966 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11967 {
11970 }
11971
11972 else if (action_id ==
EActions.MAKE_SPECIAL)
11973 {
11974 auto debugParams = DebugSpawnParams.WithPlayer(player);
11975 OnDebugSpawnEx(debugParams);
11976 }
11977
11978 }
11979
11980
11981 return false;
11982 }
11983
11984
11985
11986
11990
11993
11994
11995
11997 {
11998 return false;
11999 }
12000
12001
12003 {
12004 return true;
12005 }
12006
12007
12009 {
12010 return true;
12011 }
12012
12013
12014
12016 {
12017 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12019 }
12020
12023 {
12024 return null;
12025 }
12026
12028 {
12029 return false;
12030 }
12031
12033 {
12034 return false;
12035 }
12036
12040
12041
12043 {
12044 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12045 return module_repairing.CanRepair(this, item_repair_kit);
12046 }
12047
12048
12049 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12050 {
12051 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12052 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12053 }
12054
12055
12057 {
12058
12059
12060
12061
12062
12063
12064
12065
12066 return 1;
12067 }
12068
12069
12070
12072 {
12074 }
12075
12076
12077
12079 {
12081 }
12082
12083
12092 {
12093 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12094
12095 if (player)
12096 {
12097 player.MessageStatus(text);
12098 }
12099 }
12100
12101
12110 {
12111 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12112
12113 if (player)
12114 {
12115 player.MessageAction(text);
12116 }
12117 }
12118
12119
12128 {
12129 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12130
12131 if (player)
12132 {
12133 player.MessageFriendly(text);
12134 }
12135 }
12136
12137
12146 {
12147 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12148
12149 if (player)
12150 {
12151 player.MessageImportant(text);
12152 }
12153 }
12154
12156 {
12157 return true;
12158 }
12159
12160
12161 override bool KindOf(
string tag)
12162 {
12163 bool found = false;
12164 string item_name = this.
GetType();
12167
12168 int array_size = item_tag_array.Count();
12169 for (int i = 0; i < array_size; i++)
12170 {
12171 if (item_tag_array.Get(i) == tag)
12172 {
12173 found = true;
12174 break;
12175 }
12176 }
12177 return found;
12178 }
12179
12180
12182 {
12183
12184 super.OnRPC(sender, rpc_type,ctx);
12185
12186
12187 switch (rpc_type)
12188 {
12189 #ifndef SERVER
12190 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12191 Param2<bool, string> p = new Param2<bool, string>(false, "");
12192
12194 return;
12195
12196 bool play = p.param1;
12197 string soundSet = p.param2;
12198
12199 if (play)
12200 {
12202 {
12204 {
12206 }
12207 }
12208 else
12209 {
12211 }
12212 }
12213 else
12214 {
12216 }
12217
12218 break;
12219 #endif
12220
12221 }
12222
12224 {
12226 }
12227 }
12228
12229
12230
12231
12233 {
12234 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12235 return plugin.GetID(
name);
12236 }
12237
12239 {
12240 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12241 return plugin.GetName(id);
12242 }
12243
12246 {
12247
12248
12249 int varFlags;
12250 if (!ctx.
Read(varFlags))
12251 return;
12252
12253 if (varFlags & ItemVariableFlags.FLOAT)
12254 {
12256 }
12257 }
12258
12260 {
12261
12262 super.SerializeNumericalVars(floats_out);
12263
12264
12265
12267 {
12269 }
12270
12272 {
12274 }
12275
12277 {
12279 }
12280
12282 {
12287 }
12288
12290 {
12292 }
12293 }
12294
12296 {
12297
12298 super.DeSerializeNumericalVars(floats);
12299
12300
12301 int index = 0;
12302 int mask = Math.Round(floats.Get(index));
12303
12304 index++;
12305
12307 {
12309 {
12311 }
12312 else
12313 {
12314 float quantity = floats.Get(index);
12315 SetQuantity(quantity,
true,
false,
false,
false);
12316 }
12317 index++;
12318 }
12319
12321 {
12322 float wet = floats.Get(index);
12324 index++;
12325 }
12326
12328 {
12329 int liquidtype = Math.Round(floats.Get(index));
12331 index++;
12332 }
12333
12335 {
12337 index++;
12339 index++;
12341 index++;
12343 index++;
12344 }
12345
12347 {
12348 int cleanness = Math.Round(floats.Get(index));
12350 index++;
12351 }
12352 }
12353
12355 {
12356 super.WriteVarsToCTX(ctx);
12357
12358
12360 {
12362 }
12363
12365 {
12367 }
12368
12370 {
12372 }
12373
12375 {
12376 int r,g,b,a;
12382 }
12383
12385 {
12387 }
12388 }
12389
12391 {
12392 if (!super.ReadVarsFromCTX(ctx,version))
12393 return false;
12394
12395 int intValue;
12396 float value;
12397
12398 if (version < 140)
12399 {
12400 if (!ctx.
Read(intValue))
12401 return false;
12402
12403 m_VariablesMask = intValue;
12404 }
12405
12407 {
12408 if (!ctx.
Read(value))
12409 return false;
12410
12412 {
12414 }
12415 else
12416 {
12418 }
12419 }
12420
12421 if (version < 140)
12422 {
12424 {
12425 if (!ctx.
Read(value))
12426 return false;
12427 SetTemperatureDirect(value);
12428 }
12429 }
12430
12432 {
12433 if (!ctx.
Read(value))
12434 return false;
12436 }
12437
12439 {
12440 if (!ctx.
Read(intValue))
12441 return false;
12443 }
12444
12446 {
12447 int r,g,b,a;
12449 return false;
12451 return false;
12453 return false;
12455 return false;
12456
12458 }
12459
12461 {
12462 if (!ctx.
Read(intValue))
12463 return false;
12465 }
12466
12467 if (version >= 138 && version < 140)
12468 {
12470 {
12471 if (!ctx.
Read(intValue))
12472 return false;
12473 SetFrozen(intValue);
12474 }
12475 }
12476
12477 return true;
12478 }
12479
12480
12482 {
12485 {
12487 }
12488
12489 if (!super.OnStoreLoad(ctx, version))
12490 {
12492 return false;
12493 }
12494
12495 if (version >= 114)
12496 {
12497 bool hasQuickBarIndexSaved;
12498
12499 if (!ctx.
Read(hasQuickBarIndexSaved))
12500 {
12502 return false;
12503 }
12504
12505 if (hasQuickBarIndexSaved)
12506 {
12507 int itmQBIndex;
12508
12509
12510 if (!ctx.
Read(itmQBIndex))
12511 {
12513 return false;
12514 }
12515
12516 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12517 if (itmQBIndex != -1 && parentPlayer)
12518 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12519 }
12520 }
12521 else
12522 {
12523
12524 PlayerBase player;
12525 int itemQBIndex;
12526 if (version ==
int.
MAX)
12527 {
12528 if (!ctx.
Read(itemQBIndex))
12529 {
12531 return false;
12532 }
12533 }
12534 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12535 {
12536
12537 if (!ctx.
Read(itemQBIndex))
12538 {
12540 return false;
12541 }
12542 if (itemQBIndex != -1 && player)
12543 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12544 }
12545 }
12546
12547 if (version < 140)
12548 {
12549
12550 if (!LoadVariables(ctx, version))
12551 {
12553 return false;
12554 }
12555 }
12556
12557
12559 {
12561 return false;
12562 }
12563 if (version >= 132)
12564 {
12566 if (raib)
12567 {
12569 {
12571 return false;
12572 }
12573 }
12574 }
12575
12577 return true;
12578 }
12579
12580
12581
12583 {
12584 super.OnStoreSave(ctx);
12585
12586 PlayerBase player;
12587 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12588 {
12590
12591 int itemQBIndex = -1;
12592 itemQBIndex = player.FindQuickBarEntityIndex(this);
12593 ctx.
Write(itemQBIndex);
12594 }
12595 else
12596 {
12598 }
12599
12601
12603 if (raib)
12604 {
12606 }
12607 }
12608
12609
12611 {
12612 super.AfterStoreLoad();
12613
12615 {
12617 }
12618
12620 {
12623 }
12624 }
12625
12627 {
12628 super.EEOnAfterLoad();
12629
12631 {
12633 }
12634
12637 }
12638
12640 {
12641 return false;
12642 }
12643
12644
12645
12647 {
12649 {
12650 #ifdef PLATFORM_CONSOLE
12651
12653 {
12655 if (menu)
12656 {
12658 }
12659 }
12660 #endif
12661 }
12662
12664 {
12667 }
12668
12670 {
12671 SetWeightDirty();
12673 }
12675 {
12678 }
12679
12681 {
12684 }
12686 {
12689 }
12690
12691 super.OnVariablesSynchronized();
12692 }
12693
12694
12695
12697 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12698 {
12699 if (!IsServerCheck(allow_client))
12700 return false;
12701
12703 return false;
12704
12707
12708 if (value <= (min + 0.001))
12709 value = min;
12710
12711 if (value == min)
12712 {
12713 if (destroy_config)
12714 {
12715 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12716 if (dstr)
12717 {
12719 this.Delete();
12720 return true;
12721 }
12722 }
12723 else if (destroy_forced)
12724 {
12726 this.Delete();
12727 return true;
12728 }
12729
12731 }
12732
12735
12737 {
12739
12740 if (delta)
12742 }
12743
12745
12746 return false;
12747 }
12748
12749
12751 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12752 {
12754 }
12755
12757 {
12760 }
12761
12763 {
12766 }
12767
12769 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12770 {
12771 float value_clamped = Math.Clamp(value, 0, 1);
12773 SetQuantity(result, destroy_config, destroy_forced);
12774 }
12775
12776
12779 {
12781 }
12782
12784 {
12786 }
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12798 {
12799 int slot = -1;
12800 if (GetInventory())
12801 {
12802 InventoryLocation il = new InventoryLocation;
12803 GetInventory().GetCurrentInventoryLocation(il);
12805 }
12806
12808 }
12809
12811 {
12812 float quantity_max = 0;
12813
12815 {
12816 if (attSlotID != -1)
12817 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12818
12819 if (quantity_max <= 0)
12821 }
12822
12823 if (quantity_max <= 0)
12825
12826 return quantity_max;
12827 }
12828
12830 {
12832 }
12833
12835 {
12837 }
12838
12839
12841 {
12843 }
12844
12846 {
12848 }
12849
12851 {
12853 }
12854
12855
12857 {
12858
12859 float weightEx = GetWeightEx();
12860 float special = GetInventoryAndCargoWeight();
12861 return weightEx - special;
12862 }
12863
12864
12866 {
12868 }
12869
12871 {
12873 {
12874 #ifdef DEVELOPER
12875 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12876 {
12877 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12879 }
12880 #endif
12881
12882 return GetQuantity() * GetConfigWeightModified();
12883 }
12884 else if (HasEnergyManager())
12885 {
12886 #ifdef DEVELOPER
12887 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12888 {
12889 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12890 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12891 }
12892 #endif
12893 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12894 }
12895 else
12896 {
12897 #ifdef DEVELOPER
12898 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12899 {
12900 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12901 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12902 }
12903 #endif
12904 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12905 }
12906 }
12907
12910 {
12911 int item_count = 0;
12913
12914 if (GetInventory().GetCargo() != NULL)
12915 {
12916 item_count = GetInventory().GetCargo().GetItemCount();
12917 }
12918
12919 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12920 {
12921 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12922 if (item)
12923 item_count += item.GetNumberOfItems();
12924 }
12925 return item_count;
12926 }
12927
12930 {
12931 float weight = 0;
12932 float wetness = 1;
12933 if (include_wetness)
12936 {
12937 weight = wetness * m_ConfigWeight;
12938 }
12940 {
12941 weight = 1;
12942 }
12943 return weight;
12944 }
12945
12946
12947
12949 {
12950 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12951 {
12952 GameInventory inv = GetInventory();
12953 array<EntityAI> items = new array<EntityAI>;
12955 for (int i = 0; i < items.Count(); i++)
12956 {
12958 if (item)
12959 {
12961 }
12962 }
12963 }
12964 }
12965
12966
12967
12968
12970 {
12971 float energy = 0;
12972 if (HasEnergyManager())
12973 {
12974 energy = GetCompEM().GetEnergy();
12975 }
12976 return energy;
12977 }
12978
12979
12981 {
12982 super.OnEnergyConsumed();
12983
12985 }
12986
12988 {
12989 super.OnEnergyAdded();
12990
12992 }
12993
12994
12996 {
12997 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12998 {
13000 {
13001 float energy_0to1 = GetCompEM().GetEnergy0To1();
13003 }
13004 }
13005 }
13006
13007
13009 {
13010 return ConfigGetFloat("heatIsolation");
13011 }
13012
13014 {
13016 }
13017
13019 {
13020 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13021 if (
GetGame().ConfigIsExisting(paramPath))
13023
13024 return 0.0;
13025 }
13026
13028 {
13029 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13030 if (
GetGame().ConfigIsExisting(paramPath))
13032
13033 return 0.0;
13034 }
13035
13036 override void SetWet(
float value,
bool allow_client =
false)
13037 {
13038 if (!IsServerCheck(allow_client))
13039 return;
13040
13043
13045
13046 m_VarWet = Math.Clamp(value, min, max);
13047
13049 {
13052 }
13053 }
13054
13055 override void AddWet(
float value)
13056 {
13058 }
13059
13061 {
13063 }
13064
13066 {
13068 }
13069
13071 {
13073 }
13074
13076 {
13078 }
13079
13081 {
13083 }
13084
13085 override void OnWetChanged(
float newVal,
float oldVal)
13086 {
13089 if (newLevel != oldLevel)
13090 {
13092 }
13093 }
13094
13096 {
13097 SetWeightDirty();
13098 }
13099
13101 {
13102 return GetWetLevelInternal(
m_VarWet);
13103 }
13104
13105
13106
13108 {
13110 }
13111
13113 {
13115 }
13116
13118 {
13120 }
13121
13123 {
13125 }
13126
13127
13128
13130 {
13131 if (ConfigIsExisting("itemModelLength"))
13132 {
13133 return ConfigGetFloat("itemModelLength");
13134 }
13135 return 0;
13136 }
13137
13139 {
13140 if (ConfigIsExisting("itemAttachOffset"))
13141 {
13142 return ConfigGetFloat("itemAttachOffset");
13143 }
13144 return 0;
13145 }
13146
13147 override void SetCleanness(
int value,
bool allow_client =
false)
13148 {
13149 if (!IsServerCheck(allow_client))
13150 return;
13151
13153
13155
13158 }
13159
13161 {
13163 }
13164
13166 {
13167 return true;
13168 }
13169
13170
13171
13172
13174 {
13176 }
13177
13179 {
13181 }
13182
13183
13184
13185
13186 override void SetColor(
int r,
int g,
int b,
int a)
13187 {
13193 }
13195 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13196 {
13201 }
13202
13204 {
13206 }
13207
13210 {
13211 int r,g,b,a;
13213 r = r/255;
13214 g = g/255;
13215 b = b/255;
13216 a = a/255;
13217 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13218 }
13219
13220
13221
13222 override void SetLiquidType(
int value,
bool allow_client =
false)
13223 {
13224 if (!IsServerCheck(allow_client))
13225 return;
13226
13231 }
13232
13234 {
13235 return ConfigGetInt("varLiquidTypeInit");
13236 }
13237
13239 {
13241 }
13242
13244 {
13246 SetFrozen(false);
13247 }
13248
13251 {
13252 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13253 }
13254
13255
13258 {
13259 PlayerBase nplayer;
13260 if (PlayerBase.CastTo(nplayer, player))
13261 {
13263
13264 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13265 }
13266 }
13267
13268
13271 {
13272 PlayerBase nplayer;
13273 if (PlayerBase.CastTo(nplayer,player))
13274 {
13275
13276 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13277
13278 }
13279
13280
13281 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13282
13283
13284 if (HasEnergyManager())
13285 {
13286 GetCompEM().UpdatePlugState();
13287 }
13288 }
13289
13290
13292 {
13293 super.OnPlacementStarted(player);
13294
13296 }
13297
13298 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13299 {
13301 {
13302 m_AdminLog.OnPlacementComplete(player,
this);
13303 }
13304
13305 super.OnPlacementComplete(player, position, orientation);
13306 }
13307
13308
13309
13310
13311
13313 {
13315 {
13316 return true;
13317 }
13318 else
13319 {
13320 return false;
13321 }
13322 }
13323
13324
13326 {
13328 {
13330 }
13331 }
13332
13333
13335 {
13337 }
13338
13340 {
13342 }
13343
13344 override void InsertAgent(
int agent,
float count = 1)
13345 {
13346 if (count < 1)
13347 return;
13348
13350 }
13351
13354 {
13356 }
13357
13358
13360 {
13362 }
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13406 {
13408 return false;
13409 return true;
13410 }
13411
13413 {
13414
13416 }
13417
13418
13421 {
13422 super.CheckForRoofLimited(timeTresholdMS);
13423
13425 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13426 {
13427 m_PreviousRoofTestTime = time;
13428 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13429 }
13430 }
13431
13432
13434 {
13436 {
13437 return 0;
13438 }
13439
13440 if (GetInventory().GetAttachmentSlotsCount() != 0)
13441 {
13442 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13443 if (filter)
13444 return filter.GetProtectionLevel(type, false, system);
13445 else
13446 return 0;
13447 }
13448
13449 string subclassPath, entryName;
13450
13451 switch (type)
13452 {
13454 entryName = "biological";
13455 break;
13457 entryName = "chemical";
13458 break;
13459 default:
13460 entryName = "biological";
13461 break;
13462 }
13463
13464 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13465
13467 }
13468
13469
13470
13473 {
13474 if (!IsMagazine())
13476
13478 }
13479
13480
13481
13482
13483
13488 {
13489 return true;
13490 }
13491
13493 {
13495 }
13496
13497
13498
13499
13500
13502 {
13503 if (parent)
13504 {
13505 if (parent.IsInherited(DayZInfected))
13506 return true;
13507
13508 if (!parent.IsRuined())
13509 return true;
13510 }
13511
13512 return true;
13513 }
13514
13516 {
13517 if (!super.CanPutAsAttachment(parent))
13518 {
13519 return false;
13520 }
13521
13522 if (!IsRuined() && !parent.IsRuined())
13523 {
13524 return true;
13525 }
13526
13527 return false;
13528 }
13529
13531 {
13532
13533
13534
13535
13536 return super.CanReceiveItemIntoCargo(item);
13537 }
13538
13540 {
13541
13542
13543
13544
13545 GameInventory attachmentInv = attachment.GetInventory();
13547 {
13548 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13549 return false;
13550 }
13551
13552 InventoryLocation loc = new InventoryLocation();
13553 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13554 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13555 return false;
13556
13557 return super.CanReceiveAttachment(attachment, slotId);
13558 }
13559
13561 {
13562 if (!super.CanReleaseAttachment(attachment))
13563 return false;
13564
13565 return GetInventory().AreChildrenAccessible();
13566 }
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13589 {
13590 int id = muzzle_owner.GetMuzzleID();
13591 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13592
13593 if (WPOF_array)
13594 {
13595 for (int i = 0; i < WPOF_array.Count(); i++)
13596 {
13597 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13598
13599 if (WPOF)
13600 {
13601 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13602 }
13603 }
13604 }
13605 }
13606
13607
13609 {
13610 int id = muzzle_owner.GetMuzzleID();
13612
13613 if (WPOBE_array)
13614 {
13615 for (int i = 0; i < WPOBE_array.Count(); i++)
13616 {
13617 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13618
13619 if (WPOBE)
13620 {
13621 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13622 }
13623 }
13624 }
13625 }
13626
13627
13629 {
13630 int id = muzzle_owner.GetMuzzleID();
13631 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13632
13633 if (WPOOH_array)
13634 {
13635 for (int i = 0; i < WPOOH_array.Count(); i++)
13636 {
13637 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13638
13639 if (WPOOH)
13640 {
13641 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13642 }
13643 }
13644 }
13645 }
13646
13647
13649 {
13650 int id = muzzle_owner.GetMuzzleID();
13651 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13652
13653 if (WPOOH_array)
13654 {
13655 for (int i = 0; i < WPOOH_array.Count(); i++)
13656 {
13657 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13658
13659 if (WPOOH)
13660 {
13661 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13662 }
13663 }
13664 }
13665 }
13666
13667
13669 {
13670 int id = muzzle_owner.GetMuzzleID();
13671 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13672
13673 if (WPOOH_array)
13674 {
13675 for (int i = 0; i < WPOOH_array.Count(); i++)
13676 {
13677 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13678
13679 if (WPOOH)
13680 {
13681 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13682 }
13683 }
13684 }
13685 }
13686
13687
13688
13690 {
13692 {
13693 return true;
13694 }
13695
13696 return false;
13697 }
13698
13700 {
13702 {
13703 return true;
13704 }
13705
13706 return false;
13707 }
13708
13710 {
13712 {
13713 return true;
13714 }
13715
13716 return false;
13717 }
13718
13720 {
13721 return false;
13722 }
13723
13726 {
13727 return UATimeSpent.DEFAULT_DEPLOY;
13728 }
13729
13730
13731
13732
13734 {
13736 SetSynchDirty();
13737 }
13738
13740 {
13742 }
13743
13744
13746 {
13747 return false;
13748 }
13749
13752 {
13753 string att_type = "None";
13754
13755 if (ConfigIsExisting("soundAttType"))
13756 {
13757 att_type = ConfigGetString("soundAttType");
13758 }
13759
13761 }
13762
13764 {
13766 }
13767
13768
13769
13770
13771
13777
13779 {
13782
13784 }
13785
13786
13788 {
13790 return;
13791
13793
13796
13799
13800 SoundParameters params = new SoundParameters();
13804 }
13805
13806
13808 {
13810 return;
13811
13813 SetSynchDirty();
13814
13817 }
13818
13819
13821 {
13823 return;
13824
13826 SetSynchDirty();
13827
13830 }
13831
13833 {
13835 }
13836
13838 {
13840 }
13841
13844 {
13845 if (!
GetGame().IsDedicatedServer())
13846 {
13847 if (ConfigIsExisting("attachSoundSet"))
13848 {
13849 string cfg_path = "";
13850 string soundset = "";
13851 string type_name =
GetType();
13852
13855 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13856 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13857
13858 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13859 {
13860 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13861 {
13862 if (cfg_slot_array[i] == slot_type)
13863 {
13864 soundset = cfg_soundset_array[i];
13865 break;
13866 }
13867 }
13868 }
13869
13870 if (soundset != "")
13871 {
13872 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13874 }
13875 }
13876 }
13877 }
13878
13880 {
13881
13882 }
13883
13884 void OnApply(PlayerBase player);
13885
13887 {
13888 return 1.0;
13889 };
13890
13892 {
13894 }
13895
13897 {
13899 }
13900
13902
13904 {
13905 SetDynamicPhysicsLifeTime(0.01);
13907 }
13908
13910 {
13911 array<string> zone_names = new array<string>;
13912 GetDamageZones(zone_names);
13913 for (int i = 0; i < zone_names.Count(); i++)
13914 {
13915 SetHealthMax(zone_names.Get(i),"Health");
13916 }
13917 SetHealthMax("","Health");
13918 }
13919
13922 {
13923 float global_health = GetHealth01("","Health");
13924 array<string> zones = new array<string>;
13925 GetDamageZones(zones);
13926
13927 for (int i = 0; i < zones.Count(); i++)
13928 {
13929 SetHealth01(zones.Get(i),"Health",global_health);
13930 }
13931 }
13932
13935 {
13936 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13937 }
13938
13940 {
13941 if (!hasRootAsPlayer)
13942 {
13943 if (refParentIB)
13944 {
13945
13946 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13947 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13948
13949 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13950 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13951
13954 }
13955 else
13956 {
13957
13960 }
13961 }
13962 }
13963
13965 {
13967 {
13968 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13969 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13970 {
13971 float heatPermCoef = 1.0;
13973 while (ent)
13974 {
13975 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13976 ent = ent.GetHierarchyParent();
13977 }
13978
13979 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13980 }
13981 }
13982 }
13983
13985 {
13986
13987 EntityAI parent = GetHierarchyParent();
13988 if (!parent)
13989 {
13990 hasParent = false;
13991 hasRootAsPlayer = false;
13992 }
13993 else
13994 {
13995 hasParent = true;
13996 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13997 refParentIB =
ItemBase.Cast(parent);
13998 }
13999 }
14000
14001 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14002 {
14003
14004 }
14005
14007 {
14008
14009 return false;
14010 }
14011
14013 {
14014
14015
14016 return false;
14017 }
14018
14020 {
14021
14022 return false;
14023 }
14024
14027 {
14028 return !GetIsFrozen() &&
IsOpen();
14029 }
14030
14032 {
14033 bool hasParent = false, hasRootAsPlayer = false;
14035
14036 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14037 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14038
14039 if (wwtu || foodDecay)
14040 {
14044
14045 if (processWetness || processTemperature || processDecay)
14046 {
14048
14049 if (processWetness)
14050 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14051
14052 if (processTemperature)
14054
14055 if (processDecay)
14056 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14057 }
14058 }
14059 }
14060
14063 {
14065 }
14066
14068 {
14071
14072 return super.GetTemperatureFreezeThreshold();
14073 }
14074
14076 {
14079
14080 return super.GetTemperatureThawThreshold();
14081 }
14082
14084 {
14087
14088 return super.GetItemOverheatThreshold();
14089 }
14090
14092 {
14094 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14095
14096 return super.GetTemperatureFreezeTime();
14097 }
14098
14100 {
14102 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14103
14104 return super.GetTemperatureThawTime();
14105 }
14106
14111
14113 {
14114 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14115 }
14116
14118 {
14119 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14120 }
14121
14124 {
14126 }
14127
14129 {
14131 }
14132
14134 {
14136 }
14137
14140 {
14141 return null;
14142 }
14143
14146 {
14147 return false;
14148 }
14149
14151 {
14153 {
14156 if (!trg)
14157 {
14159 explosive = this;
14160 }
14161
14162 explosive.PairRemote(trg);
14164
14165 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14166 trg.SetPersistentPairID(persistentID);
14167 explosive.SetPersistentPairID(persistentID);
14168
14169 return true;
14170 }
14171 return false;
14172 }
14173
14176 {
14177 float ret = 1.0;
14180 ret *= GetHealth01();
14181
14182 return ret;
14183 }
14184
14185 #ifdef DEVELOPER
14186 override void SetDebugItem()
14187 {
14188 super.SetDebugItem();
14189 _itemBase = this;
14190 }
14191
14193 {
14194 string text = super.GetDebugText();
14195
14197 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14198
14199 return text;
14200 }
14201 #endif
14202
14204 {
14205 return true;
14206 }
14207
14209
14211
14213 {
14216 }
14217
14218
14226
14242}
14243
14245{
14247 if (entity)
14248 {
14249 bool is_item = entity.IsInherited(
ItemBase);
14250 if (is_item && full_quantity)
14251 {
14254 }
14255 }
14256 else
14257 {
14259 return NULL;
14260 }
14261 return entity;
14262}
14263
14265{
14266 if (item)
14267 {
14268 if (health > 0)
14269 item.SetHealth("", "", health);
14270
14271 if (item.CanHaveTemperature())
14272 {
14274 if (item.CanFreeze())
14275 item.SetFrozen(false);
14276 }
14277
14278 if (item.HasEnergyManager())
14279 {
14280 if (quantity >= 0)
14281 {
14282 item.GetCompEM().SetEnergy0To1(quantity);
14283 }
14284 else
14285 {
14287 }
14288 }
14289 else if (item.IsMagazine())
14290 {
14291 Magazine mag = Magazine.Cast(item);
14292 if (quantity >= 0)
14293 {
14294 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14295 }
14296 else
14297 {
14299 }
14300
14301 }
14302 else
14303 {
14304 if (quantity >= 0)
14305 {
14306 item.SetQuantityNormalized(quantity, false);
14307 }
14308 else
14309 {
14311 }
14312
14313 }
14314 }
14315}
14316
14317#ifdef DEVELOPER
14319#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.