9572{
9574 {
9575 return true;
9576 }
9577};
9578
9579
9580
9582{
9586
9588
9591
9592
9593
9594
9595
9604
9610
9615
9620
9641 protected bool m_IsResultOfSplit
9642
9644
9649
9650
9651
9653
9657
9658
9659
9661
9664
9665
9666
9672
9673
9681
9684
9685
9687
9688
9690
9691
9696
9697
9702
9703
9705
9706
9708 {
9713
9714 if (!
GetGame().IsDedicatedServer())
9715 {
9717 {
9719
9721 {
9723 }
9724 }
9725
9728 }
9729
9730 m_OldLocation = null;
9731
9733 {
9735 }
9736
9737 if (ConfigIsExisting("headSelectionsToHide"))
9738 {
9741 }
9742
9744 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9745 {
9747 }
9748
9750
9751 m_IsResultOfSplit = false;
9752
9754 }
9755
9757 {
9758 super.InitItemVariables();
9759
9765 m_Count = ConfigGetInt(
"count");
9766
9769
9774
9777
9782
9794
9798
9799
9802 if (ConfigIsExisting("canBeSplit"))
9803 {
9806 }
9807
9809 if (ConfigIsExisting("itemBehaviour"))
9811
9812
9815 RegisterNetSyncVariableInt("m_VarLiquidType");
9816 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9817
9818 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9819 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9820 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9821
9822 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9823 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9824 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9825 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9826
9827 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9828 RegisterNetSyncVariableBool("m_IsTakeable");
9829 RegisterNetSyncVariableBool("m_IsHologram");
9830
9833 {
9836 }
9837
9839
9841 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9843
9844 }
9845
9847 {
9849 }
9850
9852 {
9855 {
9860 }
9861 }
9862
9863 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9864 {
9866 {
9869 }
9870
9872 }
9873
9875 {
9881 }
9882
9884
9886 {
9888
9889 if (!action)
9890 {
9891 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9892 return;
9893 }
9894
9896 if (!ai)
9897 {
9899 return;
9900 }
9901
9903 if (!action_array)
9904 {
9905 action_array = new array<ActionBase_Basic>;
9907 }
9908 if (LogManager.IsActionLogEnable())
9909 {
9910 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9911 }
9912
9913 if (action_array.Find(action) != -1)
9914 {
9915 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9916 }
9917 else
9918 {
9919 action_array.Insert(action);
9920 }
9921 }
9922
9924 {
9926 ActionBase action = player.GetActionManager().GetAction(actionName);
9929
9930 if (action_array)
9931 {
9932 action_array.RemoveItem(action);
9933 }
9934 }
9935
9936
9937
9939 {
9940 ActionOverrideData overrideData = new ActionOverrideData();
9944
9946 if (!actionMap)
9947 {
9950 }
9951
9952 actionMap.Insert(this.
Type(), overrideData);
9953
9954 }
9955
9957
9959
9960
9962 {
9965
9968
9969 string config_to_search = "CfgVehicles";
9970 string muzzle_owner_config;
9971
9973 {
9974 if (IsInherited(Weapon))
9975 config_to_search = "CfgWeapons";
9976
9977 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9978
9979 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9980
9982
9983 if (config_OnFire_subclass_count > 0)
9984 {
9985 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9986
9987 for (int i = 0; i < config_OnFire_subclass_count; i++)
9988 {
9989 string particle_class = "";
9991 string config_OnFire_entry = config_OnFire_class + particle_class;
9992 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9993 WPOF_array.Insert(WPOF);
9994 }
9995
9996
9998 }
9999 }
10000
10002 {
10003 config_to_search = "CfgWeapons";
10004 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10005
10006 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10007
10009
10010 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10011 {
10012 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10013
10014 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10015 {
10016 string particle_class2 = "";
10018 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10019 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10020 WPOBE_array.Insert(WPOBE);
10021 }
10022
10023
10025 }
10026 }
10027 }
10028
10029
10031 {
10034
10036 {
10037 string config_to_search = "CfgVehicles";
10038
10039 if (IsInherited(Weapon))
10040 config_to_search = "CfgWeapons";
10041
10042 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10043 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10044
10045 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10046 {
10047
10049
10051 {
10053 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10055 return;
10056 }
10057
10060
10061
10062
10064 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10065
10066 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10067 {
10068 string particle_class = "";
10070 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10072
10073 if (entry_type == CT_CLASS)
10074 {
10075 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10076 WPOOH_array.Insert(WPOF);
10077 }
10078 }
10079
10080
10082 }
10083 }
10084 }
10085
10087 {
10089 }
10090
10092 {
10094 {
10096
10099
10102
10103 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10104 }
10105 }
10106
10108 {
10110 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10111
10113 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10114
10116 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10117
10119 {
10121 }
10122 }
10123
10125 {
10127 }
10128
10130 {
10133 else
10135
10137 {
10140 }
10141 else
10142 {
10145
10148 }
10149
10151 }
10152
10154 {
10156 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10157 }
10158
10160 {
10162 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10164 }
10165
10167 {
10169 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10170 }
10171
10173 {
10176
10177 OverheatingParticle OP = new OverheatingParticle();
10182
10184 }
10185
10187 {
10190
10191 return -1;
10192 }
10193
10195 {
10197 {
10200
10201 for (int i = count; i > 0; --i)
10202 {
10203 int id = i - 1;
10206
10209
10210 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10211 {
10212 if (p)
10213 {
10216 }
10217 }
10218 }
10219 }
10220 }
10221
10223 {
10225 {
10227 {
10228 int id = i - 1;
10230
10231 if (OP)
10232 {
10234
10235 if (p)
10236 {
10238 }
10239
10240 delete OP;
10241 }
10242 }
10243
10246 }
10247 }
10248
10251 {
10252 return 0.0;
10253 }
10254
10255
10257 {
10258 return 250;
10259 }
10260
10262 {
10263 return 0;
10264 }
10265
10268 {
10270 return true;
10271
10272 return false;
10273 }
10274
10277 {
10280
10282 {
10284 }
10285 else
10286 {
10287
10289 }
10290
10292 }
10293
10300 {
10301 return -1;
10302 }
10303
10304
10305
10306
10308 {
10310 {
10312 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10313
10314 if (r_index >= 0)
10315 {
10316 InventoryLocation r_il = new InventoryLocation;
10317 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10318
10319 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10322 {
10323 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10324 }
10326 {
10327 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10328 }
10329
10330 }
10331
10332 player.GetHumanInventory().ClearUserReservedLocation(this);
10333 }
10334
10337 }
10338
10339
10340
10341
10343 {
10344 return ItemBase.m_DebugActionsMask;
10345 }
10346
10348 {
10349 return ItemBase.m_DebugActionsMask & mask;
10350 }
10351
10353 {
10354 ItemBase.m_DebugActionsMask = mask;
10355 }
10356
10358 {
10359 ItemBase.m_DebugActionsMask |= mask;
10360 }
10361
10363 {
10364 ItemBase.m_DebugActionsMask &= ~mask;
10365 }
10366
10368 {
10370 {
10372 }
10373 else
10374 {
10376 }
10377 }
10378
10379
10381 {
10382 if (GetEconomyProfile())
10383 {
10384 float q_max = GetEconomyProfile().GetQuantityMax();
10385 if (q_max > 0)
10386 {
10387 float q_min = GetEconomyProfile().GetQuantityMin();
10388 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10389
10391 {
10392 ComponentEnergyManager comp = GetCompEM();
10394 {
10396 }
10397 }
10399 {
10401
10402 }
10403
10404 }
10405 }
10406 }
10407
10410 {
10411 EntityAI parent = GetHierarchyParent();
10412
10413 if (parent)
10414 {
10415 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10416 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10417 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10418 }
10419 }
10420
10423 {
10424 EntityAI parent = GetHierarchyParent();
10425
10426 if (parent)
10427 {
10428 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10429 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10430 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10431 }
10432 }
10433
10435 {
10436
10437
10438
10439
10441
10443 {
10444 if (ScriptInputUserData.CanStoreInputUserData())
10445 {
10446 ScriptInputUserData ctx = new ScriptInputUserData;
10452 ctx.
Write(use_stack_max);
10455
10457 {
10458 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10459 }
10460 }
10461 }
10462 else if (!
GetGame().IsMultiplayer())
10463 {
10465 }
10466 }
10467
10469 {
10471 }
10472
10474 {
10476 }
10477
10479 {
10481 }
10482
10484 {
10485
10486 return false;
10487 }
10488
10490 {
10491 return false;
10492 }
10493
10497 {
10498 return false;
10499 }
10500
10502 {
10503 return "";
10504 }
10505
10507
10509 {
10510 return false;
10511 }
10512
10514 {
10515 return true;
10516 }
10517
10518
10519
10521 {
10522 return true;
10523 }
10524
10526 {
10527 return true;
10528 }
10529
10531 {
10532 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10534 }
10535
10537 {
10539 }
10540
10542 {
10544 if (!is_being_placed)
10546 SetSynchDirty();
10547 }
10548
10549
10551
10553 {
10555 }
10556
10558 {
10560 }
10561
10563 {
10564 return 1;
10565 }
10566
10568 {
10569 return false;
10570 }
10571
10573 {
10575 SetSynchDirty();
10576 }
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10613 {
10614 super.OnMovedInsideCargo(container);
10615
10616 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10617 }
10618
10619 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10620 {
10621 super.EEItemLocationChanged(oldLoc,newLoc);
10622
10623 PlayerBase new_player = null;
10624 PlayerBase old_player = null;
10625
10626 if (newLoc.GetParent())
10627 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10628
10629 if (oldLoc.GetParent())
10630 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10631
10633 {
10634 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10635
10636 if (r_index >= 0)
10637 {
10638 InventoryLocation r_il = new InventoryLocation;
10639 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10640
10641 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10644 {
10645 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10646 }
10648 {
10649 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10650 }
10651
10652 }
10653 }
10654
10656 {
10657 if (new_player)
10658 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10659
10660 if (new_player == old_player)
10661 {
10662
10663 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10664 {
10666 {
10667 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10668 {
10669 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10670 }
10671 }
10672 else
10673 {
10674 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10675 }
10676 }
10677
10678 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10679 {
10680 int type = oldLoc.GetType();
10682 {
10683 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10684 }
10686 {
10687 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10688 }
10689 }
10690 if (!m_OldLocation)
10691 {
10692 m_OldLocation = new InventoryLocation;
10693 }
10694 m_OldLocation.Copy(oldLoc);
10695 }
10696 else
10697 {
10698 if (m_OldLocation)
10699 {
10700 m_OldLocation.Reset();
10701 }
10702 }
10703
10705 }
10706 else
10707 {
10708 if (new_player)
10709 {
10710 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10711 if (res_index >= 0)
10712 {
10713 InventoryLocation il = new InventoryLocation;
10714 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10716 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10719 {
10720 il.
GetParent().GetOnReleaseLock().Invoke(it);
10721 }
10723 {
10725 }
10726
10727 }
10728 }
10730 {
10731
10733 }
10734
10735 if (m_OldLocation)
10736 {
10737 m_OldLocation.Reset();
10738 }
10739 }
10740 }
10741
10742 override void EOnContact(IEntity other, Contact extra)
10743 {
10745 {
10746 int liquidType = -1;
10748 if (impactSpeed > 0.0)
10749 {
10751 #ifndef SERVER
10753 #else
10755 SetSynchDirty();
10756 #endif
10758 }
10759 }
10760
10761 #ifdef SERVER
10762 if (GetCompEM() && GetCompEM().IsPlugged())
10763 {
10764 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10765 GetCompEM().UnplugThis();
10766 }
10767 #endif
10768 }
10769
10771
10773 {
10775 }
10776
10778 {
10779
10780 }
10781
10783 {
10784 super.OnItemLocationChanged(old_owner, new_owner);
10785
10786 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10787 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10788
10789 if (!relatedPlayer && playerNew)
10790 relatedPlayer = playerNew;
10791
10792 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10793 {
10795 if (actionMgr)
10796 {
10797 ActionBase currentAction = actionMgr.GetRunningAction();
10798 if (currentAction)
10800 }
10801 }
10802
10803 Man ownerPlayerOld = null;
10804 Man ownerPlayerNew = null;
10805
10806 if (old_owner)
10807 {
10808 if (old_owner.
IsMan())
10809 {
10810 ownerPlayerOld = Man.Cast(old_owner);
10811 }
10812 else
10813 {
10814 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10815 }
10816 }
10817 else
10818 {
10820 {
10822
10823 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10824 {
10825 GetCompEM().UnplugThis();
10826 }
10827 }
10828 }
10829
10830 if (new_owner)
10831 {
10832 if (new_owner.
IsMan())
10833 {
10834 ownerPlayerNew = Man.Cast(new_owner);
10835 }
10836 else
10837 {
10838 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10839 }
10840 }
10841
10842 if (ownerPlayerOld != ownerPlayerNew)
10843 {
10844 if (ownerPlayerOld)
10845 {
10846 array<EntityAI> subItemsExit = new array<EntityAI>;
10848 for (int i = 0; i < subItemsExit.Count(); i++)
10849 {
10852 }
10853 }
10854
10855 if (ownerPlayerNew)
10856 {
10857 array<EntityAI> subItemsEnter = new array<EntityAI>;
10859 for (int j = 0; j < subItemsEnter.Count(); j++)
10860 {
10863 }
10864 }
10865 }
10866 else if (ownerPlayerNew != null)
10867 {
10868 PlayerBase nplayer;
10869 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10870 {
10871 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10873 for (int k = 0; k < subItemsUpdate.Count(); k++)
10874 {
10876 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10877 }
10878 }
10879 }
10880
10881 if (old_owner)
10882 old_owner.OnChildItemRemoved(this);
10883 if (new_owner)
10884 new_owner.OnChildItemReceived(this);
10885 }
10886
10887
10889 {
10890 super.EEDelete(parent);
10891 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10892 if (player)
10893 {
10895
10896 if (player.IsAlive())
10897 {
10898 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10899 if (r_index >= 0)
10900 {
10901 InventoryLocation r_il = new InventoryLocation;
10902 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10903
10904 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10907 {
10908 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10909 }
10911 {
10912 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10913 }
10914
10915 }
10916
10917 player.RemoveQuickBarEntityShortcut(this);
10918 }
10919 }
10920 }
10921
10923 {
10924 super.EEKilled(killer);
10925
10928 {
10929 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10930 {
10931 if (IsMagazine())
10932 {
10933 if (Magazine.Cast(this).GetAmmoCount() > 0)
10934 {
10936 }
10937 }
10938 else
10939 {
10941 }
10942 }
10943 }
10944 }
10945
10947 {
10948 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10949
10950 super.OnWasAttached(parent, slot_id);
10951
10954
10956 }
10957
10959 {
10960 super.OnWasDetached(parent, slot_id);
10961
10964 }
10965
10967 {
10968 int idx;
10971
10972 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10973 if (inventory_slots.Count() < 1)
10974 {
10975 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10976 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10977 }
10978 else
10979 {
10980 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10981 }
10982
10983 idx = inventory_slots.Find(slot);
10984 if (idx < 0)
10985 return "";
10986
10987 return attach_types.Get(idx);
10988 }
10989
10991 {
10992 int idx = -1;
10993 string slot;
10994
10997
10998 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10999 if (inventory_slots.Count() < 1)
11000 {
11001 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11002 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11003 }
11004 else
11005 {
11006 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11007 if (detach_types.Count() < 1)
11008 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11009 }
11010
11011 for (int i = 0; i < inventory_slots.Count(); i++)
11012 {
11013 slot = inventory_slots.Get(i);
11014 }
11015
11016 if (slot != "")
11017 {
11018 if (detach_types.Count() == 1)
11019 idx = 0;
11020 else
11021 idx = inventory_slots.Find(slot);
11022 }
11023 if (idx < 0)
11024 return "";
11025
11026 return detach_types.Get(idx);
11027 }
11028
11030 {
11031
11033
11034
11035 float min_time = 1;
11036 float max_time = 3;
11037 float delay = Math.RandomFloat(min_time, max_time);
11038
11039 explode_timer.Run(delay, this, "DoAmmoExplosion");
11040 }
11041
11043 {
11044 Magazine magazine = Magazine.Cast(this);
11045 int pop_sounds_count = 6;
11046 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11047
11048
11049 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11050 string sound_name = pop_sounds[ sound_idx ];
11052
11053
11054 magazine.ServerAddAmmoCount(-1);
11055
11056
11057 float min_temp_to_explode = 100;
11058
11059 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11060 {
11062 }
11063 }
11064
11065
11066 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11067 {
11068 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11069
11070 const int CHANCE_DAMAGE_CARGO = 4;
11071 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11072 const int CHANCE_DAMAGE_NOTHING = 2;
11073
11075 {
11076 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11077 int chances;
11078 int rnd;
11079
11080 if (GetInventory().GetCargo())
11081 {
11082 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11083 rnd = Math.RandomInt(0,chances);
11084
11085 if (rnd < CHANCE_DAMAGE_CARGO)
11086 {
11088 }
11089 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11090 {
11092 }
11093 }
11094 else
11095 {
11096 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11097 rnd = Math.RandomInt(0,chances);
11098
11099 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11100 {
11102 }
11103 }
11104 }
11105 }
11106
11108 {
11109 if (GetInventory().GetCargo())
11110 {
11111 int item_count = GetInventory().GetCargo().GetItemCount();
11112 if (item_count > 0)
11113 {
11114 int random_pick = Math.RandomInt(0, item_count);
11116 if (!item.IsExplosive())
11117 {
11118 item.AddHealth("","",damage);
11119 return true;
11120 }
11121 }
11122 }
11123 return false;
11124 }
11125
11127 {
11128 int attachment_count = GetInventory().AttachmentCount();
11129 if (attachment_count > 0)
11130 {
11131 int random_pick = Math.RandomInt(0, attachment_count);
11132 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11133 if (!attachment.IsExplosive())
11134 {
11135 attachment.AddHealth("","",damage);
11136 return true;
11137 }
11138 }
11139 return false;
11140 }
11141
11143 {
11145 }
11146
11148 {
11150 return GetInventory().CanRemoveEntity();
11151
11152 return false;
11153 }
11154
11156 {
11157
11159 return false;
11160
11161
11163 return false;
11164
11165
11166
11168 if (delta == 0)
11169 return false;
11170
11171
11172 return true;
11173 }
11174
11176 {
11178 {
11179 if (ScriptInputUserData.CanStoreInputUserData())
11180 {
11181 ScriptInputUserData ctx = new ScriptInputUserData;
11186 ctx.
Write(destination_entity);
11188 ctx.
Write(slot_id);
11190 }
11191 }
11192 else if (!
GetGame().IsMultiplayer())
11193 {
11195 }
11196 }
11197
11199 {
11200 float split_quantity_new;
11204 InventoryLocation loc = new InventoryLocation;
11205
11206 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11207 {
11209 split_quantity_new = stack_max;
11210 else
11212
11214 {
11215 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11216 if (new_item)
11217 {
11218 new_item.SetResultOfSplit(true);
11219 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11221 new_item.
SetQuantity(split_quantity_new,
false,
true);
11222 }
11223 }
11224 }
11225 else if (destination_entity && slot_id == -1)
11226 {
11227 if (quantity > stack_max)
11228 split_quantity_new = stack_max;
11229 else
11230 split_quantity_new = quantity;
11231
11233 {
11235 {
11238 }
11239
11240 if (new_item)
11241 {
11242 new_item.SetResultOfSplit(true);
11243 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11245 new_item.
SetQuantity(split_quantity_new,
false,
true);
11246 }
11247 }
11248 }
11249 else
11250 {
11251 if (stack_max != 0)
11252 {
11254 {
11256 }
11257
11258 if (split_quantity_new == 0)
11259 {
11260 if (!
GetGame().IsMultiplayer())
11261 player.PhysicalPredictiveDropItem(this);
11262 else
11263 player.ServerDropEntity(this);
11264 return;
11265 }
11266
11268 {
11270
11271 if (new_item)
11272 {
11273 new_item.SetResultOfSplit(true);
11274 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11277 new_item.PlaceOnSurface();
11278 }
11279 }
11280 }
11281 }
11282 }
11283
11285 {
11286 float split_quantity_new;
11290 InventoryLocation loc = new InventoryLocation;
11291
11292 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11293 {
11295 split_quantity_new = stack_max;
11296 else
11298
11300 {
11301 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11302 if (new_item)
11303 {
11304 new_item.SetResultOfSplit(true);
11305 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11307 new_item.
SetQuantity(split_quantity_new,
false,
true);
11308 }
11309 }
11310 }
11311 else if (destination_entity && slot_id == -1)
11312 {
11313 if (quantity > stack_max)
11314 split_quantity_new = stack_max;
11315 else
11316 split_quantity_new = quantity;
11317
11319 {
11321 {
11324 }
11325
11326 if (new_item)
11327 {
11328 new_item.SetResultOfSplit(true);
11329 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11331 new_item.
SetQuantity(split_quantity_new,
false,
true);
11332 }
11333 }
11334 }
11335 else
11336 {
11337 if (stack_max != 0)
11338 {
11340 {
11342 }
11343
11345 {
11347
11348 if (new_item)
11349 {
11350 new_item.SetResultOfSplit(true);
11351 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11354 new_item.PlaceOnSurface();
11355 }
11356 }
11357 }
11358 }
11359 }
11360
11362 {
11364 {
11365 if (ScriptInputUserData.CanStoreInputUserData())
11366 {
11367 ScriptInputUserData ctx = new ScriptInputUserData;
11372 dst.WriteToContext(ctx);
11374 }
11375 }
11376 else if (!
GetGame().IsMultiplayer())
11377 {
11379 }
11380 }
11381
11383 {
11385 {
11386 if (ScriptInputUserData.CanStoreInputUserData())
11387 {
11388 ScriptInputUserData ctx = new ScriptInputUserData;
11393 ctx.
Write(destination_entity);
11399 }
11400 }
11401 else if (!
GetGame().IsMultiplayer())
11402 {
11404 }
11405 }
11406
11408 {
11410 }
11411
11413 {
11415 float split_quantity_new;
11417 if (dst.IsValid())
11418 {
11419 int slot_id = dst.GetSlot();
11421
11422 if (quantity > stack_max)
11423 split_quantity_new = stack_max;
11424 else
11425 split_quantity_new = quantity;
11426
11428 {
11430
11431 if (new_item)
11432 {
11433 new_item.SetResultOfSplit(true);
11434 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11436 new_item.
SetQuantity(split_quantity_new,
false,
true);
11437 }
11438
11439 return new_item;
11440 }
11441 }
11442
11443 return null;
11444 }
11445
11447 {
11449 float split_quantity_new;
11451 if (destination_entity)
11452 {
11454 if (quantity > stackable)
11455 split_quantity_new = stackable;
11456 else
11457 split_quantity_new = quantity;
11458
11460 {
11461 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11462 if (new_item)
11463 {
11464 new_item.SetResultOfSplit(true);
11465 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11467 new_item.
SetQuantity(split_quantity_new,
false,
true);
11468 }
11469 }
11470 }
11471 }
11472
11474 {
11476 {
11477 if (ScriptInputUserData.CanStoreInputUserData())
11478 {
11479 ScriptInputUserData ctx = new ScriptInputUserData;
11484 ItemBase destination_entity =
this;
11485 ctx.
Write(destination_entity);
11489 }
11490 }
11491 else if (!
GetGame().IsMultiplayer())
11492 {
11494 }
11495 }
11496
11498 {
11500 float split_quantity_new;
11502 if (player)
11503 {
11505 if (quantity > stackable)
11506 split_quantity_new = stackable;
11507 else
11508 split_quantity_new = quantity;
11509
11511 {
11512 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11513 new_item =
ItemBase.Cast(in_hands);
11514 if (new_item)
11515 {
11516 new_item.SetResultOfSplit(true);
11517 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11519 new_item.SetQuantity(split_quantity_new, false, true);
11520 }
11521 }
11522 }
11523 }
11524
11526 {
11528 float split_quantity_new = Math.Floor(quantity * 0.5);
11529
11531 return;
11532
11534
11535 if (new_item)
11536 {
11537 if (new_item.GetQuantityMax() < split_quantity_new)
11538 {
11539 split_quantity_new = new_item.GetQuantityMax();
11540 }
11541
11542 new_item.SetResultOfSplit(true);
11543 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11544
11546 {
11549 }
11550 else
11551 {
11553 new_item.
SetQuantity(split_quantity_new,
false,
true);
11554 }
11555 }
11556 }
11557
11559 {
11561 float split_quantity_new = Math.Floor(quantity / 2);
11562
11564 return;
11565
11566 InventoryLocation invloc = new InventoryLocation;
11568
11570 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11571
11572 if (new_item)
11573 {
11574 if (new_item.GetQuantityMax() < split_quantity_new)
11575 {
11576 split_quantity_new = new_item.GetQuantityMax();
11577 }
11579 {
11582 }
11583 else if (split_quantity_new > 1)
11584 {
11586 new_item.
SetQuantity(split_quantity_new,
false,
true);
11587 }
11588 }
11589 }
11590
11593 {
11594 SetWeightDirty();
11596
11597 if (parent)
11598 parent.OnAttachmentQuantityChangedEx(this, delta);
11599
11601 {
11603 {
11605 }
11607 {
11608 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11610 }
11611 }
11612
11613 }
11614
11617 {
11618
11619 }
11620
11623 {
11625 }
11626
11628 {
11629 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11630
11632 {
11633 if (newLevel == GameConstants.STATE_RUINED)
11634 {
11636 EntityAI parent = GetHierarchyParent();
11637 if (parent && parent.IsFireplace())
11638 {
11639 CargoBase cargo = GetInventory().GetCargo();
11640 if (cargo)
11641 {
11643 {
11645 }
11646 }
11647 }
11648 }
11649
11651 {
11652
11654 return;
11655 }
11656
11657 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11658 {
11660 }
11661 }
11662 }
11663
11664
11666 {
11667 super.OnRightClick();
11668
11670 {
11672 {
11673 if (ScriptInputUserData.CanStoreInputUserData())
11674 {
11675 EntityAI root = GetHierarchyRoot();
11676 Man playerOwner = GetHierarchyRootPlayer();
11677 InventoryLocation dst = new InventoryLocation;
11678
11679
11680 if (!playerOwner && root && root == this)
11681 {
11683 }
11684 else
11685 {
11686
11687 GetInventory().GetCurrentInventoryLocation(dst);
11689 {
11692 {
11694 }
11695 else
11696 {
11698
11699
11700 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11701 {
11703 }
11704 else
11705 {
11706 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11707 }
11708 }
11709 }
11710 }
11711
11712 ScriptInputUserData ctx = new ScriptInputUserData;
11720 }
11721 }
11722 else if (!
GetGame().IsMultiplayer())
11723 {
11725 }
11726 }
11727 }
11728
11730 {
11731 if (root)
11732 {
11733 vector m4[4];
11734 root.GetTransform(m4);
11735 dst.SetGround(this, m4);
11736 }
11737 else
11738 {
11739 GetInventory().GetCurrentInventoryLocation(dst);
11740 }
11741 }
11742
11743 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11744 {
11745
11746 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11747 return false;
11748
11749 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11750 return false;
11751
11752
11754 return false;
11755
11756
11757 Magazine mag = Magazine.Cast(this);
11758 if (mag)
11759 {
11760 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11761 return false;
11762
11763 if (stack_max_limit)
11764 {
11765 Magazine other_mag = Magazine.Cast(other_item);
11766 if (other_item)
11767 {
11768 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11769 return false;
11770 }
11771
11772 }
11773 }
11774 else
11775 {
11776
11778 return false;
11779
11781 return false;
11782 }
11783
11784 PlayerBase player = null;
11785 if (CastTo(player, GetHierarchyRootPlayer()))
11786 {
11787 if (player.GetInventory().HasAttachment(this))
11788 return false;
11789
11790 if (player.IsItemsToDelete())
11791 return false;
11792 }
11793
11794 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11795 return false;
11796
11797 int slotID;
11799 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11800 return false;
11801
11802 return true;
11803 }
11804
11806 {
11808 }
11809
11811 {
11812 return m_IsResultOfSplit;
11813 }
11814
11816 {
11817 m_IsResultOfSplit = value;
11818 }
11819
11821 {
11823 }
11824
11826 {
11827 float other_item_quantity = other_item.GetQuantity();
11828 float this_free_space;
11829
11831
11833
11834 if (other_item_quantity > this_free_space)
11835 {
11836 return this_free_space;
11837 }
11838 else
11839 {
11840 return other_item_quantity;
11841 }
11842 }
11843
11845 {
11847 }
11848
11850 {
11852 return;
11853
11854 if (!IsMagazine() && other_item)
11855 {
11857 if (quantity_used != 0)
11858 {
11859 float hp1 = GetHealth01("","");
11860 float hp2 = other_item.GetHealth01("","");
11861 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11862 hpResult = hpResult / (
GetQuantity() + quantity_used);
11863
11864 hpResult *= GetMaxHealth();
11865 Math.Round(hpResult);
11866 SetHealth("", "Health", hpResult);
11867
11869 other_item.AddQuantity(-quantity_used);
11870 }
11871 }
11873 }
11874
11876 {
11877 #ifdef SERVER
11878 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11879 GetHierarchyParent().IncreaseLifetimeUp();
11880 #endif
11881 };
11882
11884 {
11885 PlayerBase p = PlayerBase.Cast(player);
11886
11887 array<int> recipesIds = p.m_Recipes;
11888 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11889 if (moduleRecipesManager)
11890 {
11891 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11892 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11893 }
11894
11895 for (int i = 0;i < recipesIds.Count(); i++)
11896 {
11897 int key = recipesIds.Get(i);
11898 string recipeName = moduleRecipesManager.GetRecipeName(key);
11900 }
11901 }
11902
11903
11904 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11905 {
11906 super.GetDebugActions(outputList);
11907
11908
11914
11915
11920
11925
11926
11930
11931
11933 {
11937 }
11938
11941
11942
11946
11948
11949 InventoryLocation loc = new InventoryLocation();
11950 GetInventory().GetCurrentInventoryLocation(loc);
11952 {
11953 if (Gizmo_IsSupported())
11956 }
11957
11959 }
11960
11961
11962
11963
11965 {
11966 super.OnAction(action_id, player, ctx);
11967
11969 {
11970 switch (action_id)
11971 {
11974 return true;
11977 return true;
11978 }
11979 }
11980
11982 {
11983 switch (action_id)
11984 {
11986 Delete();
11987 return true;
11988 }
11989 }
11990
11991 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11992 {
11993 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11994 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11995 PlayerBase p = PlayerBase.Cast(player);
11996 if (
EActions.RECIPES_RANGE_START < 1000)
11997 {
11998 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11999 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12000 }
12001 }
12002 #ifndef SERVER
12003 else if (action_id ==
EActions.WATCH_PLAYER)
12004 {
12005 PluginDeveloper.SetDeveloperItemClientEx(player);
12006 }
12007 #endif
12009 {
12010 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12011 {
12012 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12013 OnDebugButtonPressServer(id + 1);
12014 }
12015
12016 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12017 {
12018 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12020 }
12021
12022 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12023 {
12024 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12026 }
12027
12028 else if (action_id ==
EActions.ADD_QUANTITY)
12029 {
12030 if (IsMagazine())
12031 {
12032 Magazine mag = Magazine.Cast(this);
12033 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12034 }
12035 else
12036 {
12038 }
12039
12040 if (m_EM)
12041 {
12042 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12043 }
12044
12045 }
12046
12047 else if (action_id ==
EActions.REMOVE_QUANTITY)
12048 {
12049 if (IsMagazine())
12050 {
12051 Magazine mag2 = Magazine.Cast(this);
12052 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12053 }
12054 else
12055 {
12057 }
12058 if (m_EM)
12059 {
12060 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12061 }
12062
12063 }
12064
12065 else if (action_id ==
EActions.SET_QUANTITY_0)
12066 {
12068
12069 if (m_EM)
12070 {
12071 m_EM.SetEnergy(0);
12072 }
12073 }
12074
12075 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12076 {
12078
12079 if (m_EM)
12080 {
12081 m_EM.SetEnergy(m_EM.GetEnergyMax());
12082 }
12083 }
12084
12085 else if (action_id ==
EActions.ADD_HEALTH)
12086 {
12087 AddHealth("","",GetMaxHealth("","Health")/5);
12088 }
12089 else if (action_id ==
EActions.REMOVE_HEALTH)
12090 {
12091 AddHealth("","",-GetMaxHealth("","Health")/5);
12092 }
12093 else if (action_id ==
EActions.DESTROY_HEALTH)
12094 {
12095 SetHealth01("","",0);
12096 }
12097 else if (action_id ==
EActions.WATCH_ITEM)
12098 {
12100 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12101 #ifdef DEVELOPER
12102 SetDebugDeveloper_item(this);
12103 #endif
12104 }
12105
12106 else if (action_id ==
EActions.ADD_TEMPERATURE)
12107 {
12108 AddTemperature(20);
12109
12110 }
12111
12112 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12113 {
12114 AddTemperature(-20);
12115
12116 }
12117
12118 else if (action_id ==
EActions.FLIP_FROZEN)
12119 {
12120 SetFrozen(!GetIsFrozen());
12121
12122 }
12123
12124 else if (action_id ==
EActions.ADD_WETNESS)
12125 {
12127
12128 }
12129
12130 else if (action_id ==
EActions.REMOVE_WETNESS)
12131 {
12133
12134 }
12135
12136 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12137 {
12140
12141
12142 }
12143
12144 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12145 {
12148 }
12149
12150 else if (action_id ==
EActions.MAKE_SPECIAL)
12151 {
12152 auto debugParams = DebugSpawnParams.WithPlayer(player);
12153 OnDebugSpawnEx(debugParams);
12154 }
12155
12156 }
12157
12158
12159 return false;
12160 }
12161
12162
12163
12164
12168
12171
12172
12173
12175 {
12176 return false;
12177 }
12178
12179
12181 {
12182 return true;
12183 }
12184
12185
12187 {
12188 return true;
12189 }
12190
12191
12192
12194 {
12195 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12197 }
12198
12201 {
12202 return null;
12203 }
12204
12206 {
12207 return false;
12208 }
12209
12211 {
12212 return false;
12213 }
12214
12218
12219
12221 {
12222 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12223 return module_repairing.CanRepair(this, item_repair_kit);
12224 }
12225
12226
12227 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12228 {
12229 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12230 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12231 }
12232
12233
12235 {
12236
12237
12238
12239
12240
12241
12242
12243
12244 return 1;
12245 }
12246
12247
12248
12250 {
12252 }
12253
12254
12255
12257 {
12259 }
12260
12261
12270 {
12271 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12272
12273 if (player)
12274 {
12275 player.MessageStatus(text);
12276 }
12277 }
12278
12279
12288 {
12289 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12290
12291 if (player)
12292 {
12293 player.MessageAction(text);
12294 }
12295 }
12296
12297
12306 {
12307 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12308
12309 if (player)
12310 {
12311 player.MessageFriendly(text);
12312 }
12313 }
12314
12315
12324 {
12325 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12326
12327 if (player)
12328 {
12329 player.MessageImportant(text);
12330 }
12331 }
12332
12334 {
12335 return true;
12336 }
12337
12338
12339 override bool KindOf(
string tag)
12340 {
12341 bool found = false;
12342 string item_name = this.
GetType();
12345
12346 int array_size = item_tag_array.Count();
12347 for (int i = 0; i < array_size; i++)
12348 {
12349 if (item_tag_array.Get(i) == tag)
12350 {
12351 found = true;
12352 break;
12353 }
12354 }
12355 return found;
12356 }
12357
12358
12360 {
12361
12362 super.OnRPC(sender, rpc_type,ctx);
12363
12364
12365 switch (rpc_type)
12366 {
12367 #ifndef SERVER
12368 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12369 Param2<bool, string> p = new Param2<bool, string>(false, "");
12370
12372 return;
12373
12374 bool play = p.param1;
12375 string soundSet = p.param2;
12376
12377 if (play)
12378 {
12380 {
12382 {
12384 }
12385 }
12386 else
12387 {
12389 }
12390 }
12391 else
12392 {
12394 }
12395
12396 break;
12397 #endif
12398
12399 }
12400
12402 {
12404 }
12405 }
12406
12407
12408
12409
12411 {
12412 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12413 return plugin.GetID(
name);
12414 }
12415
12417 {
12418 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12419 return plugin.GetName(id);
12420 }
12421
12424 {
12425
12426
12427 int varFlags;
12428 if (!ctx.
Read(varFlags))
12429 return;
12430
12431 if (varFlags & ItemVariableFlags.FLOAT)
12432 {
12434 }
12435 }
12436
12438 {
12439
12440 super.SerializeNumericalVars(floats_out);
12441
12442
12443
12445 {
12447 }
12448
12450 {
12452 }
12453
12455 {
12457 }
12458
12460 {
12465 }
12466
12468 {
12470 }
12471 }
12472
12474 {
12475
12476 super.DeSerializeNumericalVars(floats);
12477
12478
12479 int index = 0;
12480 int mask = Math.Round(floats.Get(index));
12481
12482 index++;
12483
12485 {
12487 {
12489 }
12490 else
12491 {
12492 float quantity = floats.Get(index);
12493 SetQuantity(quantity,
true,
false,
false,
false);
12494 }
12495 index++;
12496 }
12497
12499 {
12500 float wet = floats.Get(index);
12502 index++;
12503 }
12504
12506 {
12507 int liquidtype = Math.Round(floats.Get(index));
12509 index++;
12510 }
12511
12513 {
12515 index++;
12517 index++;
12519 index++;
12521 index++;
12522 }
12523
12525 {
12526 int cleanness = Math.Round(floats.Get(index));
12528 index++;
12529 }
12530 }
12531
12533 {
12534 super.WriteVarsToCTX(ctx);
12535
12536
12538 {
12540 }
12541
12543 {
12545 }
12546
12548 {
12550 }
12551
12553 {
12554 int r,g,b,a;
12560 }
12561
12563 {
12565 }
12566 }
12567
12569 {
12570 if (!super.ReadVarsFromCTX(ctx,version))
12571 return false;
12572
12573 int intValue;
12574 float value;
12575
12576 if (version < 140)
12577 {
12578 if (!ctx.
Read(intValue))
12579 return false;
12580
12581 m_VariablesMask = intValue;
12582 }
12583
12585 {
12586 if (!ctx.
Read(value))
12587 return false;
12588
12590 {
12592 }
12593 else
12594 {
12596 }
12597 }
12598
12599 if (version < 140)
12600 {
12602 {
12603 if (!ctx.
Read(value))
12604 return false;
12605 SetTemperatureDirect(value);
12606 }
12607 }
12608
12610 {
12611 if (!ctx.
Read(value))
12612 return false;
12614 }
12615
12617 {
12618 if (!ctx.
Read(intValue))
12619 return false;
12621 }
12622
12624 {
12625 int r,g,b,a;
12627 return false;
12629 return false;
12631 return false;
12633 return false;
12634
12636 }
12637
12639 {
12640 if (!ctx.
Read(intValue))
12641 return false;
12643 }
12644
12645 if (version >= 138 && version < 140)
12646 {
12648 {
12649 if (!ctx.
Read(intValue))
12650 return false;
12651 SetFrozen(intValue);
12652 }
12653 }
12654
12655 return true;
12656 }
12657
12658
12660 {
12663 {
12665 }
12666
12667 if (!super.OnStoreLoad(ctx, version))
12668 {
12670 return false;
12671 }
12672
12673 if (version >= 114)
12674 {
12675 bool hasQuickBarIndexSaved;
12676
12677 if (!ctx.
Read(hasQuickBarIndexSaved))
12678 {
12680 return false;
12681 }
12682
12683 if (hasQuickBarIndexSaved)
12684 {
12685 int itmQBIndex;
12686
12687
12688 if (!ctx.
Read(itmQBIndex))
12689 {
12691 return false;
12692 }
12693
12694 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12695 if (itmQBIndex != -1 && parentPlayer)
12696 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12697 }
12698 }
12699 else
12700 {
12701
12702 PlayerBase player;
12703 int itemQBIndex;
12704 if (version ==
int.
MAX)
12705 {
12706 if (!ctx.
Read(itemQBIndex))
12707 {
12709 return false;
12710 }
12711 }
12712 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12713 {
12714
12715 if (!ctx.
Read(itemQBIndex))
12716 {
12718 return false;
12719 }
12720 if (itemQBIndex != -1 && player)
12721 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12722 }
12723 }
12724
12725 if (version < 140)
12726 {
12727
12728 if (!LoadVariables(ctx, version))
12729 {
12731 return false;
12732 }
12733 }
12734
12735
12737 {
12739 return false;
12740 }
12741 if (version >= 132)
12742 {
12744 if (raib)
12745 {
12747 {
12749 return false;
12750 }
12751 }
12752 }
12753
12755 return true;
12756 }
12757
12758
12759
12761 {
12762 super.OnStoreSave(ctx);
12763
12764 PlayerBase player;
12765 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12766 {
12768
12769 int itemQBIndex = -1;
12770 itemQBIndex = player.FindQuickBarEntityIndex(this);
12771 ctx.
Write(itemQBIndex);
12772 }
12773 else
12774 {
12776 }
12777
12779
12781 if (raib)
12782 {
12784 }
12785 }
12786
12787
12789 {
12790 super.AfterStoreLoad();
12791
12793 {
12795 }
12796
12798 {
12801 }
12802 }
12803
12805 {
12806 super.EEOnAfterLoad();
12807
12809 {
12811 }
12812
12815 }
12816
12818 {
12819 return false;
12820 }
12821
12822
12823
12825 {
12827 {
12828 #ifdef PLATFORM_CONSOLE
12829
12831 {
12833 if (menu)
12834 {
12836 }
12837 }
12838 #endif
12839 }
12840
12842 {
12845 }
12846
12848 {
12849 SetWeightDirty();
12851 }
12853 {
12856 }
12857
12859 {
12862 }
12864 {
12867 }
12868
12869 super.OnVariablesSynchronized();
12870 }
12871
12872
12873
12875 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12876 {
12877 if (!IsServerCheck(allow_client))
12878 return false;
12879
12881 return false;
12882
12885
12886 if (value <= (min + 0.001))
12887 value = min;
12888
12889 if (value == min)
12890 {
12891 if (destroy_config)
12892 {
12893 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12894 if (dstr)
12895 {
12897 this.Delete();
12898 return true;
12899 }
12900 }
12901 else if (destroy_forced)
12902 {
12904 this.Delete();
12905 return true;
12906 }
12907
12909 }
12910
12913
12915 {
12917
12918 if (delta)
12920 }
12921
12923
12924 return false;
12925 }
12926
12927
12929 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12930 {
12932 }
12933
12935 {
12938 }
12939
12941 {
12944 }
12945
12947 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12948 {
12949 float value_clamped = Math.Clamp(value, 0, 1);
12951 SetQuantity(result, destroy_config, destroy_forced);
12952 }
12953
12954
12957 {
12959 }
12960
12962 {
12964 }
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12976 {
12977 int slot = -1;
12978 if (GetInventory())
12979 {
12980 InventoryLocation il = new InventoryLocation;
12981 GetInventory().GetCurrentInventoryLocation(il);
12983 }
12984
12986 }
12987
12989 {
12990 float quantity_max = 0;
12991
12993 {
12994 if (attSlotID != -1)
12995 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12996
12997 if (quantity_max <= 0)
12999 }
13000
13001 if (quantity_max <= 0)
13003
13004 return quantity_max;
13005 }
13006
13008 {
13010 }
13011
13013 {
13015 }
13016
13017
13019 {
13021 }
13022
13024 {
13026 }
13027
13029 {
13031 }
13032
13033
13035 {
13036
13037 float weightEx = GetWeightEx();
13038 float special = GetInventoryAndCargoWeight();
13039 return weightEx - special;
13040 }
13041
13042
13044 {
13046 }
13047
13049 {
13051 {
13052 #ifdef DEVELOPER
13053 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13054 {
13055 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13057 }
13058 #endif
13059
13060 return GetQuantity() * GetConfigWeightModified();
13061 }
13062 else if (HasEnergyManager())
13063 {
13064 #ifdef DEVELOPER
13065 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13066 {
13067 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13068 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13069 }
13070 #endif
13071 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13072 }
13073 else
13074 {
13075 #ifdef DEVELOPER
13076 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13077 {
13078 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13079 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13080 }
13081 #endif
13082 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13083 }
13084 }
13085
13088 {
13089 int item_count = 0;
13091
13092 if (GetInventory().GetCargo() != NULL)
13093 {
13094 item_count = GetInventory().GetCargo().GetItemCount();
13095 }
13096
13097 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13098 {
13099 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13100 if (item)
13101 item_count += item.GetNumberOfItems();
13102 }
13103 return item_count;
13104 }
13105
13108 {
13109 float weight = 0;
13110 float wetness = 1;
13111 if (include_wetness)
13114 {
13115 weight = wetness * m_ConfigWeight;
13116 }
13118 {
13119 weight = 1;
13120 }
13121 return weight;
13122 }
13123
13124
13125
13127 {
13128 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13129 {
13130 GameInventory inv = GetInventory();
13131 array<EntityAI> items = new array<EntityAI>;
13133 for (int i = 0; i < items.Count(); i++)
13134 {
13136 if (item)
13137 {
13139 }
13140 }
13141 }
13142 }
13143
13144
13145
13146
13148 {
13149 float energy = 0;
13150 if (HasEnergyManager())
13151 {
13152 energy = GetCompEM().GetEnergy();
13153 }
13154 return energy;
13155 }
13156
13157
13159 {
13160 super.OnEnergyConsumed();
13161
13163 }
13164
13166 {
13167 super.OnEnergyAdded();
13168
13170 }
13171
13172
13174 {
13175 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13176 {
13178 {
13179 float energy_0to1 = GetCompEM().GetEnergy0To1();
13181 }
13182 }
13183 }
13184
13185
13187 {
13188 return ConfigGetFloat("heatIsolation");
13189 }
13190
13192 {
13194 }
13195
13197 {
13198 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13199 if (
GetGame().ConfigIsExisting(paramPath))
13201
13202 return 0.0;
13203 }
13204
13206 {
13207 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13208 if (
GetGame().ConfigIsExisting(paramPath))
13210
13211 return 0.0;
13212 }
13213
13214 override void SetWet(
float value,
bool allow_client =
false)
13215 {
13216 if (!IsServerCheck(allow_client))
13217 return;
13218
13221
13223
13224 m_VarWet = Math.Clamp(value, min, max);
13225
13227 {
13230 }
13231 }
13232
13233 override void AddWet(
float value)
13234 {
13236 }
13237
13239 {
13241 }
13242
13244 {
13246 }
13247
13249 {
13251 }
13252
13254 {
13256 }
13257
13259 {
13261 }
13262
13263 override void OnWetChanged(
float newVal,
float oldVal)
13264 {
13267 if (newLevel != oldLevel)
13268 {
13270 }
13271 }
13272
13274 {
13275 SetWeightDirty();
13276 }
13277
13279 {
13280 return GetWetLevelInternal(
m_VarWet);
13281 }
13282
13283
13284
13286 {
13288 }
13289
13291 {
13293 }
13294
13296 {
13298 }
13299
13301 {
13303 }
13304
13305
13306
13308 {
13309 if (ConfigIsExisting("itemModelLength"))
13310 {
13311 return ConfigGetFloat("itemModelLength");
13312 }
13313 return 0;
13314 }
13315
13317 {
13318 if (ConfigIsExisting("itemAttachOffset"))
13319 {
13320 return ConfigGetFloat("itemAttachOffset");
13321 }
13322 return 0;
13323 }
13324
13325 override void SetCleanness(
int value,
bool allow_client =
false)
13326 {
13327 if (!IsServerCheck(allow_client))
13328 return;
13329
13331
13333
13336 }
13337
13339 {
13341 }
13342
13344 {
13345 return true;
13346 }
13347
13348
13349
13350
13352 {
13354 }
13355
13357 {
13359 }
13360
13361
13362
13363
13364 override void SetColor(
int r,
int g,
int b,
int a)
13365 {
13371 }
13373 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13374 {
13379 }
13380
13382 {
13384 }
13385
13388 {
13389 int r,g,b,a;
13391 r = r/255;
13392 g = g/255;
13393 b = b/255;
13394 a = a/255;
13395 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13396 }
13397
13398
13399
13400 override void SetLiquidType(
int value,
bool allow_client =
false)
13401 {
13402 if (!IsServerCheck(allow_client))
13403 return;
13404
13409 }
13410
13412 {
13413 return ConfigGetInt("varLiquidTypeInit");
13414 }
13415
13417 {
13419 }
13420
13422 {
13424 SetFrozen(false);
13425 }
13426
13429 {
13430 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13431 }
13432
13433
13436 {
13437 PlayerBase nplayer;
13438 if (PlayerBase.CastTo(nplayer, player))
13439 {
13441
13442 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13443 }
13444 }
13445
13446
13449 {
13450 PlayerBase nplayer;
13451 if (PlayerBase.CastTo(nplayer,player))
13452 {
13453
13454 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13455
13456 }
13457
13458
13459 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13460
13461
13462 if (HasEnergyManager())
13463 {
13464 GetCompEM().UpdatePlugState();
13465 }
13466 }
13467
13468
13470 {
13471 super.OnPlacementStarted(player);
13472
13474 }
13475
13476 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13477 {
13479 {
13480 m_AdminLog.OnPlacementComplete(player,
this);
13481 }
13482
13483 super.OnPlacementComplete(player, position, orientation);
13484 }
13485
13486
13487
13488
13489
13491 {
13493 {
13494 return true;
13495 }
13496 else
13497 {
13498 return false;
13499 }
13500 }
13501
13502
13504 {
13506 {
13508 }
13509 }
13510
13511
13513 {
13515 }
13516
13518 {
13520 }
13521
13522 override void InsertAgent(
int agent,
float count = 1)
13523 {
13524 if (count < 1)
13525 return;
13526
13528 }
13529
13532 {
13534 }
13535
13536
13538 {
13540 }
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13584 {
13586 return false;
13587 return true;
13588 }
13589
13591 {
13592
13594 }
13595
13596
13599 {
13600 super.CheckForRoofLimited(timeTresholdMS);
13601
13603 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13604 {
13605 m_PreviousRoofTestTime = time;
13606 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13607 }
13608 }
13609
13610
13612 {
13614 {
13615 return 0;
13616 }
13617
13618 if (GetInventory().GetAttachmentSlotsCount() != 0)
13619 {
13620 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13621 if (filter)
13622 return filter.GetProtectionLevel(type, false, system);
13623 else
13624 return 0;
13625 }
13626
13627 string subclassPath, entryName;
13628
13629 switch (type)
13630 {
13632 entryName = "biological";
13633 break;
13635 entryName = "chemical";
13636 break;
13637 default:
13638 entryName = "biological";
13639 break;
13640 }
13641
13642 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13643
13645 }
13646
13647
13648
13651 {
13652 if (!IsMagazine())
13654
13656 }
13657
13658
13659
13660
13661
13666 {
13667 return true;
13668 }
13669
13671 {
13673 }
13674
13675
13676
13677
13678
13680 {
13681 if (parent)
13682 {
13683 if (parent.IsInherited(DayZInfected))
13684 return true;
13685
13686 if (!parent.IsRuined())
13687 return true;
13688 }
13689
13690 return true;
13691 }
13692
13694 {
13695 if (!super.CanPutAsAttachment(parent))
13696 {
13697 return false;
13698 }
13699
13700 if (!IsRuined() && !parent.IsRuined())
13701 {
13702 return true;
13703 }
13704
13705 return false;
13706 }
13707
13709 {
13710
13711
13712
13713
13714 return super.CanReceiveItemIntoCargo(item);
13715 }
13716
13718 {
13719
13720
13721
13722
13723 GameInventory attachmentInv = attachment.GetInventory();
13725 {
13726 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13727 return false;
13728 }
13729
13730 InventoryLocation loc = new InventoryLocation();
13731 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13732 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13733 return false;
13734
13735 return super.CanReceiveAttachment(attachment, slotId);
13736 }
13737
13739 {
13740 if (!super.CanReleaseAttachment(attachment))
13741 return false;
13742
13743 return GetInventory().AreChildrenAccessible();
13744 }
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13767 {
13768 int id = muzzle_owner.GetMuzzleID();
13769 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13770
13771 if (WPOF_array)
13772 {
13773 for (int i = 0; i < WPOF_array.Count(); i++)
13774 {
13775 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13776
13777 if (WPOF)
13778 {
13779 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13780 }
13781 }
13782 }
13783 }
13784
13785
13787 {
13788 int id = muzzle_owner.GetMuzzleID();
13790
13791 if (WPOBE_array)
13792 {
13793 for (int i = 0; i < WPOBE_array.Count(); i++)
13794 {
13795 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13796
13797 if (WPOBE)
13798 {
13799 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13800 }
13801 }
13802 }
13803 }
13804
13805
13807 {
13808 int id = muzzle_owner.GetMuzzleID();
13809 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13810
13811 if (WPOOH_array)
13812 {
13813 for (int i = 0; i < WPOOH_array.Count(); i++)
13814 {
13815 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13816
13817 if (WPOOH)
13818 {
13819 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13820 }
13821 }
13822 }
13823 }
13824
13825
13827 {
13828 int id = muzzle_owner.GetMuzzleID();
13829 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13830
13831 if (WPOOH_array)
13832 {
13833 for (int i = 0; i < WPOOH_array.Count(); i++)
13834 {
13835 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13836
13837 if (WPOOH)
13838 {
13839 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13840 }
13841 }
13842 }
13843 }
13844
13845
13847 {
13848 int id = muzzle_owner.GetMuzzleID();
13849 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13850
13851 if (WPOOH_array)
13852 {
13853 for (int i = 0; i < WPOOH_array.Count(); i++)
13854 {
13855 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13856
13857 if (WPOOH)
13858 {
13859 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13860 }
13861 }
13862 }
13863 }
13864
13865
13866
13868 {
13870 {
13871 return true;
13872 }
13873
13874 return false;
13875 }
13876
13878 {
13880 {
13881 return true;
13882 }
13883
13884 return false;
13885 }
13886
13888 {
13890 {
13891 return true;
13892 }
13893
13894 return false;
13895 }
13896
13898 {
13899 return false;
13900 }
13901
13904 {
13905 return UATimeSpent.DEFAULT_DEPLOY;
13906 }
13907
13908
13909
13910
13912 {
13914 SetSynchDirty();
13915 }
13916
13918 {
13920 }
13921
13922
13924 {
13925 return false;
13926 }
13927
13930 {
13931 string att_type = "None";
13932
13933 if (ConfigIsExisting("soundAttType"))
13934 {
13935 att_type = ConfigGetString("soundAttType");
13936 }
13937
13939 }
13940
13942 {
13944 }
13945
13946
13947
13948
13949
13955
13957 {
13960
13962 }
13963
13964
13966 {
13968 return;
13969
13971
13974
13977
13978 SoundParameters params = new SoundParameters();
13982 }
13983
13984
13986 {
13988 return;
13989
13991 SetSynchDirty();
13992
13995 }
13996
13997
13999 {
14001 return;
14002
14004 SetSynchDirty();
14005
14008 }
14009
14011 {
14013 }
14014
14016 {
14018 }
14019
14022 {
14023 if (!
GetGame().IsDedicatedServer())
14024 {
14025 if (ConfigIsExisting("attachSoundSet"))
14026 {
14027 string cfg_path = "";
14028 string soundset = "";
14029 string type_name =
GetType();
14030
14033 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14034 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14035
14036 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14037 {
14038 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14039 {
14040 if (cfg_slot_array[i] == slot_type)
14041 {
14042 soundset = cfg_soundset_array[i];
14043 break;
14044 }
14045 }
14046 }
14047
14048 if (soundset != "")
14049 {
14050 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14052 }
14053 }
14054 }
14055 }
14056
14058 {
14059
14060 }
14061
14062 void OnApply(PlayerBase player);
14063
14065 {
14066 return 1.0;
14067 };
14068
14070 {
14072 }
14073
14075 {
14077 }
14078
14080
14082 {
14083 SetDynamicPhysicsLifeTime(0.01);
14085 }
14086
14088 {
14089 array<string> zone_names = new array<string>;
14090 GetDamageZones(zone_names);
14091 for (int i = 0; i < zone_names.Count(); i++)
14092 {
14093 SetHealthMax(zone_names.Get(i),"Health");
14094 }
14095 SetHealthMax("","Health");
14096 }
14097
14100 {
14101 float global_health = GetHealth01("","Health");
14102 array<string> zones = new array<string>;
14103 GetDamageZones(zones);
14104
14105 for (int i = 0; i < zones.Count(); i++)
14106 {
14107 SetHealth01(zones.Get(i),"Health",global_health);
14108 }
14109 }
14110
14113 {
14114 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14115 }
14116
14118 {
14119 if (!hasRootAsPlayer)
14120 {
14121 if (refParentIB)
14122 {
14123
14124 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14125 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14126
14127 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14128 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14129
14132 }
14133 else
14134 {
14135
14138 }
14139 }
14140 }
14141
14143 {
14145 {
14146 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14147 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14148 {
14149 float heatPermCoef = 1.0;
14151 while (ent)
14152 {
14153 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14154 ent = ent.GetHierarchyParent();
14155 }
14156
14157 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14158 }
14159 }
14160 }
14161
14163 {
14164
14165 EntityAI parent = GetHierarchyParent();
14166 if (!parent)
14167 {
14168 hasParent = false;
14169 hasRootAsPlayer = false;
14170 }
14171 else
14172 {
14173 hasParent = true;
14174 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14175 refParentIB =
ItemBase.Cast(parent);
14176 }
14177 }
14178
14179 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14180 {
14181
14182 }
14183
14185 {
14186
14187 return false;
14188 }
14189
14191 {
14192
14193
14194 return false;
14195 }
14196
14198 {
14199
14200 return false;
14201 }
14202
14205 {
14206 return !GetIsFrozen() &&
IsOpen();
14207 }
14208
14210 {
14211 bool hasParent = false, hasRootAsPlayer = false;
14213
14214 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14215 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14216
14217 if (wwtu || foodDecay)
14218 {
14222
14223 if (processWetness || processTemperature || processDecay)
14224 {
14226
14227 if (processWetness)
14228 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14229
14230 if (processTemperature)
14232
14233 if (processDecay)
14234 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14235 }
14236 }
14237 }
14238
14241 {
14243 }
14244
14246 {
14249
14250 return super.GetTemperatureFreezeThreshold();
14251 }
14252
14254 {
14257
14258 return super.GetTemperatureThawThreshold();
14259 }
14260
14262 {
14265
14266 return super.GetItemOverheatThreshold();
14267 }
14268
14270 {
14272 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14273
14274 return super.GetTemperatureFreezeTime();
14275 }
14276
14278 {
14280 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14281
14282 return super.GetTemperatureThawTime();
14283 }
14284
14289
14291 {
14292 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14293 }
14294
14296 {
14297 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14298 }
14299
14302 {
14304 }
14305
14307 {
14309 }
14310
14312 {
14314 }
14315
14318 {
14319 return null;
14320 }
14321
14324 {
14325 return false;
14326 }
14327
14329 {
14331 {
14334 if (!trg)
14335 {
14337 explosive = this;
14338 }
14339
14340 explosive.PairRemote(trg);
14342
14343 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14344 trg.SetPersistentPairID(persistentID);
14345 explosive.SetPersistentPairID(persistentID);
14346
14347 return true;
14348 }
14349 return false;
14350 }
14351
14354 {
14355 float ret = 1.0;
14358 ret *= GetHealth01();
14359
14360 return ret;
14361 }
14362
14363 #ifdef DEVELOPER
14364 override void SetDebugItem()
14365 {
14366 super.SetDebugItem();
14367 _itemBase = this;
14368 }
14369
14371 {
14372 string text = super.GetDebugText();
14373
14375 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14376
14377 return text;
14378 }
14379 #endif
14380
14382 {
14383 return true;
14384 }
14385
14387
14389
14391 {
14394 }
14395
14396
14404
14420}
14421
14423{
14425 if (entity)
14426 {
14427 bool is_item = entity.IsInherited(
ItemBase);
14428 if (is_item && full_quantity)
14429 {
14432 }
14433 }
14434 else
14435 {
14437 return NULL;
14438 }
14439 return entity;
14440}
14441
14443{
14444 if (item)
14445 {
14446 if (health > 0)
14447 item.SetHealth("", "", health);
14448
14449 if (item.CanHaveTemperature())
14450 {
14452 if (item.CanFreeze())
14453 item.SetFrozen(false);
14454 }
14455
14456 if (item.HasEnergyManager())
14457 {
14458 if (quantity >= 0)
14459 {
14460 item.GetCompEM().SetEnergy0To1(quantity);
14461 }
14462 else
14463 {
14465 }
14466 }
14467 else if (item.IsMagazine())
14468 {
14469 Magazine mag = Magazine.Cast(item);
14470 if (quantity >= 0)
14471 {
14472 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14473 }
14474 else
14475 {
14477 }
14478
14479 }
14480 else
14481 {
14482 if (quantity >= 0)
14483 {
14484 item.SetQuantityNormalized(quantity, false);
14485 }
14486 else
14487 {
14489 }
14490
14491 }
14492 }
14493}
14494
14495#ifdef DEVELOPER
14497#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.