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 {
11047 return;
11048
11050 {
11051 if (ScriptInputUserData.CanStoreInputUserData())
11052 {
11053 ScriptInputUserData ctx = new ScriptInputUserData;
11058 ctx.
Write(destination_entity);
11060 ctx.
Write(slot_id);
11062 }
11063 }
11064 else if (!
GetGame().IsMultiplayer())
11065 {
11067 }
11068 }
11069
11071 {
11073 return;
11074
11075 float split_quantity_new;
11079 InventoryLocation loc = new InventoryLocation;
11080
11081 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11082 {
11084 split_quantity_new = stack_max;
11085 else
11087
11088 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11089 if (new_item)
11090 {
11091 new_item.SetResultOfSplit(true);
11092 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11094 new_item.SetQuantity(split_quantity_new);
11095 }
11096 }
11097 else if (destination_entity && slot_id == -1)
11098 {
11099 if (quantity > stack_max)
11100 split_quantity_new = stack_max;
11101 else
11102 split_quantity_new = quantity;
11103
11105 {
11108 }
11109
11110 if (new_item)
11111 {
11112 new_item.SetResultOfSplit(true);
11113 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11115 new_item.SetQuantity(split_quantity_new);
11116 }
11117 }
11118 else
11119 {
11120 if (stack_max != 0)
11121 {
11123 {
11125 }
11126
11127 if (split_quantity_new == 0)
11128 {
11129 if (!
GetGame().IsMultiplayer())
11130 player.PhysicalPredictiveDropItem(this);
11131 else
11132 player.ServerDropEntity(this);
11133 return;
11134 }
11135
11137
11138 if (new_item)
11139 {
11140 new_item.SetResultOfSplit(true);
11141 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11143 new_item.SetQuantity(stack_max);
11144 new_item.PlaceOnSurface();
11145 }
11146 }
11147 }
11148 }
11149
11151 {
11153 return;
11154
11155 float split_quantity_new;
11159 InventoryLocation loc = new InventoryLocation;
11160
11161 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11162 {
11164 split_quantity_new = stack_max;
11165 else
11167
11168 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11169 if (new_item)
11170 {
11171 new_item.SetResultOfSplit(true);
11172 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11174 new_item.SetQuantity(split_quantity_new);
11175 }
11176 }
11177 else if (destination_entity && slot_id == -1)
11178 {
11179 if (quantity > stack_max)
11180 split_quantity_new = stack_max;
11181 else
11182 split_quantity_new = quantity;
11183
11185 {
11188 }
11189
11190 if (new_item)
11191 {
11192 new_item.SetResultOfSplit(true);
11193 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11195 new_item.SetQuantity(split_quantity_new);
11196 }
11197 }
11198 else
11199 {
11200 if (stack_max != 0)
11201 {
11203 {
11205 }
11206
11208
11209 if (new_item)
11210 {
11211 new_item.SetResultOfSplit(true);
11212 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11214 new_item.SetQuantity(stack_max);
11215 new_item.PlaceOnSurface();
11216 }
11217 }
11218 }
11219 }
11220
11222 {
11224 return;
11225
11227 {
11228 if (ScriptInputUserData.CanStoreInputUserData())
11229 {
11230 ScriptInputUserData ctx = new ScriptInputUserData;
11235 dst.WriteToContext(ctx);
11237 }
11238 }
11239 else if (!
GetGame().IsMultiplayer())
11240 {
11242 }
11243 }
11244
11246 {
11248 return;
11249
11251 {
11252 if (ScriptInputUserData.CanStoreInputUserData())
11253 {
11254 ScriptInputUserData ctx = new ScriptInputUserData;
11259 ctx.
Write(destination_entity);
11265 }
11266 }
11267 else if (!
GetGame().IsMultiplayer())
11268 {
11270 }
11271 }
11272
11274 {
11276 }
11277
11279 {
11281 return this;
11282
11284 float split_quantity_new;
11286 if (dst.IsValid())
11287 {
11288 int slot_id = dst.GetSlot();
11290
11291 if (quantity > stack_max)
11292 split_quantity_new = stack_max;
11293 else
11294 split_quantity_new = quantity;
11295
11297
11298 if (new_item)
11299 {
11300 new_item.SetResultOfSplit(true);
11301 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11304 }
11305
11306 return new_item;
11307 }
11308
11309 return null;
11310 }
11311
11313 {
11315 return;
11316
11318 float split_quantity_new;
11320 if (destination_entity)
11321 {
11323 if (quantity > stackable)
11324 split_quantity_new = stackable;
11325 else
11326 split_quantity_new = quantity;
11327
11328 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11329 if (new_item)
11330 {
11331 new_item.SetResultOfSplit(true);
11332 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11334 new_item.SetQuantity(split_quantity_new);
11335 }
11336 }
11337 }
11338
11340 {
11342 return;
11343
11345 {
11346 if (ScriptInputUserData.CanStoreInputUserData())
11347 {
11348 ScriptInputUserData ctx = new ScriptInputUserData;
11353 ItemBase destination_entity =
this;
11354 ctx.
Write(destination_entity);
11358 }
11359 }
11360 else if (!
GetGame().IsMultiplayer())
11361 {
11363 }
11364 }
11365
11367 {
11369 return;
11370
11372 float split_quantity_new;
11374 if (player)
11375 {
11377 if (quantity > stackable)
11378 split_quantity_new = stackable;
11379 else
11380 split_quantity_new = quantity;
11381
11382 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11383 new_item =
ItemBase.Cast(in_hands);
11384 if (new_item)
11385 {
11386 new_item.SetResultOfSplit(true);
11387 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11389 new_item.SetQuantity(split_quantity_new);
11390 }
11391 }
11392 }
11393
11395 {
11397 return;
11398
11400 float split_quantity_new = Math.Floor(quantity * 0.5);
11401
11403
11404 if (new_item)
11405 {
11406 if (new_item.GetQuantityMax() < split_quantity_new)
11407 {
11408 split_quantity_new = new_item.GetQuantityMax();
11409 }
11410
11411 new_item.SetResultOfSplit(true);
11412 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11413
11415 {
11418 }
11419 else
11420 {
11423 }
11424 }
11425 }
11426
11428 {
11430 return;
11431
11433 float split_quantity_new = Math.Floor(quantity / 2);
11434
11435 InventoryLocation invloc = new InventoryLocation;
11437
11439 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11440
11441 if (new_item)
11442 {
11443 if (new_item.GetQuantityMax() < split_quantity_new)
11444 {
11445 split_quantity_new = new_item.GetQuantityMax();
11446 }
11448 {
11451 }
11452 else
11453 {
11456 }
11457 }
11458 }
11459
11462 {
11463 SetWeightDirty();
11465
11466 if (parent)
11467 parent.OnAttachmentQuantityChangedEx(this, delta);
11468
11470 {
11472 {
11474 }
11476 {
11477 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11479 }
11480 }
11481
11482 }
11483
11486 {
11487
11488 }
11489
11492 {
11494 }
11495
11497 {
11498 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11499
11501 {
11502 if (newLevel == GameConstants.STATE_RUINED)
11503 {
11505 EntityAI parent = GetHierarchyParent();
11506 if (parent && parent.IsFireplace())
11507 {
11508 CargoBase cargo = GetInventory().GetCargo();
11509 if (cargo)
11510 {
11512 {
11514 }
11515 }
11516 }
11517 }
11518
11520 {
11521
11523 return;
11524 }
11525
11526 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11527 {
11529 }
11530 }
11531 }
11532
11533
11535 {
11536 super.OnRightClick();
11537
11539 {
11541 {
11542 if (ScriptInputUserData.CanStoreInputUserData())
11543 {
11544 vector m4[4];
11546
11547 EntityAI root = GetHierarchyRoot();
11548
11549 InventoryLocation dst = new InventoryLocation;
11551 {
11552 if (root)
11553 {
11554 root.GetTransform(m4);
11556 }
11557 else
11558 GetInventory().GetCurrentInventoryLocation(dst);
11559 }
11560 else
11561 {
11563
11564
11565 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11566 {
11567 if (root)
11568 {
11569 root.GetTransform(m4);
11571 }
11572 else
11573 GetInventory().GetCurrentInventoryLocation(dst);
11574 }
11575 else
11576 {
11577 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11578 }
11579 }
11580
11581 ScriptInputUserData ctx = new ScriptInputUserData;
11589 }
11590 }
11591 else if (!
GetGame().IsMultiplayer())
11592 {
11594 }
11595 }
11596 }
11597
11598 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11599 {
11600
11601 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11602 return false;
11603
11604 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11605 return false;
11606
11607
11609 return false;
11610
11611
11612 Magazine mag = Magazine.Cast(this);
11613 if (mag)
11614 {
11615 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11616 return false;
11617
11618 if (stack_max_limit)
11619 {
11620 Magazine other_mag = Magazine.Cast(other_item);
11621 if (other_item)
11622 {
11623 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11624 return false;
11625 }
11626
11627 }
11628 }
11629 else
11630 {
11631
11633 return false;
11634
11636 return false;
11637 }
11638
11639 PlayerBase player = null;
11640 if (CastTo(player, GetHierarchyRootPlayer()))
11641 {
11642 if (player.GetInventory().HasAttachment(this))
11643 return false;
11644
11645 if (player.IsItemsToDelete())
11646 return false;
11647 }
11648
11649 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11650 return false;
11651
11652 int slotID;
11654 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11655 return false;
11656
11657 return true;
11658 }
11659
11661 {
11663 }
11664
11666 {
11667 return m_IsResultOfSplit;
11668 }
11669
11671 {
11672 m_IsResultOfSplit = value;
11673 }
11674
11676 {
11678 }
11679
11681 {
11682 float other_item_quantity = other_item.GetQuantity();
11683 float this_free_space;
11684
11686
11688
11689 if (other_item_quantity > this_free_space)
11690 {
11691 return this_free_space;
11692 }
11693 else
11694 {
11695 return other_item_quantity;
11696 }
11697 }
11698
11700 {
11702 }
11703
11705 {
11707 return;
11708
11709 if (!IsMagazine() && other_item)
11710 {
11712 if (quantity_used != 0)
11713 {
11714 float hp1 = GetHealth01("","");
11715 float hp2 = other_item.GetHealth01("","");
11716 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11717 hpResult = hpResult / (
GetQuantity() + quantity_used);
11718
11719 hpResult *= GetMaxHealth();
11720 Math.Round(hpResult);
11721 SetHealth("", "Health", hpResult);
11722
11724 other_item.AddQuantity(-quantity_used);
11725 }
11726 }
11728 }
11729
11731 {
11732 #ifdef SERVER
11733 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11734 GetHierarchyParent().IncreaseLifetimeUp();
11735 #endif
11736 };
11737
11739 {
11740 PlayerBase p = PlayerBase.Cast(player);
11741
11742 array<int> recipesIds = p.m_Recipes;
11743 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11744 if (moduleRecipesManager)
11745 {
11746 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11747 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11748 }
11749
11750 for (int i = 0;i < recipesIds.Count(); i++)
11751 {
11752 int key = recipesIds.Get(i);
11753 string recipeName = moduleRecipesManager.GetRecipeName(key);
11755 }
11756 }
11757
11758
11759 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11760 {
11761 super.GetDebugActions(outputList);
11762
11763
11768
11769
11773
11777
11778
11781
11782
11784 {
11787 }
11788
11790
11793
11797 }
11798
11799
11800
11801
11803 {
11804 super.OnAction(action_id, player, ctx);
11805 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11806 {
11807 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11808 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11809 PlayerBase p = PlayerBase.Cast(player);
11810 if (
EActions.RECIPES_RANGE_START < 1000)
11811 {
11812 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11813 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11814 }
11815 }
11816 #ifndef SERVER
11817 else if (action_id ==
EActions.WATCH_PLAYER)
11818 {
11819 PluginDeveloper.SetDeveloperItemClientEx(player);
11820 }
11821 #endif
11823 {
11824 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11825 {
11826 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11827 OnDebugButtonPressServer(id + 1);
11828 }
11829
11830 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11831 {
11832 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11834 }
11835
11836 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11837 {
11838 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11840 }
11841
11842 else if (action_id ==
EActions.ADD_QUANTITY)
11843 {
11844 if (IsMagazine())
11845 {
11846 Magazine mag = Magazine.Cast(this);
11847 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11848 }
11849 else
11850 {
11852 }
11853
11854 if (m_EM)
11855 {
11856 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11857 }
11858
11859 }
11860
11861 else if (action_id ==
EActions.REMOVE_QUANTITY)
11862 {
11863 if (IsMagazine())
11864 {
11865 Magazine mag2 = Magazine.Cast(this);
11866 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11867 }
11868 else
11869 {
11871 }
11872 if (m_EM)
11873 {
11874 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11875 }
11876
11877 }
11878
11879 else if (action_id ==
EActions.SET_QUANTITY_0)
11880 {
11882
11883 if (m_EM)
11884 {
11885 m_EM.SetEnergy(0);
11886 }
11887 }
11888
11889 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11890 {
11892
11893 if (m_EM)
11894 {
11895 m_EM.SetEnergy(m_EM.GetEnergyMax());
11896 }
11897 }
11898
11899 else if (action_id ==
EActions.ADD_HEALTH)
11900 {
11901 AddHealth("","",GetMaxHealth("","Health")/5);
11902 }
11903 else if (action_id ==
EActions.REMOVE_HEALTH)
11904 {
11905 AddHealth("","",-GetMaxHealth("","Health")/5);
11906 }
11907 else if (action_id ==
EActions.DESTROY_HEALTH)
11908 {
11909 SetHealth01("","",0);
11910 }
11911 else if (action_id ==
EActions.WATCH_ITEM)
11912 {
11914 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11915 #ifdef DEVELOPER
11916 SetDebugDeveloper_item(this);
11917 #endif
11918 }
11919
11920 else if (action_id ==
EActions.ADD_TEMPERATURE)
11921 {
11922 AddTemperature(20);
11923
11924 }
11925
11926 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11927 {
11928 AddTemperature(-20);
11929
11930 }
11931
11932 else if (action_id ==
EActions.FLIP_FROZEN)
11933 {
11934 SetFrozen(!GetIsFrozen());
11935
11936 }
11937
11938 else if (action_id ==
EActions.ADD_WETNESS)
11939 {
11941
11942 }
11943
11944 else if (action_id ==
EActions.REMOVE_WETNESS)
11945 {
11947
11948 }
11949
11950 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11951 {
11954
11955
11956 }
11957
11958 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11959 {
11962 }
11963
11964 else if (action_id ==
EActions.MAKE_SPECIAL)
11965 {
11966 auto debugParams = DebugSpawnParams.WithPlayer(player);
11967 OnDebugSpawnEx(debugParams);
11968 }
11969
11970 else if (action_id ==
EActions.DELETE)
11971 {
11972 Delete();
11973 }
11974
11975 }
11976
11977
11978 return false;
11979 }
11980
11981
11982
11983
11987
11990
11991
11992
11994 {
11995 return false;
11996 }
11997
11998
12000 {
12001 return true;
12002 }
12003
12004
12006 {
12007 return true;
12008 }
12009
12010
12011
12013 {
12014 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12016 }
12017
12020 {
12021 return null;
12022 }
12023
12025 {
12026 return false;
12027 }
12028
12030 {
12031 return false;
12032 }
12033
12037
12038
12040 {
12041 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12042 return module_repairing.CanRepair(this, item_repair_kit);
12043 }
12044
12045
12046 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12047 {
12048 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12049 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12050 }
12051
12052
12054 {
12055
12056
12057
12058
12059
12060
12061
12062
12063 return 1;
12064 }
12065
12066
12067
12069 {
12071 }
12072
12073
12074
12076 {
12078 }
12079
12080
12089 {
12090 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12091
12092 if (player)
12093 {
12094 player.MessageStatus(text);
12095 }
12096 }
12097
12098
12107 {
12108 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12109
12110 if (player)
12111 {
12112 player.MessageAction(text);
12113 }
12114 }
12115
12116
12125 {
12126 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12127
12128 if (player)
12129 {
12130 player.MessageFriendly(text);
12131 }
12132 }
12133
12134
12143 {
12144 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12145
12146 if (player)
12147 {
12148 player.MessageImportant(text);
12149 }
12150 }
12151
12153 {
12154 return true;
12155 }
12156
12157
12158 override bool KindOf(
string tag)
12159 {
12160 bool found = false;
12161 string item_name = this.
GetType();
12164
12165 int array_size = item_tag_array.Count();
12166 for (int i = 0; i < array_size; i++)
12167 {
12168 if (item_tag_array.Get(i) == tag)
12169 {
12170 found = true;
12171 break;
12172 }
12173 }
12174 return found;
12175 }
12176
12177
12179 {
12180
12181 super.OnRPC(sender, rpc_type,ctx);
12182
12183
12184 switch (rpc_type)
12185 {
12186 #ifndef SERVER
12187 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12188 Param2<bool, string> p = new Param2<bool, string>(false, "");
12189
12191 return;
12192
12193 bool play = p.param1;
12194 string soundSet = p.param2;
12195
12196 if (play)
12197 {
12199 {
12201 {
12203 }
12204 }
12205 else
12206 {
12208 }
12209 }
12210 else
12211 {
12213 }
12214
12215 break;
12216 #endif
12217
12218 }
12219
12221 {
12223 }
12224 }
12225
12226
12227
12228
12230 {
12231 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12232 return plugin.GetID(
name);
12233 }
12234
12236 {
12237 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12238 return plugin.GetName(id);
12239 }
12240
12243 {
12244
12245
12246 int varFlags;
12247 if (!ctx.
Read(varFlags))
12248 return;
12249
12250 if (varFlags & ItemVariableFlags.FLOAT)
12251 {
12253 }
12254 }
12255
12257 {
12258
12259 super.SerializeNumericalVars(floats_out);
12260
12261
12262
12264 {
12266 }
12267
12269 {
12271 }
12272
12274 {
12276 }
12277
12279 {
12284 }
12285
12287 {
12289 }
12290 }
12291
12293 {
12294
12295 super.DeSerializeNumericalVars(floats);
12296
12297
12298 int index = 0;
12299 int mask = Math.Round(floats.Get(index));
12300
12301 index++;
12302
12304 {
12306 {
12308 }
12309 else
12310 {
12311 float quantity = floats.Get(index);
12312 SetQuantity(quantity,
true,
false,
false,
false);
12313 }
12314 index++;
12315 }
12316
12318 {
12319 float wet = floats.Get(index);
12321 index++;
12322 }
12323
12325 {
12326 int liquidtype = Math.Round(floats.Get(index));
12328 index++;
12329 }
12330
12332 {
12334 index++;
12336 index++;
12338 index++;
12340 index++;
12341 }
12342
12344 {
12345 int cleanness = Math.Round(floats.Get(index));
12347 index++;
12348 }
12349 }
12350
12352 {
12353 super.WriteVarsToCTX(ctx);
12354
12355
12357 {
12359 }
12360
12362 {
12364 }
12365
12367 {
12369 }
12370
12372 {
12373 int r,g,b,a;
12379 }
12380
12382 {
12384 }
12385 }
12386
12388 {
12389 if (!super.ReadVarsFromCTX(ctx,version))
12390 return false;
12391
12392 int intValue;
12393 float value;
12394
12395 if (version < 140)
12396 {
12397 if (!ctx.
Read(intValue))
12398 return false;
12399
12400 m_VariablesMask = intValue;
12401 }
12402
12404 {
12405 if (!ctx.
Read(value))
12406 return false;
12407
12409 {
12411 }
12412 else
12413 {
12415 }
12416 }
12417
12418 if (version < 140)
12419 {
12421 {
12422 if (!ctx.
Read(value))
12423 return false;
12424 SetTemperatureDirect(value);
12425 }
12426 }
12427
12429 {
12430 if (!ctx.
Read(value))
12431 return false;
12433 }
12434
12436 {
12437 if (!ctx.
Read(intValue))
12438 return false;
12440 }
12441
12443 {
12444 int r,g,b,a;
12446 return false;
12448 return false;
12450 return false;
12452 return false;
12453
12455 }
12456
12458 {
12459 if (!ctx.
Read(intValue))
12460 return false;
12462 }
12463
12464 if (version >= 138 && version < 140)
12465 {
12467 {
12468 if (!ctx.
Read(intValue))
12469 return false;
12470 SetFrozen(intValue);
12471 }
12472 }
12473
12474 return true;
12475 }
12476
12477
12479 {
12482 {
12484 }
12485
12486 if (!super.OnStoreLoad(ctx, version))
12487 {
12489 return false;
12490 }
12491
12492 if (version >= 114)
12493 {
12494 bool hasQuickBarIndexSaved;
12495
12496 if (!ctx.
Read(hasQuickBarIndexSaved))
12497 {
12499 return false;
12500 }
12501
12502 if (hasQuickBarIndexSaved)
12503 {
12504 int itmQBIndex;
12505
12506
12507 if (!ctx.
Read(itmQBIndex))
12508 {
12510 return false;
12511 }
12512
12513 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12514 if (itmQBIndex != -1 && parentPlayer)
12515 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12516 }
12517 }
12518 else
12519 {
12520
12521 PlayerBase player;
12522 int itemQBIndex;
12523 if (version ==
int.
MAX)
12524 {
12525 if (!ctx.
Read(itemQBIndex))
12526 {
12528 return false;
12529 }
12530 }
12531 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12532 {
12533
12534 if (!ctx.
Read(itemQBIndex))
12535 {
12537 return false;
12538 }
12539 if (itemQBIndex != -1 && player)
12540 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12541 }
12542 }
12543
12544 if (version < 140)
12545 {
12546
12547 if (!LoadVariables(ctx, version))
12548 {
12550 return false;
12551 }
12552 }
12553
12554
12556 {
12558 return false;
12559 }
12560 if (version >= 132)
12561 {
12563 if (raib)
12564 {
12566 {
12568 return false;
12569 }
12570 }
12571 }
12572
12574 return true;
12575 }
12576
12577
12578
12580 {
12581 super.OnStoreSave(ctx);
12582
12583 PlayerBase player;
12584 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12585 {
12587
12588 int itemQBIndex = -1;
12589 itemQBIndex = player.FindQuickBarEntityIndex(this);
12590 ctx.
Write(itemQBIndex);
12591 }
12592 else
12593 {
12595 }
12596
12598
12600 if (raib)
12601 {
12603 }
12604 }
12605
12606
12608 {
12609 super.AfterStoreLoad();
12610
12612 {
12614 }
12615
12617 {
12620 }
12621 }
12622
12624 {
12625 super.EEOnAfterLoad();
12626
12628 {
12630 }
12631
12634 }
12635
12637 {
12638 return false;
12639 }
12640
12641
12642
12644 {
12646 {
12647 #ifdef PLATFORM_CONSOLE
12648
12650 {
12652 if (menu)
12653 {
12655 }
12656 }
12657 #endif
12658 }
12659
12661 {
12664 }
12665
12667 {
12668 SetWeightDirty();
12670 }
12672 {
12675 }
12676
12678 {
12681 }
12683 {
12686 }
12687
12688 super.OnVariablesSynchronized();
12689 }
12690
12691
12692
12694 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12695 {
12696 if (!IsServerCheck(allow_client))
12697 return false;
12698
12700 return false;
12701
12704
12705 if (value <= (min + 0.001))
12706 value = min;
12707
12708 if (value == min)
12709 {
12710 if (destroy_config)
12711 {
12712 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12713 if (dstr)
12714 {
12716 this.Delete();
12717 return true;
12718 }
12719 }
12720 else if (destroy_forced)
12721 {
12723 this.Delete();
12724 return true;
12725 }
12726
12728 }
12729
12732
12734 {
12736
12737 if (delta)
12739 }
12740
12742
12743 return false;
12744 }
12745
12746
12748 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12749 {
12751 }
12752
12754 {
12757 }
12758
12760 {
12763 }
12764
12767 {
12768 float value_clamped = Math.Clamp(value, 0, 1);
12770 SetQuantity(result, destroy_config, destroy_forced);
12771 }
12772
12773
12776 {
12778 }
12779
12781 {
12783 }
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12795 {
12796 int slot = -1;
12797 if (GetInventory())
12798 {
12799 InventoryLocation il = new InventoryLocation;
12800 GetInventory().GetCurrentInventoryLocation(il);
12802 }
12803
12805 }
12806
12808 {
12809 float quantity_max = 0;
12810
12812 {
12813 if (attSlotID != -1)
12814 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12815
12816 if (quantity_max <= 0)
12818 }
12819
12820 if (quantity_max <= 0)
12822
12823 return quantity_max;
12824 }
12825
12827 {
12829 }
12830
12832 {
12834 }
12835
12836
12838 {
12840 }
12841
12843 {
12845 }
12846
12848 {
12850 }
12851
12852
12854 {
12855
12856 float weightEx = GetWeightEx();
12857 float special = GetInventoryAndCargoWeight();
12858 return weightEx - special;
12859 }
12860
12861
12863 {
12865 }
12866
12868 {
12870 {
12871 #ifdef DEVELOPER
12872 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12873 {
12874 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12876 }
12877 #endif
12878
12879 return GetQuantity() * GetConfigWeightModified();
12880 }
12881 else if (HasEnergyManager())
12882 {
12883 #ifdef DEVELOPER
12884 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12885 {
12886 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12887 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12888 }
12889 #endif
12890 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12891 }
12892 else
12893 {
12894 #ifdef DEVELOPER
12895 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12896 {
12897 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12898 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12899 }
12900 #endif
12901 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12902 }
12903 }
12904
12907 {
12908 int item_count = 0;
12910
12911 if (GetInventory().GetCargo() != NULL)
12912 {
12913 item_count = GetInventory().GetCargo().GetItemCount();
12914 }
12915
12916 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12917 {
12918 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12919 if (item)
12920 item_count += item.GetNumberOfItems();
12921 }
12922 return item_count;
12923 }
12924
12927 {
12928 float weight = 0;
12929 float wetness = 1;
12930 if (include_wetness)
12933 {
12934 weight = wetness * m_ConfigWeight;
12935 }
12937 {
12938 weight = 1;
12939 }
12940 return weight;
12941 }
12942
12943
12944
12946 {
12947 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12948 {
12949 GameInventory inv = GetInventory();
12950 array<EntityAI> items = new array<EntityAI>;
12952 for (int i = 0; i < items.Count(); i++)
12953 {
12955 if (item)
12956 {
12958 }
12959 }
12960 }
12961 }
12962
12963
12964
12965
12967 {
12968 float energy = 0;
12969 if (HasEnergyManager())
12970 {
12971 energy = GetCompEM().GetEnergy();
12972 }
12973 return energy;
12974 }
12975
12976
12978 {
12979 super.OnEnergyConsumed();
12980
12982 }
12983
12985 {
12986 super.OnEnergyAdded();
12987
12989 }
12990
12991
12993 {
12994 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12995 {
12997 {
12998 float energy_0to1 = GetCompEM().GetEnergy0To1();
13000 }
13001 }
13002 }
13003
13004
13006 {
13007 return ConfigGetFloat("heatIsolation");
13008 }
13009
13011 {
13013 }
13014
13016 {
13017 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13018 if (
GetGame().ConfigIsExisting(paramPath))
13020
13021 return 0.0;
13022 }
13023
13025 {
13026 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13027 if (
GetGame().ConfigIsExisting(paramPath))
13029
13030 return 0.0;
13031 }
13032
13033 override void SetWet(
float value,
bool allow_client =
false)
13034 {
13035 if (!IsServerCheck(allow_client))
13036 return;
13037
13040
13042
13043 m_VarWet = Math.Clamp(value, min, max);
13044
13046 {
13049 }
13050 }
13051
13052 override void AddWet(
float value)
13053 {
13055 }
13056
13058 {
13060 }
13061
13063 {
13065 }
13066
13068 {
13070 }
13071
13073 {
13075 }
13076
13078 {
13080 }
13081
13082 override void OnWetChanged(
float newVal,
float oldVal)
13083 {
13086 if (newLevel != oldLevel)
13087 {
13089 }
13090 }
13091
13093 {
13094 SetWeightDirty();
13095 }
13096
13098 {
13099 return GetWetLevelInternal(
m_VarWet);
13100 }
13101
13102
13103
13105 {
13107 }
13108
13110 {
13112 }
13113
13115 {
13117 }
13118
13120 {
13122 }
13123
13124
13125
13127 {
13128 if (ConfigIsExisting("itemModelLength"))
13129 {
13130 return ConfigGetFloat("itemModelLength");
13131 }
13132 return 0;
13133 }
13134
13136 {
13137 if (ConfigIsExisting("itemAttachOffset"))
13138 {
13139 return ConfigGetFloat("itemAttachOffset");
13140 }
13141 return 0;
13142 }
13143
13144 override void SetCleanness(
int value,
bool allow_client =
false)
13145 {
13146 if (!IsServerCheck(allow_client))
13147 return;
13148
13150
13152
13155 }
13156
13158 {
13160 }
13161
13163 {
13164 return true;
13165 }
13166
13167
13168
13169
13171 {
13173 }
13174
13176 {
13178 }
13179
13180
13181
13182
13183 override void SetColor(
int r,
int g,
int b,
int a)
13184 {
13190 }
13192 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13193 {
13198 }
13199
13201 {
13203 }
13204
13207 {
13208 int r,g,b,a;
13210 r = r/255;
13211 g = g/255;
13212 b = b/255;
13213 a = a/255;
13214 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13215 }
13216
13217
13218
13219 override void SetLiquidType(
int value,
bool allow_client =
false)
13220 {
13221 if (!IsServerCheck(allow_client))
13222 return;
13223
13228 }
13229
13231 {
13232 return ConfigGetInt("varLiquidTypeInit");
13233 }
13234
13236 {
13238 }
13239
13241 {
13243 SetFrozen(false);
13244 }
13245
13248 {
13249 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13250 }
13251
13252
13255 {
13256 PlayerBase nplayer;
13257 if (PlayerBase.CastTo(nplayer, player))
13258 {
13260
13261 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13262 }
13263 }
13264
13265
13268 {
13269 PlayerBase nplayer;
13270 if (PlayerBase.CastTo(nplayer,player))
13271 {
13272
13273 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13274
13275 }
13276
13277
13278 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13279
13280
13281 if (HasEnergyManager())
13282 {
13283 GetCompEM().UpdatePlugState();
13284 }
13285 }
13286
13287
13289 {
13290 super.OnPlacementStarted(player);
13291
13293 }
13294
13295 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13296 {
13298 {
13299 m_AdminLog.OnPlacementComplete(player,
this);
13300 }
13301
13302 super.OnPlacementComplete(player, position, orientation);
13303 }
13304
13305
13306
13307
13308
13310 {
13312 {
13313 return true;
13314 }
13315 else
13316 {
13317 return false;
13318 }
13319 }
13320
13321
13323 {
13325 {
13327 }
13328 }
13329
13330
13332 {
13334 }
13335
13337 {
13339 }
13340
13341 override void InsertAgent(
int agent,
float count = 1)
13342 {
13343 if (count < 1)
13344 return;
13345
13347 }
13348
13351 {
13353 }
13354
13355
13357 {
13359 }
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13403 {
13405 return false;
13406 return true;
13407 }
13408
13410 {
13411
13413 }
13414
13415
13418 {
13419 super.CheckForRoofLimited(timeTresholdMS);
13420
13422 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13423 {
13424 m_PreviousRoofTestTime = time;
13425 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13426 }
13427 }
13428
13429
13431 {
13433 {
13434 return 0;
13435 }
13436
13437 if (GetInventory().GetAttachmentSlotsCount() != 0)
13438 {
13439 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13440 if (filter)
13441 return filter.GetProtectionLevel(type, false, system);
13442 else
13443 return 0;
13444 }
13445
13446 string subclassPath, entryName;
13447
13448 switch (type)
13449 {
13451 entryName = "biological";
13452 break;
13454 entryName = "chemical";
13455 break;
13456 default:
13457 entryName = "biological";
13458 break;
13459 }
13460
13461 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13462
13464 }
13465
13466
13467
13470 {
13471 if (!IsMagazine())
13473
13475 }
13476
13477
13478
13479
13480
13485 {
13486 return true;
13487 }
13488
13490 {
13492 }
13493
13494
13495
13496
13497
13499 {
13500 if (parent)
13501 {
13502 if (parent.IsInherited(DayZInfected))
13503 return true;
13504
13505 if (!parent.IsRuined())
13506 return true;
13507 }
13508
13509 return true;
13510 }
13511
13513 {
13514 if (!super.CanPutAsAttachment(parent))
13515 {
13516 return false;
13517 }
13518
13519 if (!IsRuined() && !parent.IsRuined())
13520 {
13521 return true;
13522 }
13523
13524 return false;
13525 }
13526
13528 {
13529
13530
13531
13532
13533 return super.CanReceiveItemIntoCargo(item);
13534 }
13535
13537 {
13538
13539
13540
13541
13542 GameInventory attachmentInv = attachment.GetInventory();
13544 {
13545 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13546 return false;
13547 }
13548
13549 InventoryLocation loc = new InventoryLocation();
13550 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13551 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13552 return false;
13553
13554 return super.CanReceiveAttachment(attachment, slotId);
13555 }
13556
13558 {
13559 if (!super.CanReleaseAttachment(attachment))
13560 return false;
13561
13562 return GetInventory().AreChildrenAccessible();
13563 }
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13586 {
13587 int id = muzzle_owner.GetMuzzleID();
13588 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13589
13590 if (WPOF_array)
13591 {
13592 for (int i = 0; i < WPOF_array.Count(); i++)
13593 {
13594 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13595
13596 if (WPOF)
13597 {
13598 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13599 }
13600 }
13601 }
13602 }
13603
13604
13606 {
13607 int id = muzzle_owner.GetMuzzleID();
13609
13610 if (WPOBE_array)
13611 {
13612 for (int i = 0; i < WPOBE_array.Count(); i++)
13613 {
13614 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13615
13616 if (WPOBE)
13617 {
13618 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13619 }
13620 }
13621 }
13622 }
13623
13624
13626 {
13627 int id = muzzle_owner.GetMuzzleID();
13628 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13629
13630 if (WPOOH_array)
13631 {
13632 for (int i = 0; i < WPOOH_array.Count(); i++)
13633 {
13634 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13635
13636 if (WPOOH)
13637 {
13638 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13639 }
13640 }
13641 }
13642 }
13643
13644
13646 {
13647 int id = muzzle_owner.GetMuzzleID();
13648 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13649
13650 if (WPOOH_array)
13651 {
13652 for (int i = 0; i < WPOOH_array.Count(); i++)
13653 {
13654 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13655
13656 if (WPOOH)
13657 {
13658 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13659 }
13660 }
13661 }
13662 }
13663
13664
13666 {
13667 int id = muzzle_owner.GetMuzzleID();
13668 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13669
13670 if (WPOOH_array)
13671 {
13672 for (int i = 0; i < WPOOH_array.Count(); i++)
13673 {
13674 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13675
13676 if (WPOOH)
13677 {
13678 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13679 }
13680 }
13681 }
13682 }
13683
13684
13685
13687 {
13689 {
13690 return true;
13691 }
13692
13693 return false;
13694 }
13695
13697 {
13699 {
13700 return true;
13701 }
13702
13703 return false;
13704 }
13705
13707 {
13709 {
13710 return true;
13711 }
13712
13713 return false;
13714 }
13715
13717 {
13718 return false;
13719 }
13720
13723 {
13724 return UATimeSpent.DEFAULT_DEPLOY;
13725 }
13726
13727
13728
13729
13731 {
13733 SetSynchDirty();
13734 }
13735
13737 {
13739 }
13740
13741
13743 {
13744 return false;
13745 }
13746
13749 {
13750 string att_type = "None";
13751
13752 if (ConfigIsExisting("soundAttType"))
13753 {
13754 att_type = ConfigGetString("soundAttType");
13755 }
13756
13758 }
13759
13761 {
13763 }
13764
13765
13766
13767
13768
13772
13774 {
13777
13779 }
13780
13781
13783 {
13785 return;
13786
13788
13791
13794
13795 SoundParameters params = new SoundParameters();
13799 }
13800
13801
13803 {
13805 return;
13806
13808 SetSynchDirty();
13809
13812 }
13813
13814
13816 {
13818 return;
13819
13821 SetSynchDirty();
13822
13825 }
13826
13828 {
13830 }
13831
13833 {
13835 }
13836
13839 {
13840 if (!
GetGame().IsDedicatedServer())
13841 {
13842 if (ConfigIsExisting("attachSoundSet"))
13843 {
13844 string cfg_path = "";
13845 string soundset = "";
13846 string type_name =
GetType();
13847
13850 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13851 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13852
13853 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13854 {
13855 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13856 {
13857 if (cfg_slot_array[i] == slot_type)
13858 {
13859 soundset = cfg_soundset_array[i];
13860 break;
13861 }
13862 }
13863 }
13864
13865 if (soundset != "")
13866 {
13867 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13869 }
13870 }
13871 }
13872 }
13873
13875 {
13876
13877 }
13878
13879 void OnApply(PlayerBase player);
13880
13882 {
13883 return 1.0;
13884 };
13885
13887 {
13889 }
13890
13892 {
13894 }
13895
13897
13899 {
13900 SetDynamicPhysicsLifeTime(0.01);
13902 }
13903
13905 {
13906 array<string> zone_names = new array<string>;
13907 GetDamageZones(zone_names);
13908 for (int i = 0; i < zone_names.Count(); i++)
13909 {
13910 SetHealthMax(zone_names.Get(i),"Health");
13911 }
13912 SetHealthMax("","Health");
13913 }
13914
13917 {
13918 float global_health = GetHealth01("","Health");
13919 array<string> zones = new array<string>;
13920 GetDamageZones(zones);
13921
13922 for (int i = 0; i < zones.Count(); i++)
13923 {
13924 SetHealth01(zones.Get(i),"Health",global_health);
13925 }
13926 }
13927
13930 {
13931 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13932 }
13933
13935 {
13936 if (!hasRootAsPlayer)
13937 {
13938 if (refParentIB)
13939 {
13940
13941 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13942 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13943
13944 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13945 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13946
13949 }
13950 else
13951 {
13952
13955 }
13956 }
13957 }
13958
13960 {
13962 {
13963 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13964 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13965 {
13966 float heatPermCoef = 1.0;
13968 while (ent)
13969 {
13970 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13971 ent = ent.GetHierarchyParent();
13972 }
13973
13974 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13975 }
13976 }
13977 }
13978
13980 {
13981
13982 EntityAI parent = GetHierarchyParent();
13983 if (!parent)
13984 {
13985 hasParent = false;
13986 hasRootAsPlayer = false;
13987 }
13988 else
13989 {
13990 hasParent = true;
13991 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13992 refParentIB =
ItemBase.Cast(parent);
13993 }
13994 }
13995
13996 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13997 {
13998
13999 }
14000
14002 {
14003
14004 return false;
14005 }
14006
14008 {
14009
14010
14011 return false;
14012 }
14013
14015 {
14016
14017 return false;
14018 }
14019
14022 {
14023 return !GetIsFrozen() &&
IsOpen();
14024 }
14025
14027 {
14028 bool hasParent = false, hasRootAsPlayer = false;
14030
14031 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14032 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14033
14034 if (wwtu || foodDecay)
14035 {
14039
14040 if (processWetness || processTemperature || processDecay)
14041 {
14043
14044 if (processWetness)
14045 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14046
14047 if (processTemperature)
14049
14050 if (processDecay)
14051 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14052 }
14053 }
14054 }
14055
14058 {
14060 }
14061
14063 {
14066
14067 return super.GetTemperatureFreezeThreshold();
14068 }
14069
14071 {
14074
14075 return super.GetTemperatureThawThreshold();
14076 }
14077
14079 {
14082
14083 return super.GetItemOverheatThreshold();
14084 }
14085
14087 {
14089 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14090
14091 return super.GetTemperatureFreezeTime();
14092 }
14093
14095 {
14097 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14098
14099 return super.GetTemperatureThawTime();
14100 }
14101
14106
14108 {
14109 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14110 }
14111
14113 {
14114 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14115 }
14116
14119 {
14121 }
14122
14124 {
14126 }
14127
14129 {
14131 }
14132
14135 {
14136 return null;
14137 }
14138
14141 {
14142 return false;
14143 }
14144
14146 {
14148 {
14151 if (!trg)
14152 {
14154 explosive = this;
14155 }
14156
14157 explosive.PairRemote(trg);
14159
14160 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14161 trg.SetPersistentPairID(persistentID);
14162 explosive.SetPersistentPairID(persistentID);
14163
14164 return true;
14165 }
14166 return false;
14167 }
14168
14171 {
14172 float ret = 1.0;
14175 ret *= GetHealth01();
14176
14177 return ret;
14178 }
14179
14180 #ifdef DEVELOPER
14181 override void SetDebugItem()
14182 {
14183 super.SetDebugItem();
14184 _itemBase = this;
14185 }
14186
14188 {
14189 string text = super.GetDebugText();
14190
14192 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14193
14194 return text;
14195 }
14196 #endif
14197
14199 {
14200 return true;
14201 }
14202
14204
14206
14208 {
14211 }
14212
14213
14221
14237}
14238
14240{
14242 if (entity)
14243 {
14244 bool is_item = entity.IsInherited(
ItemBase);
14245 if (is_item && full_quantity)
14246 {
14249 }
14250 }
14251 else
14252 {
14254 return NULL;
14255 }
14256 return entity;
14257}
14258
14260{
14261 if (item)
14262 {
14263 if (health > 0)
14264 item.SetHealth("", "", health);
14265
14266 if (item.CanHaveTemperature())
14267 {
14269 if (item.CanFreeze())
14270 item.SetFrozen(false);
14271 }
14272
14273 if (item.HasEnergyManager())
14274 {
14275 if (quantity >= 0)
14276 {
14277 item.GetCompEM().SetEnergy0To1(quantity);
14278 }
14279 else
14280 {
14282 }
14283 }
14284 else if (item.IsMagazine())
14285 {
14286 Magazine mag = Magazine.Cast(item);
14287 if (quantity >= 0)
14288 {
14289 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14290 }
14291 else
14292 {
14294 }
14295
14296 }
14297 else
14298 {
14299 if (quantity >= 0)
14300 {
14301 item.SetQuantityNormalized(quantity, false);
14302 }
14303 else
14304 {
14306 }
14307
14308 }
14309 }
14310}
14311
14312#ifdef DEVELOPER
14314#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.