9523{
9525 {
9526 return true;
9527 }
9528};
9529
9530
9531
9533{
9537
9539
9542
9543
9544
9545
9546
9555
9561
9566
9571
9592 protected bool m_IsResultOfSplit
9593
9595
9600
9601
9602
9604
9608
9609
9610
9612
9615
9616
9617
9623
9624
9632
9635
9636
9638
9639
9641
9642
9647
9648
9653
9654
9656
9657
9659 {
9664
9665 if (!
GetGame().IsDedicatedServer())
9666 {
9668 {
9670
9672 {
9674 }
9675 }
9676
9679 }
9680
9681 m_OldLocation = null;
9682
9684 {
9686 }
9687
9688 if (ConfigIsExisting("headSelectionsToHide"))
9689 {
9692 }
9693
9695 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9696 {
9698 }
9699
9701
9702 m_IsResultOfSplit = false;
9703
9705 }
9706
9708 {
9709 super.InitItemVariables();
9710
9716 m_Count = ConfigGetInt(
"count");
9717
9720
9725
9728
9733
9745
9749
9750
9753 if (ConfigIsExisting("canBeSplit"))
9754 {
9757 }
9758
9760 if (ConfigIsExisting("itemBehaviour"))
9762
9763
9766 RegisterNetSyncVariableInt("m_VarLiquidType");
9767 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9768
9769 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9770 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9771 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9772
9773 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9774 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9775 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9776 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9777
9778 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9779 RegisterNetSyncVariableBool("m_IsTakeable");
9780 RegisterNetSyncVariableBool("m_IsHologram");
9781
9784 {
9787 }
9788
9790
9792 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9794
9795 }
9796
9798 {
9800 }
9801
9803 {
9806 {
9811 }
9812 }
9813
9814 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9815 {
9817 {
9820 }
9821
9823 }
9824
9826 {
9832 }
9833
9835
9837 {
9839
9840 if (!action)
9841 {
9842 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9843 return;
9844 }
9845
9847 if (!ai)
9848 {
9850 return;
9851 }
9852
9854 if (!action_array)
9855 {
9856 action_array = new array<ActionBase_Basic>;
9858 }
9859 if (LogManager.IsActionLogEnable())
9860 {
9861 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9862 }
9863
9864 if (action_array.Find(action) != -1)
9865 {
9866 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9867 }
9868 else
9869 {
9870 action_array.Insert(action);
9871 }
9872 }
9873
9875 {
9877 ActionBase action = player.GetActionManager().GetAction(actionName);
9880
9881 if (action_array)
9882 {
9883 action_array.RemoveItem(action);
9884 }
9885 }
9886
9887
9888
9890 {
9891 ActionOverrideData overrideData = new ActionOverrideData();
9895
9897 if (!actionMap)
9898 {
9901 }
9902
9903 actionMap.Insert(this.
Type(), overrideData);
9904
9905 }
9906
9908
9910
9911
9913 {
9916
9919
9920 string config_to_search = "CfgVehicles";
9921 string muzzle_owner_config;
9922
9924 {
9925 if (IsInherited(Weapon))
9926 config_to_search = "CfgWeapons";
9927
9928 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9929
9930 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9931
9933
9934 if (config_OnFire_subclass_count > 0)
9935 {
9936 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9937
9938 for (int i = 0; i < config_OnFire_subclass_count; i++)
9939 {
9940 string particle_class = "";
9942 string config_OnFire_entry = config_OnFire_class + particle_class;
9943 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9944 WPOF_array.Insert(WPOF);
9945 }
9946
9947
9949 }
9950 }
9951
9953 {
9954 config_to_search = "CfgWeapons";
9955 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9956
9957 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9958
9960
9961 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9962 {
9963 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9964
9965 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9966 {
9967 string particle_class2 = "";
9969 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9970 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9971 WPOBE_array.Insert(WPOBE);
9972 }
9973
9974
9976 }
9977 }
9978 }
9979
9980
9982 {
9985
9987 {
9988 string config_to_search = "CfgVehicles";
9989
9990 if (IsInherited(Weapon))
9991 config_to_search = "CfgWeapons";
9992
9993 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9994 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9995
9996 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9997 {
9998
10000
10002 {
10004 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10006 return;
10007 }
10008
10011
10012
10013
10015 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10016
10017 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10018 {
10019 string particle_class = "";
10021 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10023
10024 if (entry_type == CT_CLASS)
10025 {
10026 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10027 WPOOH_array.Insert(WPOF);
10028 }
10029 }
10030
10031
10033 }
10034 }
10035 }
10036
10038 {
10040 }
10041
10043 {
10045 {
10047
10050
10053
10054 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10055 }
10056 }
10057
10059 {
10061 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10062
10064 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10065
10067 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10068
10070 {
10072 }
10073 }
10074
10076 {
10078 }
10079
10081 {
10084 else
10086
10088 {
10091 }
10092 else
10093 {
10096
10099 }
10100
10102 }
10103
10105 {
10107 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10108 }
10109
10111 {
10113 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10115 }
10116
10118 {
10120 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10121 }
10122
10124 {
10127
10128 OverheatingParticle OP = new OverheatingParticle();
10133
10135 }
10136
10138 {
10141
10142 return -1;
10143 }
10144
10146 {
10148 {
10151
10152 for (int i = count; i > 0; --i)
10153 {
10154 int id = i - 1;
10157
10160
10161 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10162 {
10163 if (p)
10164 {
10167 }
10168 }
10169 }
10170 }
10171 }
10172
10174 {
10176 {
10178 {
10179 int id = i - 1;
10181
10182 if (OP)
10183 {
10185
10186 if (p)
10187 {
10189 }
10190
10191 delete OP;
10192 }
10193 }
10194
10197 }
10198 }
10199
10202 {
10203 return 0.0;
10204 }
10205
10206
10208 {
10209 return 250;
10210 }
10211
10213 {
10214 return 0;
10215 }
10216
10219 {
10221 return true;
10222
10223 return false;
10224 }
10225
10228 {
10231
10233 {
10235 }
10236 else
10237 {
10238
10240 }
10241
10243 }
10244
10251 {
10252 return -1;
10253 }
10254
10255
10256
10257
10259 {
10261 {
10263 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10264
10265 if (r_index >= 0)
10266 {
10267 InventoryLocation r_il = new InventoryLocation;
10268 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10269
10270 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10273 {
10274 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10275 }
10277 {
10278 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10279 }
10280
10281 }
10282
10283 player.GetHumanInventory().ClearUserReservedLocation(this);
10284 }
10285
10288 }
10289
10290
10291
10292
10294 {
10295 return ItemBase.m_DebugActionsMask;
10296 }
10297
10299 {
10300 return ItemBase.m_DebugActionsMask & mask;
10301 }
10302
10304 {
10305 ItemBase.m_DebugActionsMask = mask;
10306 }
10307
10309 {
10310 ItemBase.m_DebugActionsMask |= mask;
10311 }
10312
10314 {
10315 ItemBase.m_DebugActionsMask &= ~mask;
10316 }
10317
10319 {
10321 {
10323 }
10324 else
10325 {
10327 }
10328 }
10329
10330
10332 {
10333 if (GetEconomyProfile())
10334 {
10335 float q_max = GetEconomyProfile().GetQuantityMax();
10336 if (q_max > 0)
10337 {
10338 float q_min = GetEconomyProfile().GetQuantityMin();
10339 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10340
10342 {
10343 ComponentEnergyManager comp = GetCompEM();
10345 {
10347 }
10348 }
10350 {
10352
10353 }
10354
10355 }
10356 }
10357 }
10358
10361 {
10362 EntityAI parent = GetHierarchyParent();
10363
10364 if (parent)
10365 {
10366 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10367 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10368 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10369 }
10370 }
10371
10374 {
10375 EntityAI parent = GetHierarchyParent();
10376
10377 if (parent)
10378 {
10379 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10380 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10381 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10382 }
10383 }
10384
10386 {
10387
10388
10389
10390
10392
10394 {
10395 if (ScriptInputUserData.CanStoreInputUserData())
10396 {
10397 ScriptInputUserData ctx = new ScriptInputUserData;
10403 ctx.
Write(use_stack_max);
10406
10408 {
10409 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10410 }
10411 }
10412 }
10413 else if (!
GetGame().IsMultiplayer())
10414 {
10416 }
10417 }
10418
10420 {
10422 }
10423
10425 {
10427 }
10428
10430 {
10432 }
10433
10435 {
10436
10437 return false;
10438 }
10439
10441 {
10442 return false;
10443 }
10444
10448 {
10449 return false;
10450 }
10451
10453 {
10454 return "";
10455 }
10456
10458
10460 {
10461 return false;
10462 }
10463
10465 {
10466 return true;
10467 }
10468
10469
10470
10472 {
10473 return true;
10474 }
10475
10477 {
10478 return true;
10479 }
10480
10482 {
10483 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10485 }
10486
10488 {
10490 }
10491
10493 {
10495 if (!is_being_placed)
10497 SetSynchDirty();
10498 }
10499
10500
10502
10504 {
10506 }
10507
10509 {
10511 }
10512
10514 {
10515 return 1;
10516 }
10517
10519 {
10520 return false;
10521 }
10522
10524 {
10526 SetSynchDirty();
10527 }
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10564 {
10565 super.OnMovedInsideCargo(container);
10566
10567 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10568 }
10569
10570 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10571 {
10572 super.EEItemLocationChanged(oldLoc,newLoc);
10573
10574 PlayerBase new_player = null;
10575 PlayerBase old_player = null;
10576
10577 if (newLoc.GetParent())
10578 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10579
10580 if (oldLoc.GetParent())
10581 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10582
10584 {
10585 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10586
10587 if (r_index >= 0)
10588 {
10589 InventoryLocation r_il = new InventoryLocation;
10590 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10591
10592 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10595 {
10596 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10597 }
10599 {
10600 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10601 }
10602
10603 }
10604 }
10605
10607 {
10608 if (new_player)
10609 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10610
10611 if (new_player == old_player)
10612 {
10613
10614 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10615 {
10617 {
10618 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10619 {
10620 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10621 }
10622 }
10623 else
10624 {
10625 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10626 }
10627 }
10628
10629 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10630 {
10631 int type = oldLoc.GetType();
10633 {
10634 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10635 }
10637 {
10638 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10639 }
10640 }
10641 if (!m_OldLocation)
10642 {
10643 m_OldLocation = new InventoryLocation;
10644 }
10645 m_OldLocation.Copy(oldLoc);
10646 }
10647 else
10648 {
10649 if (m_OldLocation)
10650 {
10651 m_OldLocation.Reset();
10652 }
10653 }
10654
10656 }
10657 else
10658 {
10659 if (new_player)
10660 {
10661 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10662 if (res_index >= 0)
10663 {
10664 InventoryLocation il = new InventoryLocation;
10665 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10667 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10670 {
10671 il.
GetParent().GetOnReleaseLock().Invoke(it);
10672 }
10674 {
10676 }
10677
10678 }
10679 }
10681 {
10682
10684 }
10685
10686 if (m_OldLocation)
10687 {
10688 m_OldLocation.Reset();
10689 }
10690 }
10691 }
10692
10693 override void EOnContact(IEntity other, Contact extra)
10694 {
10696 {
10697 int liquidType = -1;
10699 if (impactSpeed > 0.0)
10700 {
10702 #ifndef SERVER
10704 #else
10706 SetSynchDirty();
10707 #endif
10709 }
10710 }
10711
10712 #ifdef SERVER
10713 if (GetCompEM() && GetCompEM().IsPlugged())
10714 {
10715 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10716 GetCompEM().UnplugThis();
10717 }
10718 #endif
10719 }
10720
10722
10724 {
10726 }
10727
10729 {
10730
10731 }
10732
10734 {
10735 super.OnItemLocationChanged(old_owner, new_owner);
10736
10737 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10738 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10739
10740 if (!relatedPlayer && playerNew)
10741 relatedPlayer = playerNew;
10742
10743 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10744 {
10746 if (actionMgr)
10747 {
10748 ActionBase currentAction = actionMgr.GetRunningAction();
10749 if (currentAction)
10751 }
10752 }
10753
10754 Man ownerPlayerOld = null;
10755 Man ownerPlayerNew = null;
10756
10757 if (old_owner)
10758 {
10759 if (old_owner.
IsMan())
10760 {
10761 ownerPlayerOld = Man.Cast(old_owner);
10762 }
10763 else
10764 {
10765 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10766 }
10767 }
10768 else
10769 {
10771 {
10773
10774 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10775 {
10776 GetCompEM().UnplugThis();
10777 }
10778 }
10779 }
10780
10781 if (new_owner)
10782 {
10783 if (new_owner.
IsMan())
10784 {
10785 ownerPlayerNew = Man.Cast(new_owner);
10786 }
10787 else
10788 {
10789 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10790 }
10791 }
10792
10793 if (ownerPlayerOld != ownerPlayerNew)
10794 {
10795 if (ownerPlayerOld)
10796 {
10797 array<EntityAI> subItemsExit = new array<EntityAI>;
10799 for (int i = 0; i < subItemsExit.Count(); i++)
10800 {
10803 }
10804 }
10805
10806 if (ownerPlayerNew)
10807 {
10808 array<EntityAI> subItemsEnter = new array<EntityAI>;
10810 for (int j = 0; j < subItemsEnter.Count(); j++)
10811 {
10814 }
10815 }
10816 }
10817 else if (ownerPlayerNew != null)
10818 {
10819 PlayerBase nplayer;
10820 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10821 {
10822 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10824 for (int k = 0; k < subItemsUpdate.Count(); k++)
10825 {
10827 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10828 }
10829 }
10830 }
10831
10832 if (old_owner)
10833 old_owner.OnChildItemRemoved(this);
10834 if (new_owner)
10835 new_owner.OnChildItemReceived(this);
10836 }
10837
10838
10840 {
10841 super.EEDelete(parent);
10842 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10843 if (player)
10844 {
10846
10847 if (player.IsAlive())
10848 {
10849 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10850 if (r_index >= 0)
10851 {
10852 InventoryLocation r_il = new InventoryLocation;
10853 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10854
10855 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10858 {
10859 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10860 }
10862 {
10863 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10864 }
10865
10866 }
10867
10868 player.RemoveQuickBarEntityShortcut(this);
10869 }
10870 }
10871 }
10872
10874 {
10875 super.EEKilled(killer);
10876
10879 {
10880 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10881 {
10882 if (IsMagazine())
10883 {
10884 if (Magazine.Cast(this).GetAmmoCount() > 0)
10885 {
10887 }
10888 }
10889 else
10890 {
10892 }
10893 }
10894 }
10895 }
10896
10898 {
10899 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10900
10901 super.OnWasAttached(parent, slot_id);
10902
10905
10907 }
10908
10910 {
10911 super.OnWasDetached(parent, slot_id);
10912
10915 }
10916
10918 {
10919 int idx;
10922
10923 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10924 if (inventory_slots.Count() < 1)
10925 {
10926 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10927 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10928 }
10929 else
10930 {
10931 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10932 }
10933
10934 idx = inventory_slots.Find(slot);
10935 if (idx < 0)
10936 return "";
10937
10938 return attach_types.Get(idx);
10939 }
10940
10942 {
10943 int idx = -1;
10944 string slot;
10945
10948
10949 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10950 if (inventory_slots.Count() < 1)
10951 {
10952 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10953 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10954 }
10955 else
10956 {
10957 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10958 if (detach_types.Count() < 1)
10959 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10960 }
10961
10962 for (int i = 0; i < inventory_slots.Count(); i++)
10963 {
10964 slot = inventory_slots.Get(i);
10965 }
10966
10967 if (slot != "")
10968 {
10969 if (detach_types.Count() == 1)
10970 idx = 0;
10971 else
10972 idx = inventory_slots.Find(slot);
10973 }
10974 if (idx < 0)
10975 return "";
10976
10977 return detach_types.Get(idx);
10978 }
10979
10981 {
10982
10984
10985
10986 float min_time = 1;
10987 float max_time = 3;
10988 float delay = Math.RandomFloat(min_time, max_time);
10989
10990 explode_timer.Run(delay, this, "DoAmmoExplosion");
10991 }
10992
10994 {
10995 Magazine magazine = Magazine.Cast(this);
10996 int pop_sounds_count = 6;
10997 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10998
10999
11000 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11001 string sound_name = pop_sounds[ sound_idx ];
11003
11004
11005 magazine.ServerAddAmmoCount(-1);
11006
11007
11008 float min_temp_to_explode = 100;
11009
11010 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
11011 {
11013 }
11014 }
11015
11016
11017 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11018 {
11019 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11020
11021 const int CHANCE_DAMAGE_CARGO = 4;
11022 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11023 const int CHANCE_DAMAGE_NOTHING = 2;
11024
11026 {
11027 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11028 int chances;
11029 int rnd;
11030
11031 if (GetInventory().GetCargo())
11032 {
11033 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11034 rnd = Math.RandomInt(0,chances);
11035
11036 if (rnd < CHANCE_DAMAGE_CARGO)
11037 {
11039 }
11040 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11041 {
11043 }
11044 }
11045 else
11046 {
11047 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11048 rnd = Math.RandomInt(0,chances);
11049
11050 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11051 {
11053 }
11054 }
11055 }
11056 }
11057
11059 {
11060 if (GetInventory().GetCargo())
11061 {
11062 int item_count = GetInventory().GetCargo().GetItemCount();
11063 if (item_count > 0)
11064 {
11065 int random_pick = Math.RandomInt(0, item_count);
11067 if (!item.IsExplosive())
11068 {
11069 item.AddHealth("","",damage);
11070 return true;
11071 }
11072 }
11073 }
11074 return false;
11075 }
11076
11078 {
11079 int attachment_count = GetInventory().AttachmentCount();
11080 if (attachment_count > 0)
11081 {
11082 int random_pick = Math.RandomInt(0, attachment_count);
11083 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11084 if (!attachment.IsExplosive())
11085 {
11086 attachment.AddHealth("","",damage);
11087 return true;
11088 }
11089 }
11090 return false;
11091 }
11092
11094 {
11096 }
11097
11099 {
11101 return GetInventory().CanRemoveEntity();
11102
11103 return false;
11104 }
11105
11107 {
11109 return;
11110
11112 {
11113 if (ScriptInputUserData.CanStoreInputUserData())
11114 {
11115 ScriptInputUserData ctx = new ScriptInputUserData;
11120 ctx.
Write(destination_entity);
11122 ctx.
Write(slot_id);
11124 }
11125 }
11126 else if (!
GetGame().IsMultiplayer())
11127 {
11129 }
11130 }
11131
11133 {
11135 return;
11136
11137 float split_quantity_new;
11141 InventoryLocation loc = new InventoryLocation;
11142
11143 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11144 {
11146 split_quantity_new = stack_max;
11147 else
11149
11150 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11151 if (new_item)
11152 {
11153 new_item.SetResultOfSplit(true);
11154 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11156 new_item.SetQuantity(split_quantity_new);
11157 }
11158 }
11159 else if (destination_entity && slot_id == -1)
11160 {
11161 if (quantity > stack_max)
11162 split_quantity_new = stack_max;
11163 else
11164 split_quantity_new = quantity;
11165
11167 {
11170 }
11171
11172 if (new_item)
11173 {
11174 new_item.SetResultOfSplit(true);
11175 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11177 new_item.SetQuantity(split_quantity_new);
11178 }
11179 }
11180 else
11181 {
11182 if (stack_max != 0)
11183 {
11185 {
11187 }
11188
11189 if (split_quantity_new == 0)
11190 {
11191 if (!
GetGame().IsMultiplayer())
11192 player.PhysicalPredictiveDropItem(this);
11193 else
11194 player.ServerDropEntity(this);
11195 return;
11196 }
11197
11199
11200 if (new_item)
11201 {
11202 new_item.SetResultOfSplit(true);
11203 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11205 new_item.SetQuantity(stack_max);
11206 new_item.PlaceOnSurface();
11207 }
11208 }
11209 }
11210 }
11211
11213 {
11215 return;
11216
11217 float split_quantity_new;
11221 InventoryLocation loc = new InventoryLocation;
11222
11223 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11224 {
11226 split_quantity_new = stack_max;
11227 else
11229
11230 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11231 if (new_item)
11232 {
11233 new_item.SetResultOfSplit(true);
11234 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11236 new_item.SetQuantity(split_quantity_new);
11237 }
11238 }
11239 else if (destination_entity && slot_id == -1)
11240 {
11241 if (quantity > stack_max)
11242 split_quantity_new = stack_max;
11243 else
11244 split_quantity_new = quantity;
11245
11247 {
11250 }
11251
11252 if (new_item)
11253 {
11254 new_item.SetResultOfSplit(true);
11255 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11257 new_item.SetQuantity(split_quantity_new);
11258 }
11259 }
11260 else
11261 {
11262 if (stack_max != 0)
11263 {
11265 {
11267 }
11268
11270
11271 if (new_item)
11272 {
11273 new_item.SetResultOfSplit(true);
11274 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11276 new_item.SetQuantity(stack_max);
11277 new_item.PlaceOnSurface();
11278 }
11279 }
11280 }
11281 }
11282
11284 {
11286 return;
11287
11289 {
11290 if (ScriptInputUserData.CanStoreInputUserData())
11291 {
11292 ScriptInputUserData ctx = new ScriptInputUserData;
11297 dst.WriteToContext(ctx);
11299 }
11300 }
11301 else if (!
GetGame().IsMultiplayer())
11302 {
11304 }
11305 }
11306
11308 {
11310 return;
11311
11313 {
11314 if (ScriptInputUserData.CanStoreInputUserData())
11315 {
11316 ScriptInputUserData ctx = new ScriptInputUserData;
11321 ctx.
Write(destination_entity);
11327 }
11328 }
11329 else if (!
GetGame().IsMultiplayer())
11330 {
11332 }
11333 }
11334
11336 {
11338 }
11339
11341 {
11343 return this;
11344
11346 float split_quantity_new;
11348 if (dst.IsValid())
11349 {
11350 int slot_id = dst.GetSlot();
11352
11353 if (quantity > stack_max)
11354 split_quantity_new = stack_max;
11355 else
11356 split_quantity_new = quantity;
11357
11359
11360 if (new_item)
11361 {
11362 new_item.SetResultOfSplit(true);
11363 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11366 }
11367
11368 return new_item;
11369 }
11370
11371 return null;
11372 }
11373
11375 {
11377 return;
11378
11380 float split_quantity_new;
11382 if (destination_entity)
11383 {
11385 if (quantity > stackable)
11386 split_quantity_new = stackable;
11387 else
11388 split_quantity_new = quantity;
11389
11390 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11391 if (new_item)
11392 {
11393 new_item.SetResultOfSplit(true);
11394 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11396 new_item.SetQuantity(split_quantity_new);
11397 }
11398 }
11399 }
11400
11402 {
11404 return;
11405
11407 {
11408 if (ScriptInputUserData.CanStoreInputUserData())
11409 {
11410 ScriptInputUserData ctx = new ScriptInputUserData;
11415 ItemBase destination_entity =
this;
11416 ctx.
Write(destination_entity);
11420 }
11421 }
11422 else if (!
GetGame().IsMultiplayer())
11423 {
11425 }
11426 }
11427
11429 {
11431 return;
11432
11434 float split_quantity_new;
11436 if (player)
11437 {
11439 if (quantity > stackable)
11440 split_quantity_new = stackable;
11441 else
11442 split_quantity_new = quantity;
11443
11444 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11445 new_item =
ItemBase.Cast(in_hands);
11446 if (new_item)
11447 {
11448 new_item.SetResultOfSplit(true);
11449 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11451 new_item.SetQuantity(split_quantity_new);
11452 }
11453 }
11454 }
11455
11457 {
11459 return;
11460
11462 float split_quantity_new = Math.Floor(quantity * 0.5);
11463
11465
11466 if (new_item)
11467 {
11468 if (new_item.GetQuantityMax() < split_quantity_new)
11469 {
11470 split_quantity_new = new_item.GetQuantityMax();
11471 }
11472
11473 new_item.SetResultOfSplit(true);
11474 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11475
11477 {
11480 }
11481 else
11482 {
11485 }
11486 }
11487 }
11488
11490 {
11492 return;
11493
11495 float split_quantity_new = Math.Floor(quantity / 2);
11496
11497 InventoryLocation invloc = new InventoryLocation;
11499
11501 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11502
11503 if (new_item)
11504 {
11505 if (new_item.GetQuantityMax() < split_quantity_new)
11506 {
11507 split_quantity_new = new_item.GetQuantityMax();
11508 }
11510 {
11513 }
11514 else
11515 {
11518 }
11519 }
11520 }
11521
11524 {
11525 SetWeightDirty();
11527
11528 if (parent)
11529 parent.OnAttachmentQuantityChangedEx(this, delta);
11530
11532 {
11534 {
11536 }
11538 {
11539 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11541 }
11542 }
11543
11544 }
11545
11548 {
11549
11550 }
11551
11554 {
11556 }
11557
11559 {
11560 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11561
11563 {
11564 if (newLevel == GameConstants.STATE_RUINED)
11565 {
11567 EntityAI parent = GetHierarchyParent();
11568 if (parent && parent.IsFireplace())
11569 {
11570 CargoBase cargo = GetInventory().GetCargo();
11571 if (cargo)
11572 {
11574 {
11576 }
11577 }
11578 }
11579 }
11580
11582 {
11583
11585 return;
11586 }
11587
11588 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11589 {
11591 }
11592 }
11593 }
11594
11595
11597 {
11598 super.OnRightClick();
11599
11601 {
11603 {
11604 if (ScriptInputUserData.CanStoreInputUserData())
11605 {
11606 vector m4[4];
11608
11609 EntityAI root = GetHierarchyRoot();
11610
11611 InventoryLocation dst = new InventoryLocation;
11613 {
11614 if (root)
11615 {
11616 root.GetTransform(m4);
11618 }
11619 else
11620 GetInventory().GetCurrentInventoryLocation(dst);
11621 }
11622 else
11623 {
11625
11626
11627 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11628 {
11629 if (root)
11630 {
11631 root.GetTransform(m4);
11633 }
11634 else
11635 GetInventory().GetCurrentInventoryLocation(dst);
11636 }
11637 else
11638 {
11639 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11640 }
11641 }
11642
11643 ScriptInputUserData ctx = new ScriptInputUserData;
11651 }
11652 }
11653 else if (!
GetGame().IsMultiplayer())
11654 {
11656 }
11657 }
11658 }
11659
11660 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11661 {
11662
11663 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11664 return false;
11665
11666 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11667 return false;
11668
11669
11671 return false;
11672
11673
11674 Magazine mag = Magazine.Cast(this);
11675 if (mag)
11676 {
11677 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11678 return false;
11679
11680 if (stack_max_limit)
11681 {
11682 Magazine other_mag = Magazine.Cast(other_item);
11683 if (other_item)
11684 {
11685 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11686 return false;
11687 }
11688
11689 }
11690 }
11691 else
11692 {
11693
11695 return false;
11696
11698 return false;
11699 }
11700
11701 PlayerBase player = null;
11702 if (CastTo(player, GetHierarchyRootPlayer()))
11703 {
11704 if (player.GetInventory().HasAttachment(this))
11705 return false;
11706
11707 if (player.IsItemsToDelete())
11708 return false;
11709 }
11710
11711 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11712 return false;
11713
11714 int slotID;
11716 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11717 return false;
11718
11719 return true;
11720 }
11721
11723 {
11725 }
11726
11728 {
11729 return m_IsResultOfSplit;
11730 }
11731
11733 {
11734 m_IsResultOfSplit = value;
11735 }
11736
11738 {
11740 }
11741
11743 {
11744 float other_item_quantity = other_item.GetQuantity();
11745 float this_free_space;
11746
11748
11750
11751 if (other_item_quantity > this_free_space)
11752 {
11753 return this_free_space;
11754 }
11755 else
11756 {
11757 return other_item_quantity;
11758 }
11759 }
11760
11762 {
11764 }
11765
11767 {
11769 return;
11770
11771 if (!IsMagazine() && other_item)
11772 {
11774 if (quantity_used != 0)
11775 {
11776 float hp1 = GetHealth01("","");
11777 float hp2 = other_item.GetHealth01("","");
11778 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11779 hpResult = hpResult / (
GetQuantity() + quantity_used);
11780
11781 hpResult *= GetMaxHealth();
11782 Math.Round(hpResult);
11783 SetHealth("", "Health", hpResult);
11784
11786 other_item.AddQuantity(-quantity_used);
11787 }
11788 }
11790 }
11791
11793 {
11794 #ifdef SERVER
11795 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11796 GetHierarchyParent().IncreaseLifetimeUp();
11797 #endif
11798 };
11799
11801 {
11802 PlayerBase p = PlayerBase.Cast(player);
11803
11804 array<int> recipesIds = p.m_Recipes;
11805 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11806 if (moduleRecipesManager)
11807 {
11808 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11809 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11810 }
11811
11812 for (int i = 0;i < recipesIds.Count(); i++)
11813 {
11814 int key = recipesIds.Get(i);
11815 string recipeName = moduleRecipesManager.GetRecipeName(key);
11817 }
11818 }
11819
11820
11821 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11822 {
11823 super.GetDebugActions(outputList);
11824
11825
11830
11831
11835
11839
11840
11843
11844
11846 {
11849 }
11850
11852
11855
11859 }
11860
11861
11862
11863
11865 {
11866 super.OnAction(action_id, player, ctx);
11867 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11868 {
11869 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11870 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11871 PlayerBase p = PlayerBase.Cast(player);
11872 if (
EActions.RECIPES_RANGE_START < 1000)
11873 {
11874 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11875 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11876 }
11877 }
11878 #ifndef SERVER
11879 else if (action_id ==
EActions.WATCH_PLAYER)
11880 {
11881 PluginDeveloper.SetDeveloperItemClientEx(player);
11882 }
11883 #endif
11885 {
11886 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11887 {
11888 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11889 OnDebugButtonPressServer(id + 1);
11890 }
11891
11892 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11893 {
11894 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11896 }
11897
11898 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11899 {
11900 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11902 }
11903
11904 else if (action_id ==
EActions.ADD_QUANTITY)
11905 {
11906 if (IsMagazine())
11907 {
11908 Magazine mag = Magazine.Cast(this);
11909 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11910 }
11911 else
11912 {
11914 }
11915
11916 if (m_EM)
11917 {
11918 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11919 }
11920
11921 }
11922
11923 else if (action_id ==
EActions.REMOVE_QUANTITY)
11924 {
11925 if (IsMagazine())
11926 {
11927 Magazine mag2 = Magazine.Cast(this);
11928 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11929 }
11930 else
11931 {
11933 }
11934 if (m_EM)
11935 {
11936 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11937 }
11938
11939 }
11940
11941 else if (action_id ==
EActions.SET_QUANTITY_0)
11942 {
11944
11945 if (m_EM)
11946 {
11947 m_EM.SetEnergy(0);
11948 }
11949 }
11950
11951 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11952 {
11954
11955 if (m_EM)
11956 {
11957 m_EM.SetEnergy(m_EM.GetEnergyMax());
11958 }
11959 }
11960
11961 else if (action_id ==
EActions.ADD_HEALTH)
11962 {
11963 AddHealth("","",GetMaxHealth("","Health")/5);
11964 }
11965 else if (action_id ==
EActions.REMOVE_HEALTH)
11966 {
11967 AddHealth("","",-GetMaxHealth("","Health")/5);
11968 }
11969 else if (action_id ==
EActions.DESTROY_HEALTH)
11970 {
11971 SetHealth01("","",0);
11972 }
11973 else if (action_id ==
EActions.WATCH_ITEM)
11974 {
11976 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11977 #ifdef DEVELOPER
11978 SetDebugDeveloper_item(this);
11979 #endif
11980 }
11981
11982 else if (action_id ==
EActions.ADD_TEMPERATURE)
11983 {
11984 AddTemperature(20);
11985
11986 }
11987
11988 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11989 {
11990 AddTemperature(-20);
11991
11992 }
11993
11994 else if (action_id ==
EActions.FLIP_FROZEN)
11995 {
11996 SetFrozen(!GetIsFrozen());
11997
11998 }
11999
12000 else if (action_id ==
EActions.ADD_WETNESS)
12001 {
12003
12004 }
12005
12006 else if (action_id ==
EActions.REMOVE_WETNESS)
12007 {
12009
12010 }
12011
12012 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12013 {
12016
12017
12018 }
12019
12020 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12021 {
12024 }
12025
12026 else if (action_id ==
EActions.MAKE_SPECIAL)
12027 {
12028 auto debugParams = DebugSpawnParams.WithPlayer(player);
12029 OnDebugSpawnEx(debugParams);
12030 }
12031
12032 else if (action_id ==
EActions.DELETE)
12033 {
12034 Delete();
12035 }
12036
12037 }
12038
12039
12040 return false;
12041 }
12042
12043
12044
12045
12049
12052
12053
12054
12056 {
12057 return false;
12058 }
12059
12060
12062 {
12063 return true;
12064 }
12065
12066
12068 {
12069 return true;
12070 }
12071
12072
12073
12075 {
12076 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12078 }
12079
12082 {
12083 return null;
12084 }
12085
12087 {
12088 return false;
12089 }
12090
12092 {
12093 return false;
12094 }
12095
12099
12100
12102 {
12103 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12104 return module_repairing.CanRepair(this, item_repair_kit);
12105 }
12106
12107
12108 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12109 {
12110 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12111 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12112 }
12113
12114
12116 {
12117
12118
12119
12120
12121
12122
12123
12124
12125 return 1;
12126 }
12127
12128
12129
12131 {
12133 }
12134
12135
12136
12138 {
12140 }
12141
12142
12151 {
12152 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12153
12154 if (player)
12155 {
12156 player.MessageStatus(text);
12157 }
12158 }
12159
12160
12169 {
12170 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12171
12172 if (player)
12173 {
12174 player.MessageAction(text);
12175 }
12176 }
12177
12178
12187 {
12188 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12189
12190 if (player)
12191 {
12192 player.MessageFriendly(text);
12193 }
12194 }
12195
12196
12205 {
12206 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12207
12208 if (player)
12209 {
12210 player.MessageImportant(text);
12211 }
12212 }
12213
12215 {
12216 return true;
12217 }
12218
12219
12220 override bool KindOf(
string tag)
12221 {
12222 bool found = false;
12223 string item_name = this.
GetType();
12226
12227 int array_size = item_tag_array.Count();
12228 for (int i = 0; i < array_size; i++)
12229 {
12230 if (item_tag_array.Get(i) == tag)
12231 {
12232 found = true;
12233 break;
12234 }
12235 }
12236 return found;
12237 }
12238
12239
12241 {
12242
12243 super.OnRPC(sender, rpc_type,ctx);
12244
12245
12246 switch (rpc_type)
12247 {
12248 #ifndef SERVER
12249 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12250 Param2<bool, string> p = new Param2<bool, string>(false, "");
12251
12253 return;
12254
12255 bool play = p.param1;
12256 string soundSet = p.param2;
12257
12258 if (play)
12259 {
12261 {
12263 {
12265 }
12266 }
12267 else
12268 {
12270 }
12271 }
12272 else
12273 {
12275 }
12276
12277 break;
12278 #endif
12279
12280 }
12281
12283 {
12285 }
12286 }
12287
12288
12289
12290
12292 {
12293 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12294 return plugin.GetID(
name);
12295 }
12296
12298 {
12299 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12300 return plugin.GetName(id);
12301 }
12302
12305 {
12306
12307
12308 int varFlags;
12309 if (!ctx.
Read(varFlags))
12310 return;
12311
12312 if (varFlags & ItemVariableFlags.FLOAT)
12313 {
12315 }
12316 }
12317
12319 {
12320
12321 super.SerializeNumericalVars(floats_out);
12322
12323
12324
12326 {
12328 }
12329
12331 {
12333 }
12334
12336 {
12338 }
12339
12341 {
12346 }
12347
12349 {
12351 }
12352 }
12353
12355 {
12356
12357 super.DeSerializeNumericalVars(floats);
12358
12359
12360 int index = 0;
12361 int mask = Math.Round(floats.Get(index));
12362
12363 index++;
12364
12366 {
12368 {
12370 }
12371 else
12372 {
12373 float quantity = floats.Get(index);
12374 SetQuantity(quantity,
true,
false,
false,
false);
12375 }
12376 index++;
12377 }
12378
12380 {
12381 float wet = floats.Get(index);
12383 index++;
12384 }
12385
12387 {
12388 int liquidtype = Math.Round(floats.Get(index));
12390 index++;
12391 }
12392
12394 {
12396 index++;
12398 index++;
12400 index++;
12402 index++;
12403 }
12404
12406 {
12407 int cleanness = Math.Round(floats.Get(index));
12409 index++;
12410 }
12411 }
12412
12414 {
12415 super.WriteVarsToCTX(ctx);
12416
12417
12419 {
12421 }
12422
12424 {
12426 }
12427
12429 {
12431 }
12432
12434 {
12435 int r,g,b,a;
12441 }
12442
12444 {
12446 }
12447 }
12448
12450 {
12451 if (!super.ReadVarsFromCTX(ctx,version))
12452 return false;
12453
12454 int intValue;
12455 float value;
12456
12457 if (version < 140)
12458 {
12459 if (!ctx.
Read(intValue))
12460 return false;
12461
12462 m_VariablesMask = intValue;
12463 }
12464
12466 {
12467 if (!ctx.
Read(value))
12468 return false;
12469
12471 {
12473 }
12474 else
12475 {
12477 }
12478 }
12479
12480 if (version < 140)
12481 {
12483 {
12484 if (!ctx.
Read(value))
12485 return false;
12486 SetTemperatureDirect(value);
12487 }
12488 }
12489
12491 {
12492 if (!ctx.
Read(value))
12493 return false;
12495 }
12496
12498 {
12499 if (!ctx.
Read(intValue))
12500 return false;
12502 }
12503
12505 {
12506 int r,g,b,a;
12508 return false;
12510 return false;
12512 return false;
12514 return false;
12515
12517 }
12518
12520 {
12521 if (!ctx.
Read(intValue))
12522 return false;
12524 }
12525
12526 if (version >= 138 && version < 140)
12527 {
12529 {
12530 if (!ctx.
Read(intValue))
12531 return false;
12532 SetFrozen(intValue);
12533 }
12534 }
12535
12536 return true;
12537 }
12538
12539
12541 {
12544 {
12546 }
12547
12548 if (!super.OnStoreLoad(ctx, version))
12549 {
12551 return false;
12552 }
12553
12554 if (version >= 114)
12555 {
12556 bool hasQuickBarIndexSaved;
12557
12558 if (!ctx.
Read(hasQuickBarIndexSaved))
12559 {
12561 return false;
12562 }
12563
12564 if (hasQuickBarIndexSaved)
12565 {
12566 int itmQBIndex;
12567
12568
12569 if (!ctx.
Read(itmQBIndex))
12570 {
12572 return false;
12573 }
12574
12575 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12576 if (itmQBIndex != -1 && parentPlayer)
12577 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12578 }
12579 }
12580 else
12581 {
12582
12583 PlayerBase player;
12584 int itemQBIndex;
12585 if (version ==
int.
MAX)
12586 {
12587 if (!ctx.
Read(itemQBIndex))
12588 {
12590 return false;
12591 }
12592 }
12593 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12594 {
12595
12596 if (!ctx.
Read(itemQBIndex))
12597 {
12599 return false;
12600 }
12601 if (itemQBIndex != -1 && player)
12602 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12603 }
12604 }
12605
12606 if (version < 140)
12607 {
12608
12609 if (!LoadVariables(ctx, version))
12610 {
12612 return false;
12613 }
12614 }
12615
12616
12618 {
12620 return false;
12621 }
12622 if (version >= 132)
12623 {
12625 if (raib)
12626 {
12628 {
12630 return false;
12631 }
12632 }
12633 }
12634
12636 return true;
12637 }
12638
12639
12640
12642 {
12643 super.OnStoreSave(ctx);
12644
12645 PlayerBase player;
12646 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12647 {
12649
12650 int itemQBIndex = -1;
12651 itemQBIndex = player.FindQuickBarEntityIndex(this);
12652 ctx.
Write(itemQBIndex);
12653 }
12654 else
12655 {
12657 }
12658
12660
12662 if (raib)
12663 {
12665 }
12666 }
12667
12668
12670 {
12671 super.AfterStoreLoad();
12672
12674 {
12676 }
12677
12679 {
12682 }
12683 }
12684
12686 {
12687 super.EEOnAfterLoad();
12688
12690 {
12692 }
12693
12696 }
12697
12699 {
12700 return false;
12701 }
12702
12703
12704
12706 {
12708 {
12709 #ifdef PLATFORM_CONSOLE
12710
12712 {
12714 if (menu)
12715 {
12717 }
12718 }
12719 #endif
12720 }
12721
12723 {
12726 }
12727
12729 {
12730 SetWeightDirty();
12732 }
12734 {
12737 }
12738
12740 {
12743 }
12745 {
12748 }
12749
12750 super.OnVariablesSynchronized();
12751 }
12752
12753
12754
12756 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12757 {
12758 if (!IsServerCheck(allow_client))
12759 return false;
12760
12762 return false;
12763
12766
12767 if (value <= (min + 0.001))
12768 value = min;
12769
12770 if (value == min)
12771 {
12772 if (destroy_config)
12773 {
12774 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12775 if (dstr)
12776 {
12778 this.Delete();
12779 return true;
12780 }
12781 }
12782 else if (destroy_forced)
12783 {
12785 this.Delete();
12786 return true;
12787 }
12788
12790 }
12791
12794
12796 {
12798
12799 if (delta)
12801 }
12802
12804
12805 return false;
12806 }
12807
12808
12810 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12811 {
12813 }
12814
12816 {
12819 }
12820
12822 {
12825 }
12826
12829 {
12830 float value_clamped = Math.Clamp(value, 0, 1);
12832 SetQuantity(result, destroy_config, destroy_forced);
12833 }
12834
12835
12838 {
12840 }
12841
12843 {
12845 }
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12857 {
12858 int slot = -1;
12859 if (GetInventory())
12860 {
12861 InventoryLocation il = new InventoryLocation;
12862 GetInventory().GetCurrentInventoryLocation(il);
12864 }
12865
12867 }
12868
12870 {
12871 float quantity_max = 0;
12872
12874 {
12875 if (attSlotID != -1)
12876 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12877
12878 if (quantity_max <= 0)
12880 }
12881
12882 if (quantity_max <= 0)
12884
12885 return quantity_max;
12886 }
12887
12889 {
12891 }
12892
12894 {
12896 }
12897
12898
12900 {
12902 }
12903
12905 {
12907 }
12908
12910 {
12912 }
12913
12914
12916 {
12917
12918 float weightEx = GetWeightEx();
12919 float special = GetInventoryAndCargoWeight();
12920 return weightEx - special;
12921 }
12922
12923
12925 {
12927 }
12928
12930 {
12932 {
12933 #ifdef DEVELOPER
12934 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12935 {
12936 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12938 }
12939 #endif
12940
12941 return GetQuantity() * GetConfigWeightModified();
12942 }
12943 else if (HasEnergyManager())
12944 {
12945 #ifdef DEVELOPER
12946 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12947 {
12948 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12949 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12950 }
12951 #endif
12952 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12953 }
12954 else
12955 {
12956 #ifdef DEVELOPER
12957 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12958 {
12959 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12960 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12961 }
12962 #endif
12963 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12964 }
12965 }
12966
12969 {
12970 int item_count = 0;
12972
12973 if (GetInventory().GetCargo() != NULL)
12974 {
12975 item_count = GetInventory().GetCargo().GetItemCount();
12976 }
12977
12978 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12979 {
12980 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12981 if (item)
12982 item_count += item.GetNumberOfItems();
12983 }
12984 return item_count;
12985 }
12986
12989 {
12990 float weight = 0;
12991 float wetness = 1;
12992 if (include_wetness)
12995 {
12996 weight = wetness * m_ConfigWeight;
12997 }
12999 {
13000 weight = 1;
13001 }
13002 return weight;
13003 }
13004
13005
13006
13008 {
13009 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13010 {
13011 GameInventory inv = GetInventory();
13012 array<EntityAI> items = new array<EntityAI>;
13014 for (int i = 0; i < items.Count(); i++)
13015 {
13017 if (item)
13018 {
13020 }
13021 }
13022 }
13023 }
13024
13025
13026
13027
13029 {
13030 float energy = 0;
13031 if (HasEnergyManager())
13032 {
13033 energy = GetCompEM().GetEnergy();
13034 }
13035 return energy;
13036 }
13037
13038
13040 {
13041 super.OnEnergyConsumed();
13042
13044 }
13045
13047 {
13048 super.OnEnergyAdded();
13049
13051 }
13052
13053
13055 {
13056 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13057 {
13059 {
13060 float energy_0to1 = GetCompEM().GetEnergy0To1();
13062 }
13063 }
13064 }
13065
13066
13068 {
13069 return ConfigGetFloat("heatIsolation");
13070 }
13071
13073 {
13075 }
13076
13078 {
13079 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13080 if (
GetGame().ConfigIsExisting(paramPath))
13082
13083 return 0.0;
13084 }
13085
13087 {
13088 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13089 if (
GetGame().ConfigIsExisting(paramPath))
13091
13092 return 0.0;
13093 }
13094
13095 override void SetWet(
float value,
bool allow_client =
false)
13096 {
13097 if (!IsServerCheck(allow_client))
13098 return;
13099
13102
13104
13105 m_VarWet = Math.Clamp(value, min, max);
13106
13108 {
13111 }
13112 }
13113
13114 override void AddWet(
float value)
13115 {
13117 }
13118
13120 {
13122 }
13123
13125 {
13127 }
13128
13130 {
13132 }
13133
13135 {
13137 }
13138
13140 {
13142 }
13143
13144 override void OnWetChanged(
float newVal,
float oldVal)
13145 {
13148 if (newLevel != oldLevel)
13149 {
13151 }
13152 }
13153
13155 {
13156 SetWeightDirty();
13157 }
13158
13160 {
13161 return GetWetLevelInternal(
m_VarWet);
13162 }
13163
13164
13165
13167 {
13169 }
13170
13172 {
13174 }
13175
13177 {
13179 }
13180
13182 {
13184 }
13185
13186
13187
13189 {
13190 if (ConfigIsExisting("itemModelLength"))
13191 {
13192 return ConfigGetFloat("itemModelLength");
13193 }
13194 return 0;
13195 }
13196
13198 {
13199 if (ConfigIsExisting("itemAttachOffset"))
13200 {
13201 return ConfigGetFloat("itemAttachOffset");
13202 }
13203 return 0;
13204 }
13205
13206 override void SetCleanness(
int value,
bool allow_client =
false)
13207 {
13208 if (!IsServerCheck(allow_client))
13209 return;
13210
13212
13214
13217 }
13218
13220 {
13222 }
13223
13225 {
13226 return true;
13227 }
13228
13229
13230
13231
13233 {
13235 }
13236
13238 {
13240 }
13241
13242
13243
13244
13245 override void SetColor(
int r,
int g,
int b,
int a)
13246 {
13252 }
13254 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13255 {
13260 }
13261
13263 {
13265 }
13266
13269 {
13270 int r,g,b,a;
13272 r = r/255;
13273 g = g/255;
13274 b = b/255;
13275 a = a/255;
13276 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13277 }
13278
13279
13280
13281 override void SetLiquidType(
int value,
bool allow_client =
false)
13282 {
13283 if (!IsServerCheck(allow_client))
13284 return;
13285
13290 }
13291
13293 {
13294 return ConfigGetInt("varLiquidTypeInit");
13295 }
13296
13298 {
13300 }
13301
13303 {
13305 SetFrozen(false);
13306 }
13307
13310 {
13311 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13312 }
13313
13314
13317 {
13318 PlayerBase nplayer;
13319 if (PlayerBase.CastTo(nplayer, player))
13320 {
13322
13323 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13324 }
13325 }
13326
13327
13330 {
13331 PlayerBase nplayer;
13332 if (PlayerBase.CastTo(nplayer,player))
13333 {
13334
13335 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13336
13337 }
13338
13339
13340 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13341
13342
13343 if (HasEnergyManager())
13344 {
13345 GetCompEM().UpdatePlugState();
13346 }
13347 }
13348
13349
13351 {
13352 super.OnPlacementStarted(player);
13353
13355 }
13356
13357 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13358 {
13360 {
13361 m_AdminLog.OnPlacementComplete(player,
this);
13362 }
13363
13364 super.OnPlacementComplete(player, position, orientation);
13365 }
13366
13367
13368
13369
13370
13372 {
13374 {
13375 return true;
13376 }
13377 else
13378 {
13379 return false;
13380 }
13381 }
13382
13383
13385 {
13387 {
13389 }
13390 }
13391
13392
13394 {
13396 }
13397
13399 {
13401 }
13402
13403 override void InsertAgent(
int agent,
float count = 1)
13404 {
13405 if (count < 1)
13406 return;
13407
13409 }
13410
13413 {
13415 }
13416
13417
13419 {
13421 }
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13465 {
13467 return false;
13468 return true;
13469 }
13470
13472 {
13473
13475 }
13476
13477
13480 {
13481 super.CheckForRoofLimited(timeTresholdMS);
13482
13484 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13485 {
13486 m_PreviousRoofTestTime = time;
13487 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13488 }
13489 }
13490
13491
13493 {
13495 {
13496 return 0;
13497 }
13498
13499 if (GetInventory().GetAttachmentSlotsCount() != 0)
13500 {
13501 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13502 if (filter)
13503 return filter.GetProtectionLevel(type, false, system);
13504 else
13505 return 0;
13506 }
13507
13508 string subclassPath, entryName;
13509
13510 switch (type)
13511 {
13513 entryName = "biological";
13514 break;
13516 entryName = "chemical";
13517 break;
13518 default:
13519 entryName = "biological";
13520 break;
13521 }
13522
13523 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13524
13526 }
13527
13528
13529
13532 {
13533 if (!IsMagazine())
13535
13537 }
13538
13539
13540
13541
13542
13547 {
13548 return true;
13549 }
13550
13552 {
13554 }
13555
13556
13557
13558
13559
13561 {
13562 if (parent)
13563 {
13564 if (parent.IsInherited(DayZInfected))
13565 return true;
13566
13567 if (!parent.IsRuined())
13568 return true;
13569 }
13570
13571 return true;
13572 }
13573
13575 {
13576 if (!super.CanPutAsAttachment(parent))
13577 {
13578 return false;
13579 }
13580
13581 if (!IsRuined() && !parent.IsRuined())
13582 {
13583 return true;
13584 }
13585
13586 return false;
13587 }
13588
13590 {
13591
13592
13593
13594
13595 return super.CanReceiveItemIntoCargo(item);
13596 }
13597
13599 {
13600
13601
13602
13603
13604 GameInventory attachmentInv = attachment.GetInventory();
13606 {
13607 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13608 return false;
13609 }
13610
13611 InventoryLocation loc = new InventoryLocation();
13612 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13613 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13614 return false;
13615
13616 return super.CanReceiveAttachment(attachment, slotId);
13617 }
13618
13620 {
13621 if (!super.CanReleaseAttachment(attachment))
13622 return false;
13623
13624 return GetInventory().AreChildrenAccessible();
13625 }
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13648 {
13649 int id = muzzle_owner.GetMuzzleID();
13650 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13651
13652 if (WPOF_array)
13653 {
13654 for (int i = 0; i < WPOF_array.Count(); i++)
13655 {
13656 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13657
13658 if (WPOF)
13659 {
13660 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13661 }
13662 }
13663 }
13664 }
13665
13666
13668 {
13669 int id = muzzle_owner.GetMuzzleID();
13671
13672 if (WPOBE_array)
13673 {
13674 for (int i = 0; i < WPOBE_array.Count(); i++)
13675 {
13676 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13677
13678 if (WPOBE)
13679 {
13680 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13681 }
13682 }
13683 }
13684 }
13685
13686
13688 {
13689 int id = muzzle_owner.GetMuzzleID();
13690 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13691
13692 if (WPOOH_array)
13693 {
13694 for (int i = 0; i < WPOOH_array.Count(); i++)
13695 {
13696 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13697
13698 if (WPOOH)
13699 {
13700 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13701 }
13702 }
13703 }
13704 }
13705
13706
13708 {
13709 int id = muzzle_owner.GetMuzzleID();
13710 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13711
13712 if (WPOOH_array)
13713 {
13714 for (int i = 0; i < WPOOH_array.Count(); i++)
13715 {
13716 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13717
13718 if (WPOOH)
13719 {
13720 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13721 }
13722 }
13723 }
13724 }
13725
13726
13728 {
13729 int id = muzzle_owner.GetMuzzleID();
13730 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13731
13732 if (WPOOH_array)
13733 {
13734 for (int i = 0; i < WPOOH_array.Count(); i++)
13735 {
13736 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13737
13738 if (WPOOH)
13739 {
13740 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13741 }
13742 }
13743 }
13744 }
13745
13746
13747
13749 {
13751 {
13752 return true;
13753 }
13754
13755 return false;
13756 }
13757
13759 {
13761 {
13762 return true;
13763 }
13764
13765 return false;
13766 }
13767
13769 {
13771 {
13772 return true;
13773 }
13774
13775 return false;
13776 }
13777
13779 {
13780 return false;
13781 }
13782
13785 {
13786 return UATimeSpent.DEFAULT_DEPLOY;
13787 }
13788
13789
13790
13791
13793 {
13795 SetSynchDirty();
13796 }
13797
13799 {
13801 }
13802
13803
13805 {
13806 return false;
13807 }
13808
13811 {
13812 string att_type = "None";
13813
13814 if (ConfigIsExisting("soundAttType"))
13815 {
13816 att_type = ConfigGetString("soundAttType");
13817 }
13818
13820 }
13821
13823 {
13825 }
13826
13827
13828
13829
13830
13834
13836 {
13839
13841 }
13842
13843
13845 {
13847 return;
13848
13850
13853
13856
13857 SoundParameters params = new SoundParameters();
13861 }
13862
13863
13865 {
13867 return;
13868
13870 SetSynchDirty();
13871
13874 }
13875
13876
13878 {
13880 return;
13881
13883 SetSynchDirty();
13884
13887 }
13888
13890 {
13892 }
13893
13895 {
13897 }
13898
13901 {
13902 if (!
GetGame().IsDedicatedServer())
13903 {
13904 if (ConfigIsExisting("attachSoundSet"))
13905 {
13906 string cfg_path = "";
13907 string soundset = "";
13908 string type_name =
GetType();
13909
13912 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13913 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13914
13915 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13916 {
13917 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13918 {
13919 if (cfg_slot_array[i] == slot_type)
13920 {
13921 soundset = cfg_soundset_array[i];
13922 break;
13923 }
13924 }
13925 }
13926
13927 if (soundset != "")
13928 {
13929 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13931 }
13932 }
13933 }
13934 }
13935
13937 {
13938
13939 }
13940
13941 void OnApply(PlayerBase player);
13942
13944 {
13945 return 1.0;
13946 };
13947
13949 {
13951 }
13952
13954 {
13956 }
13957
13959
13961 {
13962 SetDynamicPhysicsLifeTime(0.01);
13964 }
13965
13967 {
13968 array<string> zone_names = new array<string>;
13969 GetDamageZones(zone_names);
13970 for (int i = 0; i < zone_names.Count(); i++)
13971 {
13972 SetHealthMax(zone_names.Get(i),"Health");
13973 }
13974 SetHealthMax("","Health");
13975 }
13976
13979 {
13980 float global_health = GetHealth01("","Health");
13981 array<string> zones = new array<string>;
13982 GetDamageZones(zones);
13983
13984 for (int i = 0; i < zones.Count(); i++)
13985 {
13986 SetHealth01(zones.Get(i),"Health",global_health);
13987 }
13988 }
13989
13992 {
13993 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13994 }
13995
13997 {
13998 if (!hasRootAsPlayer)
13999 {
14000 if (refParentIB)
14001 {
14002
14003 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14004 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14005
14006 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14007 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14008
14011 }
14012 else
14013 {
14014
14017 }
14018 }
14019 }
14020
14022 {
14024 {
14025 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14026 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
14027 {
14028 float heatPermCoef = 1.0;
14030 while (ent)
14031 {
14032 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14033 ent = ent.GetHierarchyParent();
14034 }
14035
14036 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14037 }
14038 }
14039 }
14040
14042 {
14043
14044 EntityAI parent = GetHierarchyParent();
14045 if (!parent)
14046 {
14047 hasParent = false;
14048 hasRootAsPlayer = false;
14049 }
14050 else
14051 {
14052 hasParent = true;
14053 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14054 refParentIB =
ItemBase.Cast(parent);
14055 }
14056 }
14057
14058 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14059 {
14060
14061 }
14062
14064 {
14065
14066 return false;
14067 }
14068
14070 {
14071
14072
14073 return false;
14074 }
14075
14077 {
14078
14079 return false;
14080 }
14081
14084 {
14085 return !GetIsFrozen() &&
IsOpen();
14086 }
14087
14089 {
14090 bool hasParent = false, hasRootAsPlayer = false;
14092
14093 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14094 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14095
14096 if (wwtu || foodDecay)
14097 {
14101
14102 if (processWetness || processTemperature || processDecay)
14103 {
14105
14106 if (processWetness)
14107 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14108
14109 if (processTemperature)
14111
14112 if (processDecay)
14113 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14114 }
14115 }
14116 }
14117
14120 {
14122 }
14123
14125 {
14128
14129 return super.GetTemperatureFreezeThreshold();
14130 }
14131
14133 {
14136
14137 return super.GetTemperatureThawThreshold();
14138 }
14139
14141 {
14144
14145 return super.GetItemOverheatThreshold();
14146 }
14147
14149 {
14151 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14152
14153 return super.GetTemperatureFreezeTime();
14154 }
14155
14157 {
14159 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14160
14161 return super.GetTemperatureThawTime();
14162 }
14163
14168
14170 {
14171 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14172 }
14173
14175 {
14176 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14177 }
14178
14181 {
14183 }
14184
14186 {
14188 }
14189
14191 {
14193 }
14194
14197 {
14198 return null;
14199 }
14200
14203 {
14204 return false;
14205 }
14206
14208 {
14210 {
14213 if (!trg)
14214 {
14216 explosive = this;
14217 }
14218
14219 explosive.PairRemote(trg);
14221
14222 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14223 trg.SetPersistentPairID(persistentID);
14224 explosive.SetPersistentPairID(persistentID);
14225
14226 return true;
14227 }
14228 return false;
14229 }
14230
14233 {
14234 float ret = 1.0;
14237 ret *= GetHealth01();
14238
14239 return ret;
14240 }
14241
14242 #ifdef DEVELOPER
14243 override void SetDebugItem()
14244 {
14245 super.SetDebugItem();
14246 _itemBase = this;
14247 }
14248
14250 {
14251 string text = super.GetDebugText();
14252
14254 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14255
14256 return text;
14257 }
14258 #endif
14259
14261 {
14262 return true;
14263 }
14264
14266
14268
14270 {
14273 }
14274
14275
14283
14299}
14300
14302{
14304 if (entity)
14305 {
14306 bool is_item = entity.IsInherited(
ItemBase);
14307 if (is_item && full_quantity)
14308 {
14311 }
14312 }
14313 else
14314 {
14316 return NULL;
14317 }
14318 return entity;
14319}
14320
14322{
14323 if (item)
14324 {
14325 if (health > 0)
14326 item.SetHealth("", "", health);
14327
14328 if (item.CanHaveTemperature())
14329 {
14331 if (item.CanFreeze())
14332 item.SetFrozen(false);
14333 }
14334
14335 if (item.HasEnergyManager())
14336 {
14337 if (quantity >= 0)
14338 {
14339 item.GetCompEM().SetEnergy0To1(quantity);
14340 }
14341 else
14342 {
14344 }
14345 }
14346 else if (item.IsMagazine())
14347 {
14348 Magazine mag = Magazine.Cast(item);
14349 if (quantity >= 0)
14350 {
14351 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14352 }
14353 else
14354 {
14356 }
14357
14358 }
14359 else
14360 {
14361 if (quantity >= 0)
14362 {
14363 item.SetQuantityNormalized(quantity, false);
14364 }
14365 else
14366 {
14368 }
14369
14370 }
14371 }
14372}
14373
14374#ifdef DEVELOPER
14376#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.