9461{
9463 {
9464 return true;
9465 }
9466};
9467
9468
9469
9471{
9475
9477
9480
9481
9482
9483
9484
9493
9499
9504
9509
9530 protected bool m_IsResultOfSplit
9531
9533
9538
9539
9540
9542
9546
9547
9548
9550
9553
9554
9555
9561
9562
9570
9573
9574
9576
9577
9579
9580
9585
9586
9591
9592
9594
9595
9597 {
9602
9603 if (!
GetGame().IsDedicatedServer())
9604 {
9606 {
9608
9610 {
9612 }
9613 }
9614
9617 }
9618
9619 m_OldLocation = null;
9620
9622 {
9624 }
9625
9626 if (ConfigIsExisting("headSelectionsToHide"))
9627 {
9630 }
9631
9633 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9634 {
9636 }
9637
9639
9640 m_IsResultOfSplit = false;
9641
9643 }
9644
9646 {
9647 super.InitItemVariables();
9648
9654 m_Count = ConfigGetInt(
"count");
9655
9658
9663
9666
9671
9683
9687
9688
9691 if (ConfigIsExisting("canBeSplit"))
9692 {
9695 }
9696
9698 if (ConfigIsExisting("itemBehaviour"))
9700
9701
9704 RegisterNetSyncVariableInt("m_VarLiquidType");
9705 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9706
9707 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9708 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9709 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9710
9711 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9712 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9713 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9714 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9715
9716 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9717 RegisterNetSyncVariableBool("m_IsTakeable");
9718 RegisterNetSyncVariableBool("m_IsHologram");
9719
9722 {
9725 }
9726
9728
9730 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9732
9733 }
9734
9736 {
9738 }
9739
9741 {
9744 {
9749 }
9750 }
9751
9752 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9753 {
9755 {
9758 }
9759
9761 }
9762
9764 {
9770 }
9771
9773
9775 {
9777
9778 if (!action)
9779 {
9780 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9781 return;
9782 }
9783
9785 if (!ai)
9786 {
9788 return;
9789 }
9790
9792 if (!action_array)
9793 {
9794 action_array = new array<ActionBase_Basic>;
9796 }
9797 if (LogManager.IsActionLogEnable())
9798 {
9799 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9800 }
9801
9802 if (action_array.Find(action) != -1)
9803 {
9804 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9805 }
9806 else
9807 {
9808 action_array.Insert(action);
9809 }
9810 }
9811
9813 {
9815 ActionBase action = player.GetActionManager().GetAction(actionName);
9818
9819 if (action_array)
9820 {
9821 action_array.RemoveItem(action);
9822 }
9823 }
9824
9825
9826
9828 {
9829 ActionOverrideData overrideData = new ActionOverrideData();
9833
9835 if (!actionMap)
9836 {
9839 }
9840
9841 actionMap.Insert(this.
Type(), overrideData);
9842
9843 }
9844
9846
9848
9849
9851 {
9854
9857
9858 string config_to_search = "CfgVehicles";
9859 string muzzle_owner_config;
9860
9862 {
9863 if (IsInherited(Weapon))
9864 config_to_search = "CfgWeapons";
9865
9866 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9867
9868 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9869
9871
9872 if (config_OnFire_subclass_count > 0)
9873 {
9874 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9875
9876 for (int i = 0; i < config_OnFire_subclass_count; i++)
9877 {
9878 string particle_class = "";
9880 string config_OnFire_entry = config_OnFire_class + particle_class;
9881 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9882 WPOF_array.Insert(WPOF);
9883 }
9884
9885
9887 }
9888 }
9889
9891 {
9892 config_to_search = "CfgWeapons";
9893 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9894
9895 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9896
9898
9899 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9900 {
9901 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9902
9903 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9904 {
9905 string particle_class2 = "";
9907 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9908 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9909 WPOBE_array.Insert(WPOBE);
9910 }
9911
9912
9914 }
9915 }
9916 }
9917
9918
9920 {
9923
9925 {
9926 string config_to_search = "CfgVehicles";
9927
9928 if (IsInherited(Weapon))
9929 config_to_search = "CfgWeapons";
9930
9931 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9932 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9933
9934 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9935 {
9936
9938
9940 {
9942 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9944 return;
9945 }
9946
9949
9950
9951
9953 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9954
9955 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9956 {
9957 string particle_class = "";
9959 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9961
9962 if (entry_type == CT_CLASS)
9963 {
9964 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9965 WPOOH_array.Insert(WPOF);
9966 }
9967 }
9968
9969
9971 }
9972 }
9973 }
9974
9976 {
9978 }
9979
9981 {
9983 {
9985
9988
9991
9992 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9993 }
9994 }
9995
9997 {
9999 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10000
10002 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10003
10005 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10006
10008 {
10010 }
10011 }
10012
10014 {
10016 }
10017
10019 {
10022 else
10024
10026 {
10029 }
10030 else
10031 {
10034
10037 }
10038
10040 }
10041
10043 {
10045 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10046 }
10047
10049 {
10051 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10053 }
10054
10056 {
10058 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10059 }
10060
10062 {
10065
10066 OverheatingParticle OP = new OverheatingParticle();
10071
10073 }
10074
10076 {
10079
10080 return -1;
10081 }
10082
10084 {
10086 {
10089
10090 for (int i = count; i > 0; --i)
10091 {
10092 int id = i - 1;
10095
10098
10099 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10100 {
10101 if (p)
10102 {
10105 }
10106 }
10107 }
10108 }
10109 }
10110
10112 {
10114 {
10116 {
10117 int id = i - 1;
10119
10120 if (OP)
10121 {
10123
10124 if (p)
10125 {
10127 }
10128
10129 delete OP;
10130 }
10131 }
10132
10135 }
10136 }
10137
10140 {
10141 return 0.0;
10142 }
10143
10144
10146 {
10147 return 250;
10148 }
10149
10151 {
10152 return 0;
10153 }
10154
10157 {
10159 return true;
10160
10161 return false;
10162 }
10163
10166 {
10169
10171 {
10173 }
10174 else
10175 {
10176
10178 }
10179
10181 }
10182
10189 {
10190 return -1;
10191 }
10192
10193
10194
10195
10197 {
10199 {
10201 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10202
10203 if (r_index >= 0)
10204 {
10205 InventoryLocation r_il = new InventoryLocation;
10206 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10207
10208 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10211 {
10212 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10213 }
10215 {
10216 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10217 }
10218
10219 }
10220
10221 player.GetHumanInventory().ClearUserReservedLocation(this);
10222 }
10223
10226 }
10227
10228
10229
10230
10232 {
10233 return ItemBase.m_DebugActionsMask;
10234 }
10235
10237 {
10238 return ItemBase.m_DebugActionsMask & mask;
10239 }
10240
10242 {
10243 ItemBase.m_DebugActionsMask = mask;
10244 }
10245
10247 {
10248 ItemBase.m_DebugActionsMask |= mask;
10249 }
10250
10252 {
10253 ItemBase.m_DebugActionsMask &= ~mask;
10254 }
10255
10257 {
10259 {
10261 }
10262 else
10263 {
10265 }
10266 }
10267
10268
10270 {
10271 if (GetEconomyProfile())
10272 {
10273 float q_max = GetEconomyProfile().GetQuantityMax();
10274 if (q_max > 0)
10275 {
10276 float q_min = GetEconomyProfile().GetQuantityMin();
10277 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10278
10280 {
10281 ComponentEnergyManager comp = GetCompEM();
10283 {
10285 }
10286 }
10288 {
10290
10291 }
10292
10293 }
10294 }
10295 }
10296
10299 {
10300 EntityAI parent = GetHierarchyParent();
10301
10302 if (parent)
10303 {
10304 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10305 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10306 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10307 }
10308 }
10309
10312 {
10313 EntityAI parent = GetHierarchyParent();
10314
10315 if (parent)
10316 {
10317 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10318 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10319 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10320 }
10321 }
10322
10324 {
10325
10326
10327
10328
10330
10332 {
10333 if (ScriptInputUserData.CanStoreInputUserData())
10334 {
10335 ScriptInputUserData ctx = new ScriptInputUserData;
10341 ctx.
Write(use_stack_max);
10344
10346 {
10347 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10348 }
10349 }
10350 }
10351 else if (!
GetGame().IsMultiplayer())
10352 {
10354 }
10355 }
10356
10358 {
10360 }
10361
10363 {
10365 }
10366
10368 {
10370 }
10371
10373 {
10374
10375 return false;
10376 }
10377
10379 {
10380 return false;
10381 }
10382
10386 {
10387 return false;
10388 }
10389
10391 {
10392 return "";
10393 }
10394
10396
10398 {
10399 return false;
10400 }
10401
10403 {
10404 return true;
10405 }
10406
10407
10408
10410 {
10411 return true;
10412 }
10413
10415 {
10416 return true;
10417 }
10418
10420 {
10421 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10423 }
10424
10426 {
10428 }
10429
10431 {
10433 if (!is_being_placed)
10435 SetSynchDirty();
10436 }
10437
10438
10440
10442 {
10444 }
10445
10447 {
10449 }
10450
10452 {
10453 return 1;
10454 }
10455
10457 {
10458 return false;
10459 }
10460
10462 {
10464 SetSynchDirty();
10465 }
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10502 {
10503 super.OnMovedInsideCargo(container);
10504
10505 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10506 }
10507
10508 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10509 {
10510 super.EEItemLocationChanged(oldLoc,newLoc);
10511
10512 PlayerBase new_player = null;
10513 PlayerBase old_player = null;
10514
10515 if (newLoc.GetParent())
10516 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10517
10518 if (oldLoc.GetParent())
10519 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10520
10522 {
10523 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10524
10525 if (r_index >= 0)
10526 {
10527 InventoryLocation r_il = new InventoryLocation;
10528 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10529
10530 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10533 {
10534 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10535 }
10537 {
10538 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10539 }
10540
10541 }
10542 }
10543
10545 {
10546 if (new_player)
10547 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10548
10549 if (new_player == old_player)
10550 {
10551
10552 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10553 {
10555 {
10556 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10557 {
10558 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10559 }
10560 }
10561 else
10562 {
10563 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10564 }
10565 }
10566
10567 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10568 {
10569 int type = oldLoc.GetType();
10571 {
10572 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10573 }
10575 {
10576 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10577 }
10578 }
10579 if (!m_OldLocation)
10580 {
10581 m_OldLocation = new InventoryLocation;
10582 }
10583 m_OldLocation.Copy(oldLoc);
10584 }
10585 else
10586 {
10587 if (m_OldLocation)
10588 {
10589 m_OldLocation.Reset();
10590 }
10591 }
10592
10594 }
10595 else
10596 {
10597 if (new_player)
10598 {
10599 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10600 if (res_index >= 0)
10601 {
10602 InventoryLocation il = new InventoryLocation;
10603 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10605 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10608 {
10609 il.
GetParent().GetOnReleaseLock().Invoke(it);
10610 }
10612 {
10614 }
10615
10616 }
10617 }
10619 {
10620
10622 }
10623
10624 if (m_OldLocation)
10625 {
10626 m_OldLocation.Reset();
10627 }
10628 }
10629 }
10630
10631 override void EOnContact(IEntity other, Contact extra)
10632 {
10634 {
10635 int liquidType = -1;
10637 if (impactSpeed > 0.0)
10638 {
10640 #ifndef SERVER
10642 #else
10644 SetSynchDirty();
10645 #endif
10647 }
10648 }
10649
10650 #ifdef SERVER
10651 if (GetCompEM() && GetCompEM().IsPlugged())
10652 {
10653 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10654 GetCompEM().UnplugThis();
10655 }
10656 #endif
10657 }
10658
10660
10662 {
10664 }
10665
10667 {
10668
10669 }
10670
10672 {
10673 super.OnItemLocationChanged(old_owner, new_owner);
10674
10675 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10676 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10677
10678 if (!relatedPlayer && playerNew)
10679 relatedPlayer = playerNew;
10680
10681 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10682 {
10684 if (actionMgr)
10685 {
10686 ActionBase currentAction = actionMgr.GetRunningAction();
10687 if (currentAction)
10689 }
10690 }
10691
10692 Man ownerPlayerOld = null;
10693 Man ownerPlayerNew = null;
10694
10695 if (old_owner)
10696 {
10697 if (old_owner.
IsMan())
10698 {
10699 ownerPlayerOld = Man.Cast(old_owner);
10700 }
10701 else
10702 {
10703 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10704 }
10705 }
10706 else
10707 {
10709 {
10711
10712 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10713 {
10714 GetCompEM().UnplugThis();
10715 }
10716 }
10717 }
10718
10719 if (new_owner)
10720 {
10721 if (new_owner.
IsMan())
10722 {
10723 ownerPlayerNew = Man.Cast(new_owner);
10724 }
10725 else
10726 {
10727 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10728 }
10729 }
10730
10731 if (ownerPlayerOld != ownerPlayerNew)
10732 {
10733 if (ownerPlayerOld)
10734 {
10735 array<EntityAI> subItemsExit = new array<EntityAI>;
10737 for (int i = 0; i < subItemsExit.Count(); i++)
10738 {
10741 }
10742 }
10743
10744 if (ownerPlayerNew)
10745 {
10746 array<EntityAI> subItemsEnter = new array<EntityAI>;
10748 for (int j = 0; j < subItemsEnter.Count(); j++)
10749 {
10752 }
10753 }
10754 }
10755 else if (ownerPlayerNew != null)
10756 {
10757 PlayerBase nplayer;
10758 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10759 {
10760 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10762 for (int k = 0; k < subItemsUpdate.Count(); k++)
10763 {
10765 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10766 }
10767 }
10768 }
10769
10770 if (old_owner)
10771 old_owner.OnChildItemRemoved(this);
10772 if (new_owner)
10773 new_owner.OnChildItemReceived(this);
10774 }
10775
10776
10778 {
10779 super.EEDelete(parent);
10780 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10781 if (player)
10782 {
10784
10785 if (player.IsAlive())
10786 {
10787 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10788 if (r_index >= 0)
10789 {
10790 InventoryLocation r_il = new InventoryLocation;
10791 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10792
10793 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10796 {
10797 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10798 }
10800 {
10801 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10802 }
10803
10804 }
10805
10806 player.RemoveQuickBarEntityShortcut(this);
10807 }
10808 }
10809 }
10810
10812 {
10813 super.EEKilled(killer);
10814
10817 {
10818 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10819 {
10820 if (IsMagazine())
10821 {
10822 if (Magazine.Cast(this).GetAmmoCount() > 0)
10823 {
10825 }
10826 }
10827 else
10828 {
10830 }
10831 }
10832 }
10833 }
10834
10836 {
10837 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10838
10839 super.OnWasAttached(parent, slot_id);
10840
10843
10845 }
10846
10848 {
10849 super.OnWasDetached(parent, slot_id);
10850
10853 }
10854
10856 {
10857 int idx;
10860
10861 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10862 if (inventory_slots.Count() < 1)
10863 {
10864 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10865 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10866 }
10867 else
10868 {
10869 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10870 }
10871
10872 idx = inventory_slots.Find(slot);
10873 if (idx < 0)
10874 return "";
10875
10876 return attach_types.Get(idx);
10877 }
10878
10880 {
10881 int idx = -1;
10882 string slot;
10883
10886
10887 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10888 if (inventory_slots.Count() < 1)
10889 {
10890 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10891 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10892 }
10893 else
10894 {
10895 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10896 if (detach_types.Count() < 1)
10897 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10898 }
10899
10900 for (int i = 0; i < inventory_slots.Count(); i++)
10901 {
10902 slot = inventory_slots.Get(i);
10903 }
10904
10905 if (slot != "")
10906 {
10907 if (detach_types.Count() == 1)
10908 idx = 0;
10909 else
10910 idx = inventory_slots.Find(slot);
10911 }
10912 if (idx < 0)
10913 return "";
10914
10915 return detach_types.Get(idx);
10916 }
10917
10919 {
10920
10922
10923
10924 float min_time = 1;
10925 float max_time = 3;
10926 float delay = Math.RandomFloat(min_time, max_time);
10927
10928 explode_timer.Run(delay, this, "DoAmmoExplosion");
10929 }
10930
10932 {
10933 Magazine magazine = Magazine.Cast(this);
10934 int pop_sounds_count = 6;
10935 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10936
10937
10938 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10939 string sound_name = pop_sounds[ sound_idx ];
10941
10942
10943 magazine.ServerAddAmmoCount(-1);
10944
10945
10946 float min_temp_to_explode = 100;
10947
10948 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10949 {
10951 }
10952 }
10953
10954
10955 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10956 {
10957 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10958
10959 const int CHANCE_DAMAGE_CARGO = 4;
10960 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10961 const int CHANCE_DAMAGE_NOTHING = 2;
10962
10964 {
10965 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10966 int chances;
10967 int rnd;
10968
10969 if (GetInventory().GetCargo())
10970 {
10971 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10972 rnd = Math.RandomInt(0,chances);
10973
10974 if (rnd < CHANCE_DAMAGE_CARGO)
10975 {
10977 }
10978 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10979 {
10981 }
10982 }
10983 else
10984 {
10985 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10986 rnd = Math.RandomInt(0,chances);
10987
10988 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10989 {
10991 }
10992 }
10993 }
10994 }
10995
10997 {
10998 if (GetInventory().GetCargo())
10999 {
11000 int item_count = GetInventory().GetCargo().GetItemCount();
11001 if (item_count > 0)
11002 {
11003 int random_pick = Math.RandomInt(0, item_count);
11005 if (!item.IsExplosive())
11006 {
11007 item.AddHealth("","",damage);
11008 return true;
11009 }
11010 }
11011 }
11012 return false;
11013 }
11014
11016 {
11017 int attachment_count = GetInventory().AttachmentCount();
11018 if (attachment_count > 0)
11019 {
11020 int random_pick = Math.RandomInt(0, attachment_count);
11021 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11022 if (!attachment.IsExplosive())
11023 {
11024 attachment.AddHealth("","",damage);
11025 return true;
11026 }
11027 }
11028 return false;
11029 }
11030
11032 {
11034 }
11035
11037 {
11039 return GetInventory().CanRemoveEntity();
11040
11041 return false;
11042 }
11043
11045 {
11046
11048 return false;
11049
11050
11052 return false;
11053
11054
11055
11057 if (delta == 0)
11058 return false;
11059
11060
11061 return true;
11062 }
11063
11065 {
11067 {
11068 if (ScriptInputUserData.CanStoreInputUserData())
11069 {
11070 ScriptInputUserData ctx = new ScriptInputUserData;
11075 ctx.
Write(destination_entity);
11077 ctx.
Write(slot_id);
11079 }
11080 }
11081 else if (!
GetGame().IsMultiplayer())
11082 {
11084 }
11085 }
11086
11088 {
11089 float split_quantity_new;
11093 InventoryLocation loc = new InventoryLocation;
11094
11095 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11096 {
11098 split_quantity_new = stack_max;
11099 else
11101
11103 {
11104 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11105 if (new_item)
11106 {
11107 new_item.SetResultOfSplit(true);
11108 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11110 new_item.
SetQuantity(split_quantity_new,
false,
true);
11111 }
11112 }
11113 }
11114 else if (destination_entity && slot_id == -1)
11115 {
11116 if (quantity > stack_max)
11117 split_quantity_new = stack_max;
11118 else
11119 split_quantity_new = quantity;
11120
11122 {
11124 {
11127 }
11128
11129 if (new_item)
11130 {
11131 new_item.SetResultOfSplit(true);
11132 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11134 new_item.
SetQuantity(split_quantity_new,
false,
true);
11135 }
11136 }
11137 }
11138 else
11139 {
11140 if (stack_max != 0)
11141 {
11143 {
11145 }
11146
11147 if (split_quantity_new == 0)
11148 {
11149 if (!
GetGame().IsMultiplayer())
11150 player.PhysicalPredictiveDropItem(this);
11151 else
11152 player.ServerDropEntity(this);
11153 return;
11154 }
11155
11157 {
11159
11160 if (new_item)
11161 {
11162 new_item.SetResultOfSplit(true);
11163 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11166 new_item.PlaceOnSurface();
11167 }
11168 }
11169 }
11170 }
11171 }
11172
11174 {
11175 float split_quantity_new;
11179 InventoryLocation loc = new InventoryLocation;
11180
11181 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11182 {
11184 split_quantity_new = stack_max;
11185 else
11187
11189 {
11190 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11191 if (new_item)
11192 {
11193 new_item.SetResultOfSplit(true);
11194 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11196 new_item.
SetQuantity(split_quantity_new,
false,
true);
11197 }
11198 }
11199 }
11200 else if (destination_entity && slot_id == -1)
11201 {
11202 if (quantity > stack_max)
11203 split_quantity_new = stack_max;
11204 else
11205 split_quantity_new = quantity;
11206
11208 {
11210 {
11213 }
11214
11215 if (new_item)
11216 {
11217 new_item.SetResultOfSplit(true);
11218 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11220 new_item.
SetQuantity(split_quantity_new,
false,
true);
11221 }
11222 }
11223 }
11224 else
11225 {
11226 if (stack_max != 0)
11227 {
11229 {
11231 }
11232
11234 {
11236
11237 if (new_item)
11238 {
11239 new_item.SetResultOfSplit(true);
11240 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11243 new_item.PlaceOnSurface();
11244 }
11245 }
11246 }
11247 }
11248 }
11249
11251 {
11253 {
11254 if (ScriptInputUserData.CanStoreInputUserData())
11255 {
11256 ScriptInputUserData ctx = new ScriptInputUserData;
11261 dst.WriteToContext(ctx);
11263 }
11264 }
11265 else if (!
GetGame().IsMultiplayer())
11266 {
11268 }
11269 }
11270
11272 {
11274 {
11275 if (ScriptInputUserData.CanStoreInputUserData())
11276 {
11277 ScriptInputUserData ctx = new ScriptInputUserData;
11282 ctx.
Write(destination_entity);
11288 }
11289 }
11290 else if (!
GetGame().IsMultiplayer())
11291 {
11293 }
11294 }
11295
11297 {
11299 }
11300
11302 {
11304 float split_quantity_new;
11306 if (dst.IsValid())
11307 {
11308 int slot_id = dst.GetSlot();
11310
11311 if (quantity > stack_max)
11312 split_quantity_new = stack_max;
11313 else
11314 split_quantity_new = quantity;
11315
11317 {
11319
11320 if (new_item)
11321 {
11322 new_item.SetResultOfSplit(true);
11323 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11325 new_item.
SetQuantity(split_quantity_new,
false,
true);
11326 }
11327
11328 return new_item;
11329 }
11330 }
11331
11332 return null;
11333 }
11334
11336 {
11338 float split_quantity_new;
11340 if (destination_entity)
11341 {
11343 if (quantity > stackable)
11344 split_quantity_new = stackable;
11345 else
11346 split_quantity_new = quantity;
11347
11349 {
11350 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11351 if (new_item)
11352 {
11353 new_item.SetResultOfSplit(true);
11354 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11356 new_item.
SetQuantity(split_quantity_new,
false,
true);
11357 }
11358 }
11359 }
11360 }
11361
11363 {
11365 {
11366 if (ScriptInputUserData.CanStoreInputUserData())
11367 {
11368 ScriptInputUserData ctx = new ScriptInputUserData;
11373 ItemBase destination_entity =
this;
11374 ctx.
Write(destination_entity);
11378 }
11379 }
11380 else if (!
GetGame().IsMultiplayer())
11381 {
11383 }
11384 }
11385
11387 {
11389 float split_quantity_new;
11391 if (player)
11392 {
11394 if (quantity > stackable)
11395 split_quantity_new = stackable;
11396 else
11397 split_quantity_new = quantity;
11398
11400 {
11401 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11402 new_item =
ItemBase.Cast(in_hands);
11403 if (new_item)
11404 {
11405 new_item.SetResultOfSplit(true);
11406 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11408 new_item.SetQuantity(split_quantity_new, false, true);
11409 }
11410 }
11411 }
11412 }
11413
11415 {
11417 float split_quantity_new = Math.Floor(quantity * 0.5);
11418
11420 return;
11421
11423
11424 if (new_item)
11425 {
11426 if (new_item.GetQuantityMax() < split_quantity_new)
11427 {
11428 split_quantity_new = new_item.GetQuantityMax();
11429 }
11430
11431 new_item.SetResultOfSplit(true);
11432 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11433
11435 {
11438 }
11439 else
11440 {
11442 new_item.
SetQuantity(split_quantity_new,
false,
true);
11443 }
11444 }
11445 }
11446
11448 {
11450 float split_quantity_new = Math.Floor(quantity / 2);
11451
11453 return;
11454
11455 InventoryLocation invloc = new InventoryLocation;
11457
11459 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11460
11461 if (new_item)
11462 {
11463 if (new_item.GetQuantityMax() < split_quantity_new)
11464 {
11465 split_quantity_new = new_item.GetQuantityMax();
11466 }
11468 {
11471 }
11472 else if (split_quantity_new > 1)
11473 {
11475 new_item.
SetQuantity(split_quantity_new,
false,
true);
11476 }
11477 }
11478 }
11479
11482 {
11483 SetWeightDirty();
11485
11486 if (parent)
11487 parent.OnAttachmentQuantityChangedEx(this, delta);
11488
11490 {
11492 {
11494 }
11496 {
11497 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11499 }
11500 }
11501
11502 }
11503
11506 {
11507
11508 }
11509
11512 {
11514 }
11515
11517 {
11518 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11519
11521 {
11522 if (newLevel == GameConstants.STATE_RUINED)
11523 {
11525 EntityAI parent = GetHierarchyParent();
11526 if (parent && parent.IsFireplace())
11527 {
11528 CargoBase cargo = GetInventory().GetCargo();
11529 if (cargo)
11530 {
11532 {
11534 }
11535 }
11536 }
11537 }
11538
11540 {
11541
11543 return;
11544 }
11545
11546 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11547 {
11549 }
11550 }
11551 }
11552
11553
11555 {
11556 super.OnRightClick();
11557
11559 {
11561 {
11562 if (ScriptInputUserData.CanStoreInputUserData())
11563 {
11564 EntityAI root = GetHierarchyRoot();
11565 Man playerOwner = GetHierarchyRootPlayer();
11566 InventoryLocation dst = new InventoryLocation;
11567
11568
11569 if (!playerOwner && root && root == this)
11570 {
11572 }
11573 else
11574 {
11575
11576 GetInventory().GetCurrentInventoryLocation(dst);
11578 {
11581 {
11583 }
11584 else
11585 {
11587
11588
11589 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11590 {
11592 }
11593 else
11594 {
11595 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11596 }
11597 }
11598 }
11599 }
11600
11601 ScriptInputUserData ctx = new ScriptInputUserData;
11609 }
11610 }
11611 else if (!
GetGame().IsMultiplayer())
11612 {
11614 }
11615 }
11616 }
11617
11619 {
11620 if (root)
11621 {
11622 vector m4[4];
11623 root.GetTransform(m4);
11624 dst.SetGround(this, m4);
11625 }
11626 else
11627 {
11628 GetInventory().GetCurrentInventoryLocation(dst);
11629 }
11630 }
11631
11632 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11633 {
11634
11635 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11636 return false;
11637
11638 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11639 return false;
11640
11641
11643 return false;
11644
11645
11646 Magazine mag = Magazine.Cast(this);
11647 if (mag)
11648 {
11649 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11650 return false;
11651
11652 if (stack_max_limit)
11653 {
11654 Magazine other_mag = Magazine.Cast(other_item);
11655 if (other_item)
11656 {
11657 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11658 return false;
11659 }
11660
11661 }
11662 }
11663 else
11664 {
11665
11667 return false;
11668
11670 return false;
11671 }
11672
11673 PlayerBase player = null;
11674 if (CastTo(player, GetHierarchyRootPlayer()))
11675 {
11676 if (player.GetInventory().HasAttachment(this))
11677 return false;
11678
11679 if (player.IsItemsToDelete())
11680 return false;
11681 }
11682
11683 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11684 return false;
11685
11686 int slotID;
11688 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11689 return false;
11690
11691 return true;
11692 }
11693
11695 {
11697 }
11698
11700 {
11701 return m_IsResultOfSplit;
11702 }
11703
11705 {
11706 m_IsResultOfSplit = value;
11707 }
11708
11710 {
11712 }
11713
11715 {
11716 float other_item_quantity = other_item.GetQuantity();
11717 float this_free_space;
11718
11720
11722
11723 if (other_item_quantity > this_free_space)
11724 {
11725 return this_free_space;
11726 }
11727 else
11728 {
11729 return other_item_quantity;
11730 }
11731 }
11732
11734 {
11736 }
11737
11739 {
11741 return;
11742
11743 if (!IsMagazine() && other_item)
11744 {
11746 if (quantity_used != 0)
11747 {
11748 float hp1 = GetHealth01("","");
11749 float hp2 = other_item.GetHealth01("","");
11750 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11751 hpResult = hpResult / (
GetQuantity() + quantity_used);
11752
11753 hpResult *= GetMaxHealth();
11754 Math.Round(hpResult);
11755 SetHealth("", "Health", hpResult);
11756
11758 other_item.AddQuantity(-quantity_used);
11759 }
11760 }
11762 }
11763
11765 {
11766 #ifdef SERVER
11767 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11768 GetHierarchyParent().IncreaseLifetimeUp();
11769 #endif
11770 };
11771
11773 {
11774 PlayerBase p = PlayerBase.Cast(player);
11775
11776 array<int> recipesIds = p.m_Recipes;
11777 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11778 if (moduleRecipesManager)
11779 {
11780 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11781 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11782 }
11783
11784 for (int i = 0;i < recipesIds.Count(); i++)
11785 {
11786 int key = recipesIds.Get(i);
11787 string recipeName = moduleRecipesManager.GetRecipeName(key);
11789 }
11790 }
11791
11792
11793 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11794 {
11795 super.GetDebugActions(outputList);
11796
11797
11803
11804
11809
11814
11815
11819
11820
11822 {
11826 }
11827
11830
11831
11835
11837
11838 InventoryLocation loc = new InventoryLocation();
11839 GetInventory().GetCurrentInventoryLocation(loc);
11841 {
11842 if (Gizmo_IsSupported())
11845 }
11846
11848 }
11849
11850
11851
11852
11854 {
11855 super.OnAction(action_id, player, ctx);
11856
11858 {
11859 switch (action_id)
11860 {
11863 return true;
11866 return true;
11867 }
11868 }
11869
11871 {
11872 switch (action_id)
11873 {
11875 Delete();
11876 return true;
11877 }
11878 }
11879
11880 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11881 {
11882 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11883 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11884 PlayerBase p = PlayerBase.Cast(player);
11885 if (
EActions.RECIPES_RANGE_START < 1000)
11886 {
11887 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11888 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11889 }
11890 }
11891 #ifndef SERVER
11892 else if (action_id ==
EActions.WATCH_PLAYER)
11893 {
11894 PluginDeveloper.SetDeveloperItemClientEx(player);
11895 }
11896 #endif
11898 {
11899 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11900 {
11901 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11902 OnDebugButtonPressServer(id + 1);
11903 }
11904
11905 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11906 {
11907 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11909 }
11910
11911 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11912 {
11913 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11915 }
11916
11917 else if (action_id ==
EActions.ADD_QUANTITY)
11918 {
11919 if (IsMagazine())
11920 {
11921 Magazine mag = Magazine.Cast(this);
11922 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11923 }
11924 else
11925 {
11927 }
11928
11929 if (m_EM)
11930 {
11931 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11932 }
11933
11934 }
11935
11936 else if (action_id ==
EActions.REMOVE_QUANTITY)
11937 {
11938 if (IsMagazine())
11939 {
11940 Magazine mag2 = Magazine.Cast(this);
11941 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11942 }
11943 else
11944 {
11946 }
11947 if (m_EM)
11948 {
11949 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11950 }
11951
11952 }
11953
11954 else if (action_id ==
EActions.SET_QUANTITY_0)
11955 {
11957
11958 if (m_EM)
11959 {
11960 m_EM.SetEnergy(0);
11961 }
11962 }
11963
11964 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11965 {
11967
11968 if (m_EM)
11969 {
11970 m_EM.SetEnergy(m_EM.GetEnergyMax());
11971 }
11972 }
11973
11974 else if (action_id ==
EActions.ADD_HEALTH)
11975 {
11976 AddHealth("","",GetMaxHealth("","Health")/5);
11977 }
11978 else if (action_id ==
EActions.REMOVE_HEALTH)
11979 {
11980 AddHealth("","",-GetMaxHealth("","Health")/5);
11981 }
11982 else if (action_id ==
EActions.DESTROY_HEALTH)
11983 {
11984 SetHealth01("","",0);
11985 }
11986 else if (action_id ==
EActions.WATCH_ITEM)
11987 {
11989 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11990 #ifdef DEVELOPER
11991 SetDebugDeveloper_item(this);
11992 #endif
11993 }
11994
11995 else if (action_id ==
EActions.ADD_TEMPERATURE)
11996 {
11997 AddTemperature(20);
11998
11999 }
12000
12001 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12002 {
12003 AddTemperature(-20);
12004
12005 }
12006
12007 else if (action_id ==
EActions.FLIP_FROZEN)
12008 {
12009 SetFrozen(!GetIsFrozen());
12010
12011 }
12012
12013 else if (action_id ==
EActions.ADD_WETNESS)
12014 {
12016
12017 }
12018
12019 else if (action_id ==
EActions.REMOVE_WETNESS)
12020 {
12022
12023 }
12024
12025 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12026 {
12029
12030
12031 }
12032
12033 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12034 {
12037 }
12038
12039 else if (action_id ==
EActions.MAKE_SPECIAL)
12040 {
12041 auto debugParams = DebugSpawnParams.WithPlayer(player);
12042 OnDebugSpawnEx(debugParams);
12043 }
12044
12045 }
12046
12047
12048 return false;
12049 }
12050
12051
12052
12053
12057
12060
12061
12062
12064 {
12065 return false;
12066 }
12067
12068
12070 {
12071 return true;
12072 }
12073
12074
12076 {
12077 return true;
12078 }
12079
12080
12081
12083 {
12084 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12086 }
12087
12090 {
12091 return null;
12092 }
12093
12095 {
12096 return false;
12097 }
12098
12100 {
12101 return false;
12102 }
12103
12107
12108
12110 {
12111 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12112 return module_repairing.CanRepair(this, item_repair_kit);
12113 }
12114
12115
12116 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12117 {
12118 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12119 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12120 }
12121
12122
12124 {
12125
12126
12127
12128
12129
12130
12131
12132
12133 return 1;
12134 }
12135
12136
12137
12139 {
12141 }
12142
12143
12144
12146 {
12148 }
12149
12150
12159 {
12160 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12161
12162 if (player)
12163 {
12164 player.MessageStatus(text);
12165 }
12166 }
12167
12168
12177 {
12178 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12179
12180 if (player)
12181 {
12182 player.MessageAction(text);
12183 }
12184 }
12185
12186
12195 {
12196 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12197
12198 if (player)
12199 {
12200 player.MessageFriendly(text);
12201 }
12202 }
12203
12204
12213 {
12214 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12215
12216 if (player)
12217 {
12218 player.MessageImportant(text);
12219 }
12220 }
12221
12223 {
12224 return true;
12225 }
12226
12227
12228 override bool KindOf(
string tag)
12229 {
12230 bool found = false;
12231 string item_name = this.
GetType();
12234
12235 int array_size = item_tag_array.Count();
12236 for (int i = 0; i < array_size; i++)
12237 {
12238 if (item_tag_array.Get(i) == tag)
12239 {
12240 found = true;
12241 break;
12242 }
12243 }
12244 return found;
12245 }
12246
12247
12249 {
12250
12251 super.OnRPC(sender, rpc_type,ctx);
12252
12253
12254 switch (rpc_type)
12255 {
12256 #ifndef SERVER
12257 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12258 Param2<bool, string> p = new Param2<bool, string>(false, "");
12259
12261 return;
12262
12263 bool play = p.param1;
12264 string soundSet = p.param2;
12265
12266 if (play)
12267 {
12269 {
12271 {
12273 }
12274 }
12275 else
12276 {
12278 }
12279 }
12280 else
12281 {
12283 }
12284
12285 break;
12286 #endif
12287
12288 }
12289
12291 {
12293 }
12294 }
12295
12296
12297
12298
12300 {
12301 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12302 return plugin.GetID(
name);
12303 }
12304
12306 {
12307 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12308 return plugin.GetName(id);
12309 }
12310
12313 {
12314
12315
12316 int varFlags;
12317 if (!ctx.
Read(varFlags))
12318 return;
12319
12320 if (varFlags & ItemVariableFlags.FLOAT)
12321 {
12323 }
12324 }
12325
12327 {
12328
12329 super.SerializeNumericalVars(floats_out);
12330
12331
12332
12334 {
12336 }
12337
12339 {
12341 }
12342
12344 {
12346 }
12347
12349 {
12354 }
12355
12357 {
12359 }
12360 }
12361
12363 {
12364
12365 super.DeSerializeNumericalVars(floats);
12366
12367
12368 int index = 0;
12369 int mask = Math.Round(floats.Get(index));
12370
12371 index++;
12372
12374 {
12376 {
12378 }
12379 else
12380 {
12381 float quantity = floats.Get(index);
12382 SetQuantity(quantity,
true,
false,
false,
false);
12383 }
12384 index++;
12385 }
12386
12388 {
12389 float wet = floats.Get(index);
12391 index++;
12392 }
12393
12395 {
12396 int liquidtype = Math.Round(floats.Get(index));
12398 index++;
12399 }
12400
12402 {
12404 index++;
12406 index++;
12408 index++;
12410 index++;
12411 }
12412
12414 {
12415 int cleanness = Math.Round(floats.Get(index));
12417 index++;
12418 }
12419 }
12420
12422 {
12423 super.WriteVarsToCTX(ctx);
12424
12425
12427 {
12429 }
12430
12432 {
12434 }
12435
12437 {
12439 }
12440
12442 {
12443 int r,g,b,a;
12449 }
12450
12452 {
12454 }
12455 }
12456
12458 {
12459 if (!super.ReadVarsFromCTX(ctx,version))
12460 return false;
12461
12462 int intValue;
12463 float value;
12464
12465 if (version < 140)
12466 {
12467 if (!ctx.
Read(intValue))
12468 return false;
12469
12470 m_VariablesMask = intValue;
12471 }
12472
12474 {
12475 if (!ctx.
Read(value))
12476 return false;
12477
12479 {
12481 }
12482 else
12483 {
12485 }
12486 }
12487
12488 if (version < 140)
12489 {
12491 {
12492 if (!ctx.
Read(value))
12493 return false;
12494 SetTemperatureDirect(value);
12495 }
12496 }
12497
12499 {
12500 if (!ctx.
Read(value))
12501 return false;
12503 }
12504
12506 {
12507 if (!ctx.
Read(intValue))
12508 return false;
12510 }
12511
12513 {
12514 int r,g,b,a;
12516 return false;
12518 return false;
12520 return false;
12522 return false;
12523
12525 }
12526
12528 {
12529 if (!ctx.
Read(intValue))
12530 return false;
12532 }
12533
12534 if (version >= 138 && version < 140)
12535 {
12537 {
12538 if (!ctx.
Read(intValue))
12539 return false;
12540 SetFrozen(intValue);
12541 }
12542 }
12543
12544 return true;
12545 }
12546
12547
12549 {
12552 {
12554 }
12555
12556 if (!super.OnStoreLoad(ctx, version))
12557 {
12559 return false;
12560 }
12561
12562 if (version >= 114)
12563 {
12564 bool hasQuickBarIndexSaved;
12565
12566 if (!ctx.
Read(hasQuickBarIndexSaved))
12567 {
12569 return false;
12570 }
12571
12572 if (hasQuickBarIndexSaved)
12573 {
12574 int itmQBIndex;
12575
12576
12577 if (!ctx.
Read(itmQBIndex))
12578 {
12580 return false;
12581 }
12582
12583 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12584 if (itmQBIndex != -1 && parentPlayer)
12585 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12586 }
12587 }
12588 else
12589 {
12590
12591 PlayerBase player;
12592 int itemQBIndex;
12593 if (version ==
int.
MAX)
12594 {
12595 if (!ctx.
Read(itemQBIndex))
12596 {
12598 return false;
12599 }
12600 }
12601 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12602 {
12603
12604 if (!ctx.
Read(itemQBIndex))
12605 {
12607 return false;
12608 }
12609 if (itemQBIndex != -1 && player)
12610 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12611 }
12612 }
12613
12614 if (version < 140)
12615 {
12616
12617 if (!LoadVariables(ctx, version))
12618 {
12620 return false;
12621 }
12622 }
12623
12624
12626 {
12628 return false;
12629 }
12630 if (version >= 132)
12631 {
12633 if (raib)
12634 {
12636 {
12638 return false;
12639 }
12640 }
12641 }
12642
12644 return true;
12645 }
12646
12647
12648
12650 {
12651 super.OnStoreSave(ctx);
12652
12653 PlayerBase player;
12654 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12655 {
12657
12658 int itemQBIndex = -1;
12659 itemQBIndex = player.FindQuickBarEntityIndex(this);
12660 ctx.
Write(itemQBIndex);
12661 }
12662 else
12663 {
12665 }
12666
12668
12670 if (raib)
12671 {
12673 }
12674 }
12675
12676
12678 {
12679 super.AfterStoreLoad();
12680
12682 {
12684 }
12685
12687 {
12690 }
12691 }
12692
12694 {
12695 super.EEOnAfterLoad();
12696
12698 {
12700 }
12701
12704 }
12705
12707 {
12708 return false;
12709 }
12710
12711
12712
12714 {
12716 {
12717 #ifdef PLATFORM_CONSOLE
12718
12720 {
12722 if (menu)
12723 {
12725 }
12726 }
12727 #endif
12728 }
12729
12731 {
12734 }
12735
12737 {
12738 SetWeightDirty();
12740 }
12742 {
12745 }
12746
12748 {
12751 }
12753 {
12756 }
12757
12758 super.OnVariablesSynchronized();
12759 }
12760
12761
12762
12764 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12765 {
12766 if (!IsServerCheck(allow_client))
12767 return false;
12768
12770 return false;
12771
12774
12775 if (value <= (min + 0.001))
12776 value = min;
12777
12778 if (value == min)
12779 {
12780 if (destroy_config)
12781 {
12782 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12783 if (dstr)
12784 {
12786 this.Delete();
12787 return true;
12788 }
12789 }
12790 else if (destroy_forced)
12791 {
12793 this.Delete();
12794 return true;
12795 }
12796
12798 }
12799
12802
12804 {
12806
12807 if (delta)
12809 }
12810
12812
12813 return false;
12814 }
12815
12816
12818 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12819 {
12821 }
12822
12824 {
12827 }
12828
12830 {
12833 }
12834
12836 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12837 {
12838 float value_clamped = Math.Clamp(value, 0, 1);
12840 SetQuantity(result, destroy_config, destroy_forced);
12841 }
12842
12843
12846 {
12848 }
12849
12851 {
12853 }
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12865 {
12866 int slot = -1;
12867 if (GetInventory())
12868 {
12869 InventoryLocation il = new InventoryLocation;
12870 GetInventory().GetCurrentInventoryLocation(il);
12872 }
12873
12875 }
12876
12878 {
12879 float quantity_max = 0;
12880
12882 {
12883 if (attSlotID != -1)
12884 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12885
12886 if (quantity_max <= 0)
12888 }
12889
12890 if (quantity_max <= 0)
12892
12893 return quantity_max;
12894 }
12895
12897 {
12899 }
12900
12902 {
12904 }
12905
12906
12908 {
12910 }
12911
12913 {
12915 }
12916
12918 {
12920 }
12921
12922
12924 {
12925
12926 float weightEx = GetWeightEx();
12927 float special = GetInventoryAndCargoWeight();
12928 return weightEx - special;
12929 }
12930
12931
12933 {
12935 }
12936
12938 {
12940 {
12941 #ifdef DEVELOPER
12942 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12943 {
12944 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12946 }
12947 #endif
12948
12949 return GetQuantity() * GetConfigWeightModified();
12950 }
12951 else if (HasEnergyManager())
12952 {
12953 #ifdef DEVELOPER
12954 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12955 {
12956 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12957 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12958 }
12959 #endif
12960 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12961 }
12962 else
12963 {
12964 #ifdef DEVELOPER
12965 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12966 {
12967 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12968 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12969 }
12970 #endif
12971 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12972 }
12973 }
12974
12977 {
12978 int item_count = 0;
12980
12981 if (GetInventory().GetCargo() != NULL)
12982 {
12983 item_count = GetInventory().GetCargo().GetItemCount();
12984 }
12985
12986 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12987 {
12988 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12989 if (item)
12990 item_count += item.GetNumberOfItems();
12991 }
12992 return item_count;
12993 }
12994
12997 {
12998 float weight = 0;
12999 float wetness = 1;
13000 if (include_wetness)
13003 {
13004 weight = wetness * m_ConfigWeight;
13005 }
13007 {
13008 weight = 1;
13009 }
13010 return weight;
13011 }
13012
13013
13014
13016 {
13017 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13018 {
13019 GameInventory inv = GetInventory();
13020 array<EntityAI> items = new array<EntityAI>;
13022 for (int i = 0; i < items.Count(); i++)
13023 {
13025 if (item)
13026 {
13028 }
13029 }
13030 }
13031 }
13032
13033
13034
13035
13037 {
13038 float energy = 0;
13039 if (HasEnergyManager())
13040 {
13041 energy = GetCompEM().GetEnergy();
13042 }
13043 return energy;
13044 }
13045
13046
13048 {
13049 super.OnEnergyConsumed();
13050
13052 }
13053
13055 {
13056 super.OnEnergyAdded();
13057
13059 }
13060
13061
13063 {
13064 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13065 {
13067 {
13068 float energy_0to1 = GetCompEM().GetEnergy0To1();
13070 }
13071 }
13072 }
13073
13074
13076 {
13077 return ConfigGetFloat("heatIsolation");
13078 }
13079
13081 {
13083 }
13084
13086 {
13087 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13088 if (
GetGame().ConfigIsExisting(paramPath))
13090
13091 return 0.0;
13092 }
13093
13095 {
13096 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13097 if (
GetGame().ConfigIsExisting(paramPath))
13099
13100 return 0.0;
13101 }
13102
13103 override void SetWet(
float value,
bool allow_client =
false)
13104 {
13105 if (!IsServerCheck(allow_client))
13106 return;
13107
13110
13112
13113 m_VarWet = Math.Clamp(value, min, max);
13114
13116 {
13119 }
13120 }
13121
13122 override void AddWet(
float value)
13123 {
13125 }
13126
13128 {
13130 }
13131
13133 {
13135 }
13136
13138 {
13140 }
13141
13143 {
13145 }
13146
13148 {
13150 }
13151
13152 override void OnWetChanged(
float newVal,
float oldVal)
13153 {
13156 if (newLevel != oldLevel)
13157 {
13159 }
13160 }
13161
13163 {
13164 SetWeightDirty();
13165 }
13166
13168 {
13169 return GetWetLevelInternal(
m_VarWet);
13170 }
13171
13172
13173
13175 {
13177 }
13178
13180 {
13182 }
13183
13185 {
13187 }
13188
13190 {
13192 }
13193
13194
13195
13197 {
13198 if (ConfigIsExisting("itemModelLength"))
13199 {
13200 return ConfigGetFloat("itemModelLength");
13201 }
13202 return 0;
13203 }
13204
13206 {
13207 if (ConfigIsExisting("itemAttachOffset"))
13208 {
13209 return ConfigGetFloat("itemAttachOffset");
13210 }
13211 return 0;
13212 }
13213
13214 override void SetCleanness(
int value,
bool allow_client =
false)
13215 {
13216 if (!IsServerCheck(allow_client))
13217 return;
13218
13220
13222
13225 }
13226
13228 {
13230 }
13231
13233 {
13234 return true;
13235 }
13236
13237
13238
13239
13241 {
13243 }
13244
13246 {
13248 }
13249
13250
13251
13252
13253 override void SetColor(
int r,
int g,
int b,
int a)
13254 {
13260 }
13262 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13263 {
13268 }
13269
13271 {
13273 }
13274
13277 {
13278 int r,g,b,a;
13280 r = r/255;
13281 g = g/255;
13282 b = b/255;
13283 a = a/255;
13284 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13285 }
13286
13287
13288
13289 override void SetLiquidType(
int value,
bool allow_client =
false)
13290 {
13291 if (!IsServerCheck(allow_client))
13292 return;
13293
13298 }
13299
13301 {
13302 return ConfigGetInt("varLiquidTypeInit");
13303 }
13304
13306 {
13308 }
13309
13311 {
13313 SetFrozen(false);
13314 }
13315
13318 {
13319 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13320 }
13321
13322
13325 {
13326 PlayerBase nplayer;
13327 if (PlayerBase.CastTo(nplayer, player))
13328 {
13330
13331 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13332 }
13333 }
13334
13335
13338 {
13339 PlayerBase nplayer;
13340 if (PlayerBase.CastTo(nplayer,player))
13341 {
13342
13343 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13344
13345 }
13346
13347
13348 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13349
13350
13351 if (HasEnergyManager())
13352 {
13353 GetCompEM().UpdatePlugState();
13354 }
13355 }
13356
13357
13359 {
13360 super.OnPlacementStarted(player);
13361
13363 }
13364
13365 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13366 {
13368 {
13369 m_AdminLog.OnPlacementComplete(player,
this);
13370 }
13371
13372 super.OnPlacementComplete(player, position, orientation);
13373 }
13374
13375
13376
13377
13378
13380 {
13382 {
13383 return true;
13384 }
13385 else
13386 {
13387 return false;
13388 }
13389 }
13390
13391
13393 {
13395 {
13397 }
13398 }
13399
13400
13402 {
13404 }
13405
13407 {
13409 }
13410
13411 override void InsertAgent(
int agent,
float count = 1)
13412 {
13413 if (count < 1)
13414 return;
13415
13417 }
13418
13421 {
13423 }
13424
13425
13427 {
13429 }
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13473 {
13475 return false;
13476 return true;
13477 }
13478
13480 {
13481
13483 }
13484
13485
13488 {
13489 super.CheckForRoofLimited(timeTresholdMS);
13490
13492 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13493 {
13494 m_PreviousRoofTestTime = time;
13495 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13496 }
13497 }
13498
13499
13501 {
13503 {
13504 return 0;
13505 }
13506
13507 if (GetInventory().GetAttachmentSlotsCount() != 0)
13508 {
13509 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13510 if (filter)
13511 return filter.GetProtectionLevel(type, false, system);
13512 else
13513 return 0;
13514 }
13515
13516 string subclassPath, entryName;
13517
13518 switch (type)
13519 {
13521 entryName = "biological";
13522 break;
13524 entryName = "chemical";
13525 break;
13526 default:
13527 entryName = "biological";
13528 break;
13529 }
13530
13531 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13532
13534 }
13535
13536
13537
13540 {
13541 if (!IsMagazine())
13543
13545 }
13546
13547
13548
13549
13550
13555 {
13556 return true;
13557 }
13558
13560 {
13562 }
13563
13564
13565
13566
13567
13569 {
13570 if (parent)
13571 {
13572 if (parent.IsInherited(DayZInfected))
13573 return true;
13574
13575 if (!parent.IsRuined())
13576 return true;
13577 }
13578
13579 return true;
13580 }
13581
13583 {
13584 if (!super.CanPutAsAttachment(parent))
13585 {
13586 return false;
13587 }
13588
13589 if (!IsRuined() && !parent.IsRuined())
13590 {
13591 return true;
13592 }
13593
13594 return false;
13595 }
13596
13598 {
13599
13600
13601
13602
13603 return super.CanReceiveItemIntoCargo(item);
13604 }
13605
13607 {
13608
13609
13610
13611
13612 GameInventory attachmentInv = attachment.GetInventory();
13614 {
13615 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13616 return false;
13617 }
13618
13619 InventoryLocation loc = new InventoryLocation();
13620 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13621 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13622 return false;
13623
13624 return super.CanReceiveAttachment(attachment, slotId);
13625 }
13626
13628 {
13629 if (!super.CanReleaseAttachment(attachment))
13630 return false;
13631
13632 return GetInventory().AreChildrenAccessible();
13633 }
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13656 {
13657 int id = muzzle_owner.GetMuzzleID();
13658 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13659
13660 if (WPOF_array)
13661 {
13662 for (int i = 0; i < WPOF_array.Count(); i++)
13663 {
13664 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13665
13666 if (WPOF)
13667 {
13668 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13669 }
13670 }
13671 }
13672 }
13673
13674
13676 {
13677 int id = muzzle_owner.GetMuzzleID();
13679
13680 if (WPOBE_array)
13681 {
13682 for (int i = 0; i < WPOBE_array.Count(); i++)
13683 {
13684 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13685
13686 if (WPOBE)
13687 {
13688 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13689 }
13690 }
13691 }
13692 }
13693
13694
13696 {
13697 int id = muzzle_owner.GetMuzzleID();
13698 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13699
13700 if (WPOOH_array)
13701 {
13702 for (int i = 0; i < WPOOH_array.Count(); i++)
13703 {
13704 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13705
13706 if (WPOOH)
13707 {
13708 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13709 }
13710 }
13711 }
13712 }
13713
13714
13716 {
13717 int id = muzzle_owner.GetMuzzleID();
13718 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13719
13720 if (WPOOH_array)
13721 {
13722 for (int i = 0; i < WPOOH_array.Count(); i++)
13723 {
13724 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13725
13726 if (WPOOH)
13727 {
13728 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13729 }
13730 }
13731 }
13732 }
13733
13734
13736 {
13737 int id = muzzle_owner.GetMuzzleID();
13738 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13739
13740 if (WPOOH_array)
13741 {
13742 for (int i = 0; i < WPOOH_array.Count(); i++)
13743 {
13744 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13745
13746 if (WPOOH)
13747 {
13748 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13749 }
13750 }
13751 }
13752 }
13753
13754
13755
13757 {
13759 {
13760 return true;
13761 }
13762
13763 return false;
13764 }
13765
13767 {
13769 {
13770 return true;
13771 }
13772
13773 return false;
13774 }
13775
13777 {
13779 {
13780 return true;
13781 }
13782
13783 return false;
13784 }
13785
13787 {
13788 return false;
13789 }
13790
13793 {
13794 return UATimeSpent.DEFAULT_DEPLOY;
13795 }
13796
13797
13798
13799
13801 {
13803 SetSynchDirty();
13804 }
13805
13807 {
13809 }
13810
13811
13813 {
13814 return false;
13815 }
13816
13819 {
13820 string att_type = "None";
13821
13822 if (ConfigIsExisting("soundAttType"))
13823 {
13824 att_type = ConfigGetString("soundAttType");
13825 }
13826
13828 }
13829
13831 {
13833 }
13834
13835
13836
13837
13838
13844
13846 {
13849
13851 }
13852
13853
13855 {
13857 return;
13858
13860
13863
13866
13867 SoundParameters params = new SoundParameters();
13871 }
13872
13873
13875 {
13877 return;
13878
13880 SetSynchDirty();
13881
13884 }
13885
13886
13888 {
13890 return;
13891
13893 SetSynchDirty();
13894
13897 }
13898
13900 {
13902 }
13903
13905 {
13907 }
13908
13911 {
13912 if (!
GetGame().IsDedicatedServer())
13913 {
13914 if (ConfigIsExisting("attachSoundSet"))
13915 {
13916 string cfg_path = "";
13917 string soundset = "";
13918 string type_name =
GetType();
13919
13922 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13923 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13924
13925 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13926 {
13927 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13928 {
13929 if (cfg_slot_array[i] == slot_type)
13930 {
13931 soundset = cfg_soundset_array[i];
13932 break;
13933 }
13934 }
13935 }
13936
13937 if (soundset != "")
13938 {
13939 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13941 }
13942 }
13943 }
13944 }
13945
13947 {
13948
13949 }
13950
13951 void OnApply(PlayerBase player);
13952
13954 {
13955 return 1.0;
13956 };
13957
13959 {
13961 }
13962
13964 {
13966 }
13967
13969
13971 {
13972 SetDynamicPhysicsLifeTime(0.01);
13974 }
13975
13977 {
13978 array<string> zone_names = new array<string>;
13979 GetDamageZones(zone_names);
13980 for (int i = 0; i < zone_names.Count(); i++)
13981 {
13982 SetHealthMax(zone_names.Get(i),"Health");
13983 }
13984 SetHealthMax("","Health");
13985 }
13986
13989 {
13990 float global_health = GetHealth01("","Health");
13991 array<string> zones = new array<string>;
13992 GetDamageZones(zones);
13993
13994 for (int i = 0; i < zones.Count(); i++)
13995 {
13996 SetHealth01(zones.Get(i),"Health",global_health);
13997 }
13998 }
13999
14002 {
14003 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14004 }
14005
14007 {
14008 if (!hasRootAsPlayer)
14009 {
14010 if (refParentIB)
14011 {
14012
14013 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14014 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14015
14016 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14017 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14018
14021 }
14022 else
14023 {
14024
14027 }
14028 }
14029 }
14030
14032 {
14034 {
14035 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14036 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14037 {
14038 float heatPermCoef = 1.0;
14040 while (ent)
14041 {
14042 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14043 ent = ent.GetHierarchyParent();
14044 }
14045
14046 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14047 }
14048 }
14049 }
14050
14052 {
14053
14054 EntityAI parent = GetHierarchyParent();
14055 if (!parent)
14056 {
14057 hasParent = false;
14058 hasRootAsPlayer = false;
14059 }
14060 else
14061 {
14062 hasParent = true;
14063 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14064 refParentIB =
ItemBase.Cast(parent);
14065 }
14066 }
14067
14068 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14069 {
14070
14071 }
14072
14074 {
14075
14076 return false;
14077 }
14078
14080 {
14081
14082
14083 return false;
14084 }
14085
14087 {
14088
14089 return false;
14090 }
14091
14094 {
14095 return !GetIsFrozen() &&
IsOpen();
14096 }
14097
14099 {
14100 bool hasParent = false, hasRootAsPlayer = false;
14102
14103 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14104 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14105
14106 if (wwtu || foodDecay)
14107 {
14111
14112 if (processWetness || processTemperature || processDecay)
14113 {
14115
14116 if (processWetness)
14117 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14118
14119 if (processTemperature)
14121
14122 if (processDecay)
14123 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14124 }
14125 }
14126 }
14127
14130 {
14132 }
14133
14135 {
14138
14139 return super.GetTemperatureFreezeThreshold();
14140 }
14141
14143 {
14146
14147 return super.GetTemperatureThawThreshold();
14148 }
14149
14151 {
14154
14155 return super.GetItemOverheatThreshold();
14156 }
14157
14159 {
14161 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14162
14163 return super.GetTemperatureFreezeTime();
14164 }
14165
14167 {
14169 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14170
14171 return super.GetTemperatureThawTime();
14172 }
14173
14178
14180 {
14181 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14182 }
14183
14185 {
14186 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14187 }
14188
14191 {
14193 }
14194
14196 {
14198 }
14199
14201 {
14203 }
14204
14207 {
14208 return null;
14209 }
14210
14213 {
14214 return false;
14215 }
14216
14218 {
14220 {
14223 if (!trg)
14224 {
14226 explosive = this;
14227 }
14228
14229 explosive.PairRemote(trg);
14231
14232 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14233 trg.SetPersistentPairID(persistentID);
14234 explosive.SetPersistentPairID(persistentID);
14235
14236 return true;
14237 }
14238 return false;
14239 }
14240
14243 {
14244 float ret = 1.0;
14247 ret *= GetHealth01();
14248
14249 return ret;
14250 }
14251
14252 #ifdef DEVELOPER
14253 override void SetDebugItem()
14254 {
14255 super.SetDebugItem();
14256 _itemBase = this;
14257 }
14258
14260 {
14261 string text = super.GetDebugText();
14262
14264 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14265
14266 return text;
14267 }
14268 #endif
14269
14271 {
14272 return true;
14273 }
14274
14276
14278
14280 {
14283 }
14284
14285
14293
14309}
14310
14312{
14314 if (entity)
14315 {
14316 bool is_item = entity.IsInherited(
ItemBase);
14317 if (is_item && full_quantity)
14318 {
14321 }
14322 }
14323 else
14324 {
14326 return NULL;
14327 }
14328 return entity;
14329}
14330
14332{
14333 if (item)
14334 {
14335 if (health > 0)
14336 item.SetHealth("", "", health);
14337
14338 if (item.CanHaveTemperature())
14339 {
14341 if (item.CanFreeze())
14342 item.SetFrozen(false);
14343 }
14344
14345 if (item.HasEnergyManager())
14346 {
14347 if (quantity >= 0)
14348 {
14349 item.GetCompEM().SetEnergy0To1(quantity);
14350 }
14351 else
14352 {
14354 }
14355 }
14356 else if (item.IsMagazine())
14357 {
14358 Magazine mag = Magazine.Cast(item);
14359 if (quantity >= 0)
14360 {
14361 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14362 }
14363 else
14364 {
14366 }
14367
14368 }
14369 else
14370 {
14371 if (quantity >= 0)
14372 {
14373 item.SetQuantityNormalized(quantity, false);
14374 }
14375 else
14376 {
14378 }
14379
14380 }
14381 }
14382}
14383
14384#ifdef DEVELOPER
14386#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.