9605{
9607 {
9608 return true;
9609 }
9610};
9611
9612
9613
9615{
9619
9621
9624
9625
9626
9627
9628
9637
9643
9648
9653
9674 protected bool m_IsResultOfSplit
9675
9677
9682
9683
9684
9686
9690
9691
9692
9694
9697
9698
9699
9705
9706
9714
9717
9718
9720
9721
9723
9724
9729
9730
9735
9736
9738
9739
9741 {
9746
9747 if (!
GetGame().IsDedicatedServer())
9748 {
9750 {
9752
9754 {
9756 }
9757 }
9758
9761 }
9762
9763 m_OldLocation = null;
9764
9766 {
9768 }
9769
9770 if (ConfigIsExisting("headSelectionsToHide"))
9771 {
9774 }
9775
9777 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9778 {
9780 }
9781
9783
9784 m_IsResultOfSplit = false;
9785
9787 }
9788
9790 {
9791 super.InitItemVariables();
9792
9798 m_Count = ConfigGetInt(
"count");
9799
9802
9807
9810
9815
9827
9831
9832
9835 if (ConfigIsExisting("canBeSplit"))
9836 {
9839 }
9840
9842 if (ConfigIsExisting("itemBehaviour"))
9844
9845
9848 RegisterNetSyncVariableInt("m_VarLiquidType");
9849 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9850
9851 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9852 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9853 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9854
9855 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9856 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9857 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9858 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9859
9860 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9861 RegisterNetSyncVariableBool("m_IsTakeable");
9862 RegisterNetSyncVariableBool("m_IsHologram");
9863
9866 {
9869 }
9870
9872
9874 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9876
9877 }
9878
9880 {
9882 }
9883
9885 {
9888 {
9893 }
9894 }
9895
9896 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9897 {
9899 {
9902 }
9903
9905 }
9906
9908 {
9914 }
9915
9917
9919 {
9921
9922 if (!action)
9923 {
9924 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9925 return;
9926 }
9927
9929 if (!ai)
9930 {
9932 return;
9933 }
9934
9936 if (!action_array)
9937 {
9938 action_array = new array<ActionBase_Basic>;
9940 }
9941 if (LogManager.IsActionLogEnable())
9942 {
9943 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9944 }
9945
9946 if (action_array.Find(action) != -1)
9947 {
9948 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9949 }
9950 else
9951 {
9952 action_array.Insert(action);
9953 }
9954 }
9955
9957 {
9959 ActionBase action = player.GetActionManager().GetAction(actionName);
9962
9963 if (action_array)
9964 {
9965 action_array.RemoveItem(action);
9966 }
9967 }
9968
9969
9970
9972 {
9973 ActionOverrideData overrideData = new ActionOverrideData();
9977
9979 if (!actionMap)
9980 {
9983 }
9984
9985 actionMap.Insert(this.
Type(), overrideData);
9986
9987 }
9988
9990
9992
9993
9995 {
9998
10001
10002 string config_to_search = "CfgVehicles";
10003 string muzzle_owner_config;
10004
10006 {
10007 if (IsInherited(Weapon))
10008 config_to_search = "CfgWeapons";
10009
10010 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10011
10012 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10013
10015
10016 if (config_OnFire_subclass_count > 0)
10017 {
10018 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10019
10020 for (int i = 0; i < config_OnFire_subclass_count; i++)
10021 {
10022 string particle_class = "";
10024 string config_OnFire_entry = config_OnFire_class + particle_class;
10025 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10026 WPOF_array.Insert(WPOF);
10027 }
10028
10029
10031 }
10032 }
10033
10035 {
10036 config_to_search = "CfgWeapons";
10037 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10038
10039 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10040
10042
10043 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10044 {
10045 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10046
10047 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10048 {
10049 string particle_class2 = "";
10051 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10052 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10053 WPOBE_array.Insert(WPOBE);
10054 }
10055
10056
10058 }
10059 }
10060 }
10061
10062
10064 {
10067
10069 {
10070 string config_to_search = "CfgVehicles";
10071
10072 if (IsInherited(Weapon))
10073 config_to_search = "CfgWeapons";
10074
10075 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10076 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10077
10078 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10079 {
10080
10082
10084 {
10086 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10088 return;
10089 }
10090
10093
10094
10095
10097 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10098
10099 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10100 {
10101 string particle_class = "";
10103 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10105
10106 if (entry_type == CT_CLASS)
10107 {
10108 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10109 WPOOH_array.Insert(WPOF);
10110 }
10111 }
10112
10113
10115 }
10116 }
10117 }
10118
10120 {
10122 }
10123
10125 {
10127 {
10129
10132
10135
10136 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10137 }
10138 }
10139
10141 {
10143 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10144
10146 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10147
10149 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10150
10152 {
10154 }
10155 }
10156
10158 {
10160 }
10161
10163 {
10166 else
10168
10170 {
10173 }
10174 else
10175 {
10178
10181 }
10182
10184 }
10185
10187 {
10189 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10190 }
10191
10193 {
10195 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10197 }
10198
10200 {
10202 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10203 }
10204
10206 {
10209
10210 OverheatingParticle OP = new OverheatingParticle();
10215
10217 }
10218
10220 {
10223
10224 return -1;
10225 }
10226
10228 {
10230 {
10233
10234 for (int i = count; i > 0; --i)
10235 {
10236 int id = i - 1;
10239
10242
10243 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10244 {
10245 if (p)
10246 {
10249 }
10250 }
10251 }
10252 }
10253 }
10254
10256 {
10258 {
10260 {
10261 int id = i - 1;
10263
10264 if (OP)
10265 {
10267
10268 if (p)
10269 {
10271 }
10272
10273 delete OP;
10274 }
10275 }
10276
10279 }
10280 }
10281
10284 {
10285 return 0.0;
10286 }
10287
10288
10290 {
10291 return 250;
10292 }
10293
10295 {
10296 return 0;
10297 }
10298
10301 {
10303 return true;
10304
10305 return false;
10306 }
10307
10310 {
10313
10315 {
10317 }
10318 else
10319 {
10320
10322 }
10323
10325 }
10326
10333 {
10334 return -1;
10335 }
10336
10337
10338
10339
10341 {
10343 {
10345 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10346
10347 if (r_index >= 0)
10348 {
10349 InventoryLocation r_il = new InventoryLocation;
10350 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10351
10352 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10355 {
10356 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10357 }
10359 {
10360 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10361 }
10362
10363 }
10364
10365 player.GetHumanInventory().ClearUserReservedLocation(this);
10366 }
10367
10370 }
10371
10372
10373
10374
10376 {
10377 return ItemBase.m_DebugActionsMask;
10378 }
10379
10381 {
10382 return ItemBase.m_DebugActionsMask & mask;
10383 }
10384
10386 {
10387 ItemBase.m_DebugActionsMask = mask;
10388 }
10389
10391 {
10392 ItemBase.m_DebugActionsMask |= mask;
10393 }
10394
10396 {
10397 ItemBase.m_DebugActionsMask &= ~mask;
10398 }
10399
10401 {
10403 {
10405 }
10406 else
10407 {
10409 }
10410 }
10411
10412
10414 {
10415 if (GetEconomyProfile())
10416 {
10417 float q_max = GetEconomyProfile().GetQuantityMax();
10418 if (q_max > 0)
10419 {
10420 float q_min = GetEconomyProfile().GetQuantityMin();
10421 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10422
10424 {
10425 ComponentEnergyManager comp = GetCompEM();
10427 {
10429 }
10430 }
10432 {
10434
10435 }
10436
10437 }
10438 }
10439 }
10440
10443 {
10444 EntityAI parent = GetHierarchyParent();
10445
10446 if (parent)
10447 {
10448 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10449 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10450 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10451 }
10452 }
10453
10456 {
10457 EntityAI parent = GetHierarchyParent();
10458
10459 if (parent)
10460 {
10461 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10462 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10463 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10464 }
10465 }
10466
10468 {
10469
10470
10471
10472
10474
10476 {
10477 if (ScriptInputUserData.CanStoreInputUserData())
10478 {
10479 ScriptInputUserData ctx = new ScriptInputUserData;
10485 ctx.
Write(use_stack_max);
10488
10490 {
10491 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10492 }
10493 }
10494 }
10495 else if (!
GetGame().IsMultiplayer())
10496 {
10498 }
10499 }
10500
10502 {
10504 }
10505
10507 {
10509 }
10510
10512 {
10514 }
10515
10517 {
10518
10519 return false;
10520 }
10521
10523 {
10524 return false;
10525 }
10526
10530 {
10531 return false;
10532 }
10533
10535 {
10536 return "";
10537 }
10538
10540
10542 {
10543 return false;
10544 }
10545
10547 {
10548 return true;
10549 }
10550
10551
10552
10554 {
10555 return true;
10556 }
10557
10559 {
10560 return true;
10561 }
10562
10564 {
10565 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10567 }
10568
10570 {
10572 }
10573
10575 {
10577 if (!is_being_placed)
10579 SetSynchDirty();
10580 }
10581
10582
10584
10586 {
10588 }
10589
10591 {
10593 }
10594
10596 {
10597 return 1;
10598 }
10599
10601 {
10602 return false;
10603 }
10604
10606 {
10608 SetSynchDirty();
10609 }
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10646 {
10647 super.OnMovedInsideCargo(container);
10648
10649 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10650 }
10651
10652 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10653 {
10654 super.EEItemLocationChanged(oldLoc,newLoc);
10655
10656 PlayerBase new_player = null;
10657 PlayerBase old_player = null;
10658
10659 if (newLoc.GetParent())
10660 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10661
10662 if (oldLoc.GetParent())
10663 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10664
10666 {
10667 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10668
10669 if (r_index >= 0)
10670 {
10671 InventoryLocation r_il = new InventoryLocation;
10672 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10673
10674 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10677 {
10678 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10679 }
10681 {
10682 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10683 }
10684
10685 }
10686 }
10687
10689 {
10690 if (new_player)
10691 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10692
10693 if (new_player == old_player)
10694 {
10695
10696 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10697 {
10699 {
10700 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10701 {
10702 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10703 }
10704 }
10705 else
10706 {
10707 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10708 }
10709 }
10710
10711 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10712 {
10713 int type = oldLoc.GetType();
10715 {
10716 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10717 }
10719 {
10720 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10721 }
10722 }
10723 if (!m_OldLocation)
10724 {
10725 m_OldLocation = new InventoryLocation;
10726 }
10727 m_OldLocation.Copy(oldLoc);
10728 }
10729 else
10730 {
10731 if (m_OldLocation)
10732 {
10733 m_OldLocation.Reset();
10734 }
10735 }
10736
10738 }
10739 else
10740 {
10741 if (new_player)
10742 {
10743 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10744 if (res_index >= 0)
10745 {
10746 InventoryLocation il = new InventoryLocation;
10747 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10749 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10752 {
10753 il.
GetParent().GetOnReleaseLock().Invoke(it);
10754 }
10756 {
10758 }
10759
10760 }
10761 }
10763 {
10764
10766 }
10767
10768 if (m_OldLocation)
10769 {
10770 m_OldLocation.Reset();
10771 }
10772 }
10773 }
10774
10775 override void EOnContact(IEntity other, Contact extra)
10776 {
10778 {
10779 int liquidType = -1;
10781 if (impactSpeed > 0.0)
10782 {
10784 #ifndef SERVER
10786 #else
10788 SetSynchDirty();
10789 #endif
10791 }
10792 }
10793
10794 #ifdef SERVER
10795 if (GetCompEM() && GetCompEM().IsPlugged())
10796 {
10797 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10798 GetCompEM().UnplugThis();
10799 }
10800 #endif
10801 }
10802
10804
10806 {
10808 }
10809
10811 {
10812
10813 }
10814
10816 {
10817 super.OnItemLocationChanged(old_owner, new_owner);
10818
10819 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10820 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10821
10822 if (!relatedPlayer && playerNew)
10823 relatedPlayer = playerNew;
10824
10825 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10826 {
10828 if (actionMgr)
10829 {
10830 ActionBase currentAction = actionMgr.GetRunningAction();
10831 if (currentAction)
10833 }
10834 }
10835
10836 Man ownerPlayerOld = null;
10837 Man ownerPlayerNew = null;
10838
10839 if (old_owner)
10840 {
10841 if (old_owner.
IsMan())
10842 {
10843 ownerPlayerOld = Man.Cast(old_owner);
10844 }
10845 else
10846 {
10847 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10848 }
10849 }
10850 else
10851 {
10853 {
10855
10856 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10857 {
10858 GetCompEM().UnplugThis();
10859 }
10860 }
10861 }
10862
10863 if (new_owner)
10864 {
10865 if (new_owner.
IsMan())
10866 {
10867 ownerPlayerNew = Man.Cast(new_owner);
10868 }
10869 else
10870 {
10871 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10872 }
10873 }
10874
10875 if (ownerPlayerOld != ownerPlayerNew)
10876 {
10877 if (ownerPlayerOld)
10878 {
10879 array<EntityAI> subItemsExit = new array<EntityAI>;
10881 for (int i = 0; i < subItemsExit.Count(); i++)
10882 {
10885 }
10886 }
10887
10888 if (ownerPlayerNew)
10889 {
10890 array<EntityAI> subItemsEnter = new array<EntityAI>;
10892 for (int j = 0; j < subItemsEnter.Count(); j++)
10893 {
10896 }
10897 }
10898 }
10899 else if (ownerPlayerNew != null)
10900 {
10901 PlayerBase nplayer;
10902 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10903 {
10904 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10906 for (int k = 0; k < subItemsUpdate.Count(); k++)
10907 {
10909 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10910 }
10911 }
10912 }
10913
10914 if (old_owner)
10915 old_owner.OnChildItemRemoved(this);
10916 if (new_owner)
10917 new_owner.OnChildItemReceived(this);
10918 }
10919
10920
10922 {
10923 super.EEDelete(parent);
10924 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10925 if (player)
10926 {
10928
10929 if (player.IsAlive())
10930 {
10931 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10932 if (r_index >= 0)
10933 {
10934 InventoryLocation r_il = new InventoryLocation;
10935 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10936
10937 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10940 {
10941 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10942 }
10944 {
10945 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10946 }
10947
10948 }
10949
10950 player.RemoveQuickBarEntityShortcut(this);
10951 }
10952 }
10953 }
10954
10956 {
10957 super.EEKilled(killer);
10958
10961 {
10962 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10963 {
10964 if (IsMagazine())
10965 {
10966 if (Magazine.Cast(this).GetAmmoCount() > 0)
10967 {
10969 }
10970 }
10971 else
10972 {
10974 }
10975 }
10976 }
10977 }
10978
10980 {
10981 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10982
10983 super.OnWasAttached(parent, slot_id);
10984
10987
10989 }
10990
10992 {
10993 super.OnWasDetached(parent, slot_id);
10994
10997 }
10998
11000 {
11001 int idx;
11004
11005 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11006 if (inventory_slots.Count() < 1)
11007 {
11008 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11009 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11010 }
11011 else
11012 {
11013 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11014 }
11015
11016 idx = inventory_slots.Find(slot);
11017 if (idx < 0)
11018 return "";
11019
11020 return attach_types.Get(idx);
11021 }
11022
11024 {
11025 int idx = -1;
11026 string slot;
11027
11030
11031 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11032 if (inventory_slots.Count() < 1)
11033 {
11034 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11035 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11036 }
11037 else
11038 {
11039 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11040 if (detach_types.Count() < 1)
11041 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11042 }
11043
11044 for (int i = 0; i < inventory_slots.Count(); i++)
11045 {
11046 slot = inventory_slots.Get(i);
11047 }
11048
11049 if (slot != "")
11050 {
11051 if (detach_types.Count() == 1)
11052 idx = 0;
11053 else
11054 idx = inventory_slots.Find(slot);
11055 }
11056 if (idx < 0)
11057 return "";
11058
11059 return detach_types.Get(idx);
11060 }
11061
11063 {
11064
11066
11067
11068 float min_time = 1;
11069 float max_time = 3;
11070 float delay = Math.RandomFloat(min_time, max_time);
11071
11072 explode_timer.Run(delay, this, "DoAmmoExplosion");
11073 }
11074
11076 {
11077 Magazine magazine = Magazine.Cast(this);
11078 int pop_sounds_count = 6;
11079 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11080
11081
11082 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11083 string sound_name = pop_sounds[ sound_idx ];
11085
11086
11087 magazine.ServerAddAmmoCount(-1);
11088
11089
11090 float min_temp_to_explode = 100;
11091
11092 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11093 {
11095 }
11096 }
11097
11098
11099 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11100 {
11101 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11102
11103 const int CHANCE_DAMAGE_CARGO = 4;
11104 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11105 const int CHANCE_DAMAGE_NOTHING = 2;
11106
11108 {
11109 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11110 int chances;
11111 int rnd;
11112
11113 if (GetInventory().GetCargo())
11114 {
11115 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11116 rnd = Math.RandomInt(0,chances);
11117
11118 if (rnd < CHANCE_DAMAGE_CARGO)
11119 {
11121 }
11122 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11123 {
11125 }
11126 }
11127 else
11128 {
11129 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11130 rnd = Math.RandomInt(0,chances);
11131
11132 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11133 {
11135 }
11136 }
11137 }
11138 }
11139
11141 {
11142 if (GetInventory().GetCargo())
11143 {
11144 int item_count = GetInventory().GetCargo().GetItemCount();
11145 if (item_count > 0)
11146 {
11147 int random_pick = Math.RandomInt(0, item_count);
11149 if (!item.IsExplosive())
11150 {
11151 item.AddHealth("","",damage);
11152 return true;
11153 }
11154 }
11155 }
11156 return false;
11157 }
11158
11160 {
11161 int attachment_count = GetInventory().AttachmentCount();
11162 if (attachment_count > 0)
11163 {
11164 int random_pick = Math.RandomInt(0, attachment_count);
11165 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11166 if (!attachment.IsExplosive())
11167 {
11168 attachment.AddHealth("","",damage);
11169 return true;
11170 }
11171 }
11172 return false;
11173 }
11174
11176 {
11178 }
11179
11181 {
11183 return GetInventory().CanRemoveEntity();
11184
11185 return false;
11186 }
11187
11189 {
11190
11192 return false;
11193
11194
11196 return false;
11197
11198
11199
11201 if (delta == 0)
11202 return false;
11203
11204
11205 return true;
11206 }
11207
11209 {
11211 {
11212 if (ScriptInputUserData.CanStoreInputUserData())
11213 {
11214 ScriptInputUserData ctx = new ScriptInputUserData;
11219 ctx.
Write(destination_entity);
11221 ctx.
Write(slot_id);
11223 }
11224 }
11225 else if (!
GetGame().IsMultiplayer())
11226 {
11228 }
11229 }
11230
11232 {
11233 float split_quantity_new;
11237 InventoryLocation loc = new InventoryLocation;
11238
11239 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11240 {
11242 split_quantity_new = stack_max;
11243 else
11245
11247 {
11248 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11249 if (new_item)
11250 {
11251 new_item.SetResultOfSplit(true);
11252 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11254 new_item.
SetQuantity(split_quantity_new,
false,
true);
11255 }
11256 }
11257 }
11258 else if (destination_entity && slot_id == -1)
11259 {
11260 if (quantity > stack_max)
11261 split_quantity_new = stack_max;
11262 else
11263 split_quantity_new = quantity;
11264
11266 {
11268 {
11271 }
11272
11273 if (new_item)
11274 {
11275 new_item.SetResultOfSplit(true);
11276 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11278 new_item.
SetQuantity(split_quantity_new,
false,
true);
11279 }
11280 }
11281 }
11282 else
11283 {
11284 if (stack_max != 0)
11285 {
11287 {
11289 }
11290
11291 if (split_quantity_new == 0)
11292 {
11293 if (!
GetGame().IsMultiplayer())
11294 player.PhysicalPredictiveDropItem(this);
11295 else
11296 player.ServerDropEntity(this);
11297 return;
11298 }
11299
11301 {
11303
11304 if (new_item)
11305 {
11306 new_item.SetResultOfSplit(true);
11307 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11310 new_item.PlaceOnSurface();
11311 }
11312 }
11313 }
11314 }
11315 }
11316
11318 {
11319 float split_quantity_new;
11323 InventoryLocation loc = new InventoryLocation;
11324
11325 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11326 {
11328 split_quantity_new = stack_max;
11329 else
11331
11333 {
11334 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11335 if (new_item)
11336 {
11337 new_item.SetResultOfSplit(true);
11338 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11340 new_item.
SetQuantity(split_quantity_new,
false,
true);
11341 }
11342 }
11343 }
11344 else if (destination_entity && slot_id == -1)
11345 {
11346 if (quantity > stack_max)
11347 split_quantity_new = stack_max;
11348 else
11349 split_quantity_new = quantity;
11350
11352 {
11354 {
11357 }
11358
11359 if (new_item)
11360 {
11361 new_item.SetResultOfSplit(true);
11362 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11364 new_item.
SetQuantity(split_quantity_new,
false,
true);
11365 }
11366 }
11367 }
11368 else
11369 {
11370 if (stack_max != 0)
11371 {
11373 {
11375 }
11376
11378 {
11380
11381 if (new_item)
11382 {
11383 new_item.SetResultOfSplit(true);
11384 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11387 new_item.PlaceOnSurface();
11388 }
11389 }
11390 }
11391 }
11392 }
11393
11395 {
11397 {
11398 if (ScriptInputUserData.CanStoreInputUserData())
11399 {
11400 ScriptInputUserData ctx = new ScriptInputUserData;
11405 dst.WriteToContext(ctx);
11407 }
11408 }
11409 else if (!
GetGame().IsMultiplayer())
11410 {
11412 }
11413 }
11414
11416 {
11418 {
11419 if (ScriptInputUserData.CanStoreInputUserData())
11420 {
11421 ScriptInputUserData ctx = new ScriptInputUserData;
11426 ctx.
Write(destination_entity);
11432 }
11433 }
11434 else if (!
GetGame().IsMultiplayer())
11435 {
11437 }
11438 }
11439
11441 {
11443 }
11444
11446 {
11448 float split_quantity_new;
11450 if (dst.IsValid())
11451 {
11452 int slot_id = dst.GetSlot();
11454
11455 if (quantity > stack_max)
11456 split_quantity_new = stack_max;
11457 else
11458 split_quantity_new = quantity;
11459
11461 {
11463
11464 if (new_item)
11465 {
11466 new_item.SetResultOfSplit(true);
11467 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11469 new_item.
SetQuantity(split_quantity_new,
false,
true);
11470 }
11471
11472 return new_item;
11473 }
11474 }
11475
11476 return null;
11477 }
11478
11480 {
11482 float split_quantity_new;
11484 if (destination_entity)
11485 {
11487 if (quantity > stackable)
11488 split_quantity_new = stackable;
11489 else
11490 split_quantity_new = quantity;
11491
11493 {
11494 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11495 if (new_item)
11496 {
11497 new_item.SetResultOfSplit(true);
11498 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11500 new_item.
SetQuantity(split_quantity_new,
false,
true);
11501 }
11502 }
11503 }
11504 }
11505
11507 {
11509 {
11510 if (ScriptInputUserData.CanStoreInputUserData())
11511 {
11512 ScriptInputUserData ctx = new ScriptInputUserData;
11517 ItemBase destination_entity =
this;
11518 ctx.
Write(destination_entity);
11522 }
11523 }
11524 else if (!
GetGame().IsMultiplayer())
11525 {
11527 }
11528 }
11529
11531 {
11533 float split_quantity_new;
11535 if (player)
11536 {
11538 if (quantity > stackable)
11539 split_quantity_new = stackable;
11540 else
11541 split_quantity_new = quantity;
11542
11544 {
11545 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11546 new_item =
ItemBase.Cast(in_hands);
11547 if (new_item)
11548 {
11549 new_item.SetResultOfSplit(true);
11550 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11552 new_item.SetQuantity(split_quantity_new, false, true);
11553 }
11554 }
11555 }
11556 }
11557
11559 {
11561 float split_quantity_new = Math.Floor(quantity * 0.5);
11562
11564 return;
11565
11567
11568 if (new_item)
11569 {
11570 if (new_item.GetQuantityMax() < split_quantity_new)
11571 {
11572 split_quantity_new = new_item.GetQuantityMax();
11573 }
11574
11575 new_item.SetResultOfSplit(true);
11576 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11577
11579 {
11582 }
11583 else
11584 {
11586 new_item.
SetQuantity(split_quantity_new,
false,
true);
11587 }
11588 }
11589 }
11590
11592 {
11594 float split_quantity_new = Math.Floor(quantity / 2);
11595
11597 return;
11598
11599 InventoryLocation invloc = new InventoryLocation;
11601
11603 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11604
11605 if (new_item)
11606 {
11607 if (new_item.GetQuantityMax() < split_quantity_new)
11608 {
11609 split_quantity_new = new_item.GetQuantityMax();
11610 }
11612 {
11615 }
11616 else if (split_quantity_new > 1)
11617 {
11619 new_item.
SetQuantity(split_quantity_new,
false,
true);
11620 }
11621 }
11622 }
11623
11626 {
11627 SetWeightDirty();
11629
11630 if (parent)
11631 parent.OnAttachmentQuantityChangedEx(this, delta);
11632
11634 {
11636 {
11638 }
11640 {
11641 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11643 }
11644 }
11645
11646 }
11647
11650 {
11651
11652 }
11653
11656 {
11658 }
11659
11661 {
11662 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11663
11665 {
11666 if (newLevel == GameConstants.STATE_RUINED)
11667 {
11669 EntityAI parent = GetHierarchyParent();
11670 if (parent && parent.IsFireplace())
11671 {
11672 CargoBase cargo = GetInventory().GetCargo();
11673 if (cargo)
11674 {
11676 {
11678 }
11679 }
11680 }
11681 }
11682
11684 {
11685
11687 return;
11688 }
11689
11690 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11691 {
11693 }
11694 }
11695 }
11696
11697
11699 {
11700 super.OnRightClick();
11701
11703 {
11705 {
11706 if (ScriptInputUserData.CanStoreInputUserData())
11707 {
11708 EntityAI root = GetHierarchyRoot();
11709 Man playerOwner = GetHierarchyRootPlayer();
11710 InventoryLocation dst = new InventoryLocation;
11711
11712
11713 if (!playerOwner && root && root == this)
11714 {
11716 }
11717 else
11718 {
11719
11720 GetInventory().GetCurrentInventoryLocation(dst);
11722 {
11725 {
11727 }
11728 else
11729 {
11731
11732
11733 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11734 {
11736 }
11737 else
11738 {
11739 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11740 }
11741 }
11742 }
11743 }
11744
11745 ScriptInputUserData ctx = new ScriptInputUserData;
11753 }
11754 }
11755 else if (!
GetGame().IsMultiplayer())
11756 {
11758 }
11759 }
11760 }
11761
11763 {
11764 if (root)
11765 {
11766 vector m4[4];
11767 root.GetTransform(m4);
11768 dst.SetGround(this, m4);
11769 }
11770 else
11771 {
11772 GetInventory().GetCurrentInventoryLocation(dst);
11773 }
11774 }
11775
11776 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11777 {
11778
11779 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11780 return false;
11781
11782 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11783 return false;
11784
11785
11787 return false;
11788
11789
11790 Magazine mag = Magazine.Cast(this);
11791 if (mag)
11792 {
11793 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11794 return false;
11795
11796 if (stack_max_limit)
11797 {
11798 Magazine other_mag = Magazine.Cast(other_item);
11799 if (other_item)
11800 {
11801 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11802 return false;
11803 }
11804
11805 }
11806 }
11807 else
11808 {
11809
11811 return false;
11812
11814 return false;
11815 }
11816
11817 PlayerBase player = null;
11818 if (CastTo(player, GetHierarchyRootPlayer()))
11819 {
11820 if (player.GetInventory().HasAttachment(this))
11821 return false;
11822
11823 if (player.IsItemsToDelete())
11824 return false;
11825 }
11826
11827 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11828 return false;
11829
11830 int slotID;
11832 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11833 return false;
11834
11835 return true;
11836 }
11837
11839 {
11841 }
11842
11844 {
11845 return m_IsResultOfSplit;
11846 }
11847
11849 {
11850 m_IsResultOfSplit = value;
11851 }
11852
11854 {
11856 }
11857
11859 {
11860 float other_item_quantity = other_item.GetQuantity();
11861 float this_free_space;
11862
11864
11866
11867 if (other_item_quantity > this_free_space)
11868 {
11869 return this_free_space;
11870 }
11871 else
11872 {
11873 return other_item_quantity;
11874 }
11875 }
11876
11878 {
11880 }
11881
11883 {
11885 return;
11886
11887 if (!IsMagazine() && other_item)
11888 {
11890 if (quantity_used != 0)
11891 {
11892 float hp1 = GetHealth01("","");
11893 float hp2 = other_item.GetHealth01("","");
11894 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11895 hpResult = hpResult / (
GetQuantity() + quantity_used);
11896
11897 hpResult *= GetMaxHealth();
11898 Math.Round(hpResult);
11899 SetHealth("", "Health", hpResult);
11900
11902 other_item.AddQuantity(-quantity_used);
11903 }
11904 }
11906 }
11907
11909 {
11910 #ifdef SERVER
11911 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11912 GetHierarchyParent().IncreaseLifetimeUp();
11913 #endif
11914 };
11915
11917 {
11918 PlayerBase p = PlayerBase.Cast(player);
11919
11920 array<int> recipesIds = p.m_Recipes;
11921 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11922 if (moduleRecipesManager)
11923 {
11924 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11925 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11926 }
11927
11928 for (int i = 0;i < recipesIds.Count(); i++)
11929 {
11930 int key = recipesIds.Get(i);
11931 string recipeName = moduleRecipesManager.GetRecipeName(key);
11933 }
11934 }
11935
11936
11937 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11938 {
11939 super.GetDebugActions(outputList);
11940
11941
11947
11948
11953
11958
11959
11963
11964
11966 {
11970 }
11971
11974
11975
11979
11981
11982 InventoryLocation loc = new InventoryLocation();
11983 GetInventory().GetCurrentInventoryLocation(loc);
11985 {
11986 if (Gizmo_IsSupported())
11989 }
11990
11992 }
11993
11994
11995
11996
11998 {
11999 super.OnAction(action_id, player, ctx);
12000
12002 {
12003 switch (action_id)
12004 {
12007 return true;
12010 return true;
12011 }
12012 }
12013
12015 {
12016 switch (action_id)
12017 {
12019 Delete();
12020 return true;
12021 }
12022 }
12023
12024 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12025 {
12026 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12027 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12028 PlayerBase p = PlayerBase.Cast(player);
12029 if (
EActions.RECIPES_RANGE_START < 1000)
12030 {
12031 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12032 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12033 }
12034 }
12035 #ifndef SERVER
12036 else if (action_id ==
EActions.WATCH_PLAYER)
12037 {
12038 PluginDeveloper.SetDeveloperItemClientEx(player);
12039 }
12040 #endif
12042 {
12043 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12044 {
12045 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12046 OnDebugButtonPressServer(id + 1);
12047 }
12048
12049 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12050 {
12051 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12053 }
12054
12055 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12056 {
12057 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12059 }
12060
12061 else if (action_id ==
EActions.ADD_QUANTITY)
12062 {
12063 if (IsMagazine())
12064 {
12065 Magazine mag = Magazine.Cast(this);
12066 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12067 }
12068 else
12069 {
12071 }
12072
12073 if (m_EM)
12074 {
12075 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12076 }
12077
12078 }
12079
12080 else if (action_id ==
EActions.REMOVE_QUANTITY)
12081 {
12082 if (IsMagazine())
12083 {
12084 Magazine mag2 = Magazine.Cast(this);
12085 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12086 }
12087 else
12088 {
12090 }
12091 if (m_EM)
12092 {
12093 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12094 }
12095
12096 }
12097
12098 else if (action_id ==
EActions.SET_QUANTITY_0)
12099 {
12101
12102 if (m_EM)
12103 {
12104 m_EM.SetEnergy(0);
12105 }
12106 }
12107
12108 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12109 {
12111
12112 if (m_EM)
12113 {
12114 m_EM.SetEnergy(m_EM.GetEnergyMax());
12115 }
12116 }
12117
12118 else if (action_id ==
EActions.ADD_HEALTH)
12119 {
12120 AddHealth("","",GetMaxHealth("","Health")/5);
12121 }
12122 else if (action_id ==
EActions.REMOVE_HEALTH)
12123 {
12124 AddHealth("","",-GetMaxHealth("","Health")/5);
12125 }
12126 else if (action_id ==
EActions.DESTROY_HEALTH)
12127 {
12128 SetHealth01("","",0);
12129 }
12130 else if (action_id ==
EActions.WATCH_ITEM)
12131 {
12133 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12134 #ifdef DEVELOPER
12135 SetDebugDeveloper_item(this);
12136 #endif
12137 }
12138
12139 else if (action_id ==
EActions.ADD_TEMPERATURE)
12140 {
12141 AddTemperature(20);
12142
12143 }
12144
12145 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12146 {
12147 AddTemperature(-20);
12148
12149 }
12150
12151 else if (action_id ==
EActions.FLIP_FROZEN)
12152 {
12153 SetFrozen(!GetIsFrozen());
12154
12155 }
12156
12157 else if (action_id ==
EActions.ADD_WETNESS)
12158 {
12160
12161 }
12162
12163 else if (action_id ==
EActions.REMOVE_WETNESS)
12164 {
12166
12167 }
12168
12169 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12170 {
12173
12174
12175 }
12176
12177 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12178 {
12181 }
12182
12183 else if (action_id ==
EActions.MAKE_SPECIAL)
12184 {
12185 auto debugParams = DebugSpawnParams.WithPlayer(player);
12186 OnDebugSpawnEx(debugParams);
12187 }
12188
12189 }
12190
12191
12192 return false;
12193 }
12194
12195
12196
12197
12201
12204
12205
12206
12208 {
12209 return false;
12210 }
12211
12212
12214 {
12215 return true;
12216 }
12217
12218
12220 {
12221 return true;
12222 }
12223
12224
12225
12227 {
12228 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12230 }
12231
12234 {
12235 return null;
12236 }
12237
12239 {
12240 return false;
12241 }
12242
12244 {
12245 return false;
12246 }
12247
12251
12252
12254 {
12255 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12256 return module_repairing.CanRepair(this, item_repair_kit);
12257 }
12258
12259
12260 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12261 {
12262 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12263 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12264 }
12265
12266
12268 {
12269
12270
12271
12272
12273
12274
12275
12276
12277 return 1;
12278 }
12279
12280
12281
12283 {
12285 }
12286
12287
12288
12290 {
12292 }
12293
12294
12303 {
12304 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12305
12306 if (player)
12307 {
12308 player.MessageStatus(text);
12309 }
12310 }
12311
12312
12321 {
12322 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12323
12324 if (player)
12325 {
12326 player.MessageAction(text);
12327 }
12328 }
12329
12330
12339 {
12340 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12341
12342 if (player)
12343 {
12344 player.MessageFriendly(text);
12345 }
12346 }
12347
12348
12357 {
12358 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12359
12360 if (player)
12361 {
12362 player.MessageImportant(text);
12363 }
12364 }
12365
12367 {
12368 return true;
12369 }
12370
12371
12372 override bool KindOf(
string tag)
12373 {
12374 bool found = false;
12375 string item_name = this.
GetType();
12378
12379 int array_size = item_tag_array.Count();
12380 for (int i = 0; i < array_size; i++)
12381 {
12382 if (item_tag_array.Get(i) == tag)
12383 {
12384 found = true;
12385 break;
12386 }
12387 }
12388 return found;
12389 }
12390
12391
12393 {
12394
12395 super.OnRPC(sender, rpc_type,ctx);
12396
12397
12398 switch (rpc_type)
12399 {
12400 #ifndef SERVER
12401 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12402 Param2<bool, string> p = new Param2<bool, string>(false, "");
12403
12405 return;
12406
12407 bool play = p.param1;
12408 string soundSet = p.param2;
12409
12410 if (play)
12411 {
12413 {
12415 {
12417 }
12418 }
12419 else
12420 {
12422 }
12423 }
12424 else
12425 {
12427 }
12428
12429 break;
12430 #endif
12431
12432 }
12433
12435 {
12437 }
12438 }
12439
12440
12441
12442
12444 {
12445 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12446 return plugin.GetID(
name);
12447 }
12448
12450 {
12451 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12452 return plugin.GetName(id);
12453 }
12454
12457 {
12458
12459
12460 int varFlags;
12461 if (!ctx.
Read(varFlags))
12462 return;
12463
12464 if (varFlags & ItemVariableFlags.FLOAT)
12465 {
12467 }
12468 }
12469
12471 {
12472
12473 super.SerializeNumericalVars(floats_out);
12474
12475
12476
12478 {
12480 }
12481
12483 {
12485 }
12486
12488 {
12490 }
12491
12493 {
12498 }
12499
12501 {
12503 }
12504 }
12505
12507 {
12508
12509 super.DeSerializeNumericalVars(floats);
12510
12511
12512 int index = 0;
12513 int mask = Math.Round(floats.Get(index));
12514
12515 index++;
12516
12518 {
12520 {
12522 }
12523 else
12524 {
12525 float quantity = floats.Get(index);
12526 SetQuantity(quantity,
true,
false,
false,
false);
12527 }
12528 index++;
12529 }
12530
12532 {
12533 float wet = floats.Get(index);
12535 index++;
12536 }
12537
12539 {
12540 int liquidtype = Math.Round(floats.Get(index));
12542 index++;
12543 }
12544
12546 {
12548 index++;
12550 index++;
12552 index++;
12554 index++;
12555 }
12556
12558 {
12559 int cleanness = Math.Round(floats.Get(index));
12561 index++;
12562 }
12563 }
12564
12566 {
12567 super.WriteVarsToCTX(ctx);
12568
12569
12571 {
12573 }
12574
12576 {
12578 }
12579
12581 {
12583 }
12584
12586 {
12587 int r,g,b,a;
12593 }
12594
12596 {
12598 }
12599 }
12600
12602 {
12603 if (!super.ReadVarsFromCTX(ctx,version))
12604 return false;
12605
12606 int intValue;
12607 float value;
12608
12609 if (version < 140)
12610 {
12611 if (!ctx.
Read(intValue))
12612 return false;
12613
12614 m_VariablesMask = intValue;
12615 }
12616
12618 {
12619 if (!ctx.
Read(value))
12620 return false;
12621
12623 {
12625 }
12626 else
12627 {
12629 }
12630 }
12631
12632 if (version < 140)
12633 {
12635 {
12636 if (!ctx.
Read(value))
12637 return false;
12638 SetTemperatureDirect(value);
12639 }
12640 }
12641
12643 {
12644 if (!ctx.
Read(value))
12645 return false;
12647 }
12648
12650 {
12651 if (!ctx.
Read(intValue))
12652 return false;
12654 }
12655
12657 {
12658 int r,g,b,a;
12660 return false;
12662 return false;
12664 return false;
12666 return false;
12667
12669 }
12670
12672 {
12673 if (!ctx.
Read(intValue))
12674 return false;
12676 }
12677
12678 if (version >= 138 && version < 140)
12679 {
12681 {
12682 if (!ctx.
Read(intValue))
12683 return false;
12684 SetFrozen(intValue);
12685 }
12686 }
12687
12688 return true;
12689 }
12690
12691
12693 {
12696 {
12698 }
12699
12700 if (!super.OnStoreLoad(ctx, version))
12701 {
12703 return false;
12704 }
12705
12706 if (version >= 114)
12707 {
12708 bool hasQuickBarIndexSaved;
12709
12710 if (!ctx.
Read(hasQuickBarIndexSaved))
12711 {
12713 return false;
12714 }
12715
12716 if (hasQuickBarIndexSaved)
12717 {
12718 int itmQBIndex;
12719
12720
12721 if (!ctx.
Read(itmQBIndex))
12722 {
12724 return false;
12725 }
12726
12727 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12728 if (itmQBIndex != -1 && parentPlayer)
12729 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12730 }
12731 }
12732 else
12733 {
12734
12735 PlayerBase player;
12736 int itemQBIndex;
12737 if (version ==
int.
MAX)
12738 {
12739 if (!ctx.
Read(itemQBIndex))
12740 {
12742 return false;
12743 }
12744 }
12745 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12746 {
12747
12748 if (!ctx.
Read(itemQBIndex))
12749 {
12751 return false;
12752 }
12753 if (itemQBIndex != -1 && player)
12754 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12755 }
12756 }
12757
12758 if (version < 140)
12759 {
12760
12761 if (!LoadVariables(ctx, version))
12762 {
12764 return false;
12765 }
12766 }
12767
12768
12770 {
12772 return false;
12773 }
12774 if (version >= 132)
12775 {
12777 if (raib)
12778 {
12780 {
12782 return false;
12783 }
12784 }
12785 }
12786
12788 return true;
12789 }
12790
12791
12792
12794 {
12795 super.OnStoreSave(ctx);
12796
12797 PlayerBase player;
12798 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12799 {
12801
12802 int itemQBIndex = -1;
12803 itemQBIndex = player.FindQuickBarEntityIndex(this);
12804 ctx.
Write(itemQBIndex);
12805 }
12806 else
12807 {
12809 }
12810
12812
12814 if (raib)
12815 {
12817 }
12818 }
12819
12820
12822 {
12823 super.AfterStoreLoad();
12824
12826 {
12828 }
12829
12831 {
12834 }
12835 }
12836
12838 {
12839 super.EEOnAfterLoad();
12840
12842 {
12844 }
12845
12848 }
12849
12851 {
12852 return false;
12853 }
12854
12855
12856
12858 {
12860 {
12861 #ifdef PLATFORM_CONSOLE
12862
12864 {
12866 if (menu)
12867 {
12869 }
12870 }
12871 #endif
12872 }
12873
12875 {
12878 }
12879
12881 {
12882 SetWeightDirty();
12884 }
12886 {
12889 }
12890
12892 {
12895 }
12897 {
12900 }
12901
12902 super.OnVariablesSynchronized();
12903 }
12904
12905
12906
12908 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12909 {
12910 if (!IsServerCheck(allow_client))
12911 return false;
12912
12914 return false;
12915
12918
12919 if (value <= (min + 0.001))
12920 value = min;
12921
12922 if (value == min)
12923 {
12924 if (destroy_config)
12925 {
12926 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12927 if (dstr)
12928 {
12930 this.Delete();
12931 return true;
12932 }
12933 }
12934 else if (destroy_forced)
12935 {
12937 this.Delete();
12938 return true;
12939 }
12940
12942 }
12943
12946
12948 {
12950
12951 if (delta)
12953 }
12954
12956
12957 return false;
12958 }
12959
12960
12962 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12963 {
12965 }
12966
12968 {
12971 }
12972
12974 {
12977 }
12978
12980 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12981 {
12982 float value_clamped = Math.Clamp(value, 0, 1);
12984 SetQuantity(result, destroy_config, destroy_forced);
12985 }
12986
12987
12990 {
12992 }
12993
12995 {
12997 }
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13009 {
13010 int slot = -1;
13011 if (GetInventory())
13012 {
13013 InventoryLocation il = new InventoryLocation;
13014 GetInventory().GetCurrentInventoryLocation(il);
13016 }
13017
13019 }
13020
13022 {
13023 float quantity_max = 0;
13024
13026 {
13027 if (attSlotID != -1)
13028 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13029
13030 if (quantity_max <= 0)
13032 }
13033
13034 if (quantity_max <= 0)
13036
13037 return quantity_max;
13038 }
13039
13041 {
13043 }
13044
13046 {
13048 }
13049
13050
13052 {
13054 }
13055
13057 {
13059 }
13060
13062 {
13064 }
13065
13066
13068 {
13069
13070 float weightEx = GetWeightEx();
13071 float special = GetInventoryAndCargoWeight();
13072 return weightEx - special;
13073 }
13074
13075
13077 {
13079 }
13080
13082 {
13084 {
13085 #ifdef DEVELOPER
13086 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13087 {
13088 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13090 }
13091 #endif
13092
13093 return GetQuantity() * GetConfigWeightModified();
13094 }
13095 else if (HasEnergyManager())
13096 {
13097 #ifdef DEVELOPER
13098 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13099 {
13100 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13101 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13102 }
13103 #endif
13104 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13105 }
13106 else
13107 {
13108 #ifdef DEVELOPER
13109 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13110 {
13111 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13112 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13113 }
13114 #endif
13115 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13116 }
13117 }
13118
13121 {
13122 int item_count = 0;
13124
13125 if (GetInventory().GetCargo() != NULL)
13126 {
13127 item_count = GetInventory().GetCargo().GetItemCount();
13128 }
13129
13130 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13131 {
13132 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13133 if (item)
13134 item_count += item.GetNumberOfItems();
13135 }
13136 return item_count;
13137 }
13138
13141 {
13142 float weight = 0;
13143 float wetness = 1;
13144 if (include_wetness)
13147 {
13148 weight = wetness * m_ConfigWeight;
13149 }
13151 {
13152 weight = 1;
13153 }
13154 return weight;
13155 }
13156
13157
13158
13160 {
13161 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13162 {
13163 GameInventory inv = GetInventory();
13164 array<EntityAI> items = new array<EntityAI>;
13166 for (int i = 0; i < items.Count(); i++)
13167 {
13169 if (item)
13170 {
13172 }
13173 }
13174 }
13175 }
13176
13177
13178
13179
13181 {
13182 float energy = 0;
13183 if (HasEnergyManager())
13184 {
13185 energy = GetCompEM().GetEnergy();
13186 }
13187 return energy;
13188 }
13189
13190
13192 {
13193 super.OnEnergyConsumed();
13194
13196 }
13197
13199 {
13200 super.OnEnergyAdded();
13201
13203 }
13204
13205
13207 {
13208 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13209 {
13211 {
13212 float energy_0to1 = GetCompEM().GetEnergy0To1();
13214 }
13215 }
13216 }
13217
13218
13220 {
13221 return ConfigGetFloat("heatIsolation");
13222 }
13223
13225 {
13227 }
13228
13230 {
13231 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13232 if (
GetGame().ConfigIsExisting(paramPath))
13234
13235 return 0.0;
13236 }
13237
13239 {
13240 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13241 if (
GetGame().ConfigIsExisting(paramPath))
13243
13244 return 0.0;
13245 }
13246
13247 override void SetWet(
float value,
bool allow_client =
false)
13248 {
13249 if (!IsServerCheck(allow_client))
13250 return;
13251
13254
13256
13257 m_VarWet = Math.Clamp(value, min, max);
13258
13260 {
13263 }
13264 }
13265
13266 override void AddWet(
float value)
13267 {
13269 }
13270
13272 {
13274 }
13275
13277 {
13279 }
13280
13282 {
13284 }
13285
13287 {
13289 }
13290
13292 {
13294 }
13295
13296 override void OnWetChanged(
float newVal,
float oldVal)
13297 {
13300 if (newLevel != oldLevel)
13301 {
13303 }
13304 }
13305
13307 {
13308 SetWeightDirty();
13309 }
13310
13312 {
13313 return GetWetLevelInternal(
m_VarWet);
13314 }
13315
13316
13317
13319 {
13321 }
13322
13324 {
13326 }
13327
13329 {
13331 }
13332
13334 {
13336 }
13337
13338
13339
13341 {
13342 if (ConfigIsExisting("itemModelLength"))
13343 {
13344 return ConfigGetFloat("itemModelLength");
13345 }
13346 return 0;
13347 }
13348
13350 {
13351 if (ConfigIsExisting("itemAttachOffset"))
13352 {
13353 return ConfigGetFloat("itemAttachOffset");
13354 }
13355 return 0;
13356 }
13357
13358 override void SetCleanness(
int value,
bool allow_client =
false)
13359 {
13360 if (!IsServerCheck(allow_client))
13361 return;
13362
13364
13366
13369 }
13370
13372 {
13374 }
13375
13377 {
13378 return true;
13379 }
13380
13381
13382
13383
13385 {
13387 }
13388
13390 {
13392 }
13393
13394
13395
13396
13397 override void SetColor(
int r,
int g,
int b,
int a)
13398 {
13404 }
13406 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13407 {
13412 }
13413
13415 {
13417 }
13418
13421 {
13422 int r,g,b,a;
13424 r = r/255;
13425 g = g/255;
13426 b = b/255;
13427 a = a/255;
13428 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13429 }
13430
13431
13432
13433 override void SetLiquidType(
int value,
bool allow_client =
false)
13434 {
13435 if (!IsServerCheck(allow_client))
13436 return;
13437
13442 }
13443
13445 {
13446 return ConfigGetInt("varLiquidTypeInit");
13447 }
13448
13450 {
13452 }
13453
13455 {
13457 SetFrozen(false);
13458 }
13459
13462 {
13463 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13464 }
13465
13466
13469 {
13470 PlayerBase nplayer;
13471 if (PlayerBase.CastTo(nplayer, player))
13472 {
13474
13475 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13476 }
13477 }
13478
13479
13482 {
13483 PlayerBase nplayer;
13484 if (PlayerBase.CastTo(nplayer,player))
13485 {
13486
13487 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13488
13489 }
13490
13491
13492 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13493
13494
13495 if (HasEnergyManager())
13496 {
13497 GetCompEM().UpdatePlugState();
13498 }
13499 }
13500
13501
13503 {
13504 super.OnPlacementStarted(player);
13505
13507 }
13508
13509 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13510 {
13512 {
13513 m_AdminLog.OnPlacementComplete(player,
this);
13514 }
13515
13516 super.OnPlacementComplete(player, position, orientation);
13517 }
13518
13519
13520
13521
13522
13524 {
13526 {
13527 return true;
13528 }
13529 else
13530 {
13531 return false;
13532 }
13533 }
13534
13535
13537 {
13539 {
13541 }
13542 }
13543
13544
13546 {
13548 }
13549
13551 {
13553 }
13554
13555 override void InsertAgent(
int agent,
float count = 1)
13556 {
13557 if (count < 1)
13558 return;
13559
13561 }
13562
13565 {
13567 }
13568
13569
13571 {
13573 }
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13617 {
13619 return false;
13620 return true;
13621 }
13622
13624 {
13625
13627 }
13628
13629
13632 {
13633 super.CheckForRoofLimited(timeTresholdMS);
13634
13636 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13637 {
13638 m_PreviousRoofTestTime = time;
13639 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13640 }
13641 }
13642
13643
13645 {
13647 {
13648 return 0;
13649 }
13650
13651 if (GetInventory().GetAttachmentSlotsCount() != 0)
13652 {
13653 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13654 if (filter)
13655 return filter.GetProtectionLevel(type, false, system);
13656 else
13657 return 0;
13658 }
13659
13660 string subclassPath, entryName;
13661
13662 switch (type)
13663 {
13665 entryName = "biological";
13666 break;
13668 entryName = "chemical";
13669 break;
13670 default:
13671 entryName = "biological";
13672 break;
13673 }
13674
13675 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13676
13678 }
13679
13680
13681
13684 {
13685 if (!IsMagazine())
13687
13689 }
13690
13691
13692
13693
13694
13699 {
13700 return true;
13701 }
13702
13704 {
13706 }
13707
13708
13709
13710
13711
13713 {
13714 if (parent)
13715 {
13716 if (parent.IsInherited(DayZInfected))
13717 return true;
13718
13719 if (!parent.IsRuined())
13720 return true;
13721 }
13722
13723 return true;
13724 }
13725
13727 {
13728 if (!super.CanPutAsAttachment(parent))
13729 {
13730 return false;
13731 }
13732
13733 if (!IsRuined() && !parent.IsRuined())
13734 {
13735 return true;
13736 }
13737
13738 return false;
13739 }
13740
13742 {
13743
13744
13745
13746
13747 return super.CanReceiveItemIntoCargo(item);
13748 }
13749
13751 {
13752
13753
13754
13755
13756 GameInventory attachmentInv = attachment.GetInventory();
13758 {
13759 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13760 return false;
13761 }
13762
13763 InventoryLocation loc = new InventoryLocation();
13764 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13765 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13766 return false;
13767
13768 return super.CanReceiveAttachment(attachment, slotId);
13769 }
13770
13772 {
13773 if (!super.CanReleaseAttachment(attachment))
13774 return false;
13775
13776 return GetInventory().AreChildrenAccessible();
13777 }
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13800 {
13801 int id = muzzle_owner.GetMuzzleID();
13802 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13803
13804 if (WPOF_array)
13805 {
13806 for (int i = 0; i < WPOF_array.Count(); i++)
13807 {
13808 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13809
13810 if (WPOF)
13811 {
13812 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13813 }
13814 }
13815 }
13816 }
13817
13818
13820 {
13821 int id = muzzle_owner.GetMuzzleID();
13823
13824 if (WPOBE_array)
13825 {
13826 for (int i = 0; i < WPOBE_array.Count(); i++)
13827 {
13828 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13829
13830 if (WPOBE)
13831 {
13832 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13833 }
13834 }
13835 }
13836 }
13837
13838
13840 {
13841 int id = muzzle_owner.GetMuzzleID();
13842 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13843
13844 if (WPOOH_array)
13845 {
13846 for (int i = 0; i < WPOOH_array.Count(); i++)
13847 {
13848 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13849
13850 if (WPOOH)
13851 {
13852 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13853 }
13854 }
13855 }
13856 }
13857
13858
13860 {
13861 int id = muzzle_owner.GetMuzzleID();
13862 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13863
13864 if (WPOOH_array)
13865 {
13866 for (int i = 0; i < WPOOH_array.Count(); i++)
13867 {
13868 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13869
13870 if (WPOOH)
13871 {
13872 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13873 }
13874 }
13875 }
13876 }
13877
13878
13880 {
13881 int id = muzzle_owner.GetMuzzleID();
13882 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13883
13884 if (WPOOH_array)
13885 {
13886 for (int i = 0; i < WPOOH_array.Count(); i++)
13887 {
13888 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13889
13890 if (WPOOH)
13891 {
13892 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13893 }
13894 }
13895 }
13896 }
13897
13898
13899
13901 {
13903 {
13904 return true;
13905 }
13906
13907 return false;
13908 }
13909
13911 {
13913 {
13914 return true;
13915 }
13916
13917 return false;
13918 }
13919
13921 {
13923 {
13924 return true;
13925 }
13926
13927 return false;
13928 }
13929
13931 {
13932 return false;
13933 }
13934
13937 {
13938 return UATimeSpent.DEFAULT_DEPLOY;
13939 }
13940
13941
13942
13943
13945 {
13947 SetSynchDirty();
13948 }
13949
13951 {
13953 }
13954
13955
13957 {
13958 return false;
13959 }
13960
13963 {
13964 string att_type = "None";
13965
13966 if (ConfigIsExisting("soundAttType"))
13967 {
13968 att_type = ConfigGetString("soundAttType");
13969 }
13970
13972 }
13973
13975 {
13977 }
13978
13979
13980
13981
13982
13988
13990 {
13993
13995 }
13996
13997
13999 {
14001 return;
14002
14004
14007
14010
14011 SoundParameters params = new SoundParameters();
14015 }
14016
14017
14019 {
14021 return;
14022
14024 SetSynchDirty();
14025
14028 }
14029
14030
14032 {
14034 return;
14035
14037 SetSynchDirty();
14038
14041 }
14042
14044 {
14046 }
14047
14049 {
14051 }
14052
14055 {
14056 if (!
GetGame().IsDedicatedServer())
14057 {
14058 if (ConfigIsExisting("attachSoundSet"))
14059 {
14060 string cfg_path = "";
14061 string soundset = "";
14062 string type_name =
GetType();
14063
14066 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14067 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14068
14069 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14070 {
14071 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14072 {
14073 if (cfg_slot_array[i] == slot_type)
14074 {
14075 soundset = cfg_soundset_array[i];
14076 break;
14077 }
14078 }
14079 }
14080
14081 if (soundset != "")
14082 {
14083 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14085 }
14086 }
14087 }
14088 }
14089
14091 {
14092
14093 }
14094
14095 void OnApply(PlayerBase player);
14096
14098 {
14099 return 1.0;
14100 };
14101
14103 {
14105 }
14106
14108 {
14110 }
14111
14113
14115 {
14116 SetDynamicPhysicsLifeTime(0.01);
14118 }
14119
14121 {
14122 array<string> zone_names = new array<string>;
14123 GetDamageZones(zone_names);
14124 for (int i = 0; i < zone_names.Count(); i++)
14125 {
14126 SetHealthMax(zone_names.Get(i),"Health");
14127 }
14128 SetHealthMax("","Health");
14129 }
14130
14133 {
14134 float global_health = GetHealth01("","Health");
14135 array<string> zones = new array<string>;
14136 GetDamageZones(zones);
14137
14138 for (int i = 0; i < zones.Count(); i++)
14139 {
14140 SetHealth01(zones.Get(i),"Health",global_health);
14141 }
14142 }
14143
14146 {
14147 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14148 }
14149
14151 {
14152 if (!hasRootAsPlayer)
14153 {
14154 if (refParentIB)
14155 {
14156
14157 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14158 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14159
14160 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14161 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14162
14165 }
14166 else
14167 {
14168
14171 }
14172 }
14173 }
14174
14176 {
14178 {
14179 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14180 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14181 {
14182 float heatPermCoef = 1.0;
14184 while (ent)
14185 {
14186 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14187 ent = ent.GetHierarchyParent();
14188 }
14189
14190 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14191 }
14192 }
14193 }
14194
14196 {
14197
14198 EntityAI parent = GetHierarchyParent();
14199 if (!parent)
14200 {
14201 hasParent = false;
14202 hasRootAsPlayer = false;
14203 }
14204 else
14205 {
14206 hasParent = true;
14207 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14208 refParentIB =
ItemBase.Cast(parent);
14209 }
14210 }
14211
14212 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14213 {
14214
14215 }
14216
14218 {
14219
14220 return false;
14221 }
14222
14224 {
14225
14226
14227 return false;
14228 }
14229
14231 {
14232
14233 return false;
14234 }
14235
14238 {
14239 return !GetIsFrozen() &&
IsOpen();
14240 }
14241
14243 {
14244 bool hasParent = false, hasRootAsPlayer = false;
14246
14247 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14248 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14249
14250 if (wwtu || foodDecay)
14251 {
14255
14256 if (processWetness || processTemperature || processDecay)
14257 {
14259
14260 if (processWetness)
14261 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14262
14263 if (processTemperature)
14265
14266 if (processDecay)
14267 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14268 }
14269 }
14270 }
14271
14274 {
14276 }
14277
14279 {
14282
14283 return super.GetTemperatureFreezeThreshold();
14284 }
14285
14287 {
14290
14291 return super.GetTemperatureThawThreshold();
14292 }
14293
14295 {
14298
14299 return super.GetItemOverheatThreshold();
14300 }
14301
14303 {
14305 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14306
14307 return super.GetTemperatureFreezeTime();
14308 }
14309
14311 {
14313 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14314
14315 return super.GetTemperatureThawTime();
14316 }
14317
14322
14324 {
14325 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14326 }
14327
14329 {
14330 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14331 }
14332
14335 {
14337 }
14338
14340 {
14342 }
14343
14345 {
14347 }
14348
14351 {
14352 return null;
14353 }
14354
14357 {
14358 return false;
14359 }
14360
14362 {
14364 {
14367 if (!trg)
14368 {
14370 explosive = this;
14371 }
14372
14373 explosive.PairRemote(trg);
14375
14376 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14377 trg.SetPersistentPairID(persistentID);
14378 explosive.SetPersistentPairID(persistentID);
14379
14380 return true;
14381 }
14382 return false;
14383 }
14384
14387 {
14388 float ret = 1.0;
14391 ret *= GetHealth01();
14392
14393 return ret;
14394 }
14395
14396 #ifdef DEVELOPER
14397 override void SetDebugItem()
14398 {
14399 super.SetDebugItem();
14400 _itemBase = this;
14401 }
14402
14404 {
14405 string text = super.GetDebugText();
14406
14408 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14409
14410 return text;
14411 }
14412 #endif
14413
14415 {
14416 return true;
14417 }
14418
14420
14422
14424 {
14427 }
14428
14429
14437
14453}
14454
14456{
14458 if (entity)
14459 {
14460 bool is_item = entity.IsInherited(
ItemBase);
14461 if (is_item && full_quantity)
14462 {
14465 }
14466 }
14467 else
14468 {
14470 return NULL;
14471 }
14472 return entity;
14473}
14474
14476{
14477 if (item)
14478 {
14479 if (health > 0)
14480 item.SetHealth("", "", health);
14481
14482 if (item.CanHaveTemperature())
14483 {
14485 if (item.CanFreeze())
14486 item.SetFrozen(false);
14487 }
14488
14489 if (item.HasEnergyManager())
14490 {
14491 if (quantity >= 0)
14492 {
14493 item.GetCompEM().SetEnergy0To1(quantity);
14494 }
14495 else
14496 {
14498 }
14499 }
14500 else if (item.IsMagazine())
14501 {
14502 Magazine mag = Magazine.Cast(item);
14503 if (quantity >= 0)
14504 {
14505 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14506 }
14507 else
14508 {
14510 }
14511
14512 }
14513 else
14514 {
14515 if (quantity >= 0)
14516 {
14517 item.SetQuantityNormalized(quantity, false);
14518 }
14519 else
14520 {
14522 }
14523
14524 }
14525 }
14526}
14527
14528#ifdef DEVELOPER
14530#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.