9693{
9695 {
9696 return true;
9697 }
9698};
9699
9700
9701
9703{
9707
9709
9712
9713
9714
9715
9716
9725
9731
9736
9741
9762 protected bool m_IsResultOfSplit
9763
9765
9770
9771
9772
9774
9778
9779
9780
9782
9785
9786
9787
9793
9794
9802
9805
9806
9808
9809
9811
9812
9817
9818
9823
9824
9826
9827
9829 {
9834
9835 if (!
GetGame().IsDedicatedServer())
9836 {
9838 {
9840
9842 {
9844 }
9845 }
9846
9849 }
9850
9851 m_OldLocation = null;
9852
9854 {
9856 }
9857
9858 if (ConfigIsExisting("headSelectionsToHide"))
9859 {
9862 }
9863
9865 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9866 {
9868 }
9869
9871
9872 m_IsResultOfSplit = false;
9873
9875 }
9876
9878 {
9879 super.InitItemVariables();
9880
9886 m_Count = ConfigGetInt(
"count");
9887
9890
9895
9898
9903
9915
9919
9920
9923 if (ConfigIsExisting("canBeSplit"))
9924 {
9927 }
9928
9930 if (ConfigIsExisting("itemBehaviour"))
9932
9933
9936 RegisterNetSyncVariableInt("m_VarLiquidType");
9937 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9938
9939 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9940 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9941 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9942
9943 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9944 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9945 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9946 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9947
9948 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9949 RegisterNetSyncVariableBool("m_IsTakeable");
9950 RegisterNetSyncVariableBool("m_IsHologram");
9951
9954 {
9957 }
9958
9960
9962 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9964
9965 }
9966
9968 {
9970 }
9971
9973 {
9976 {
9981 }
9982 }
9983
9984 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9985 {
9987 {
9990 }
9991
9993 }
9994
9996 {
10002 }
10003
10005
10007 {
10009
10010 if (!action)
10011 {
10012 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
10013 return;
10014 }
10015
10017 if (!ai)
10018 {
10020 return;
10021 }
10022
10024 if (!action_array)
10025 {
10026 action_array = new array<ActionBase_Basic>;
10028 }
10029 if (LogManager.IsActionLogEnable())
10030 {
10031 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
10032 }
10033
10034 if (action_array.Find(action) != -1)
10035 {
10036 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
10037 }
10038 else
10039 {
10040 action_array.Insert(action);
10041 }
10042 }
10043
10045 {
10047 ActionBase action = player.GetActionManager().GetAction(actionName);
10050
10051 if (action_array)
10052 {
10053 action_array.RemoveItem(action);
10054 }
10055 }
10056
10057
10058
10060 {
10061 ActionOverrideData overrideData = new ActionOverrideData();
10065
10067 if (!actionMap)
10068 {
10071 }
10072
10073 actionMap.Insert(this.
Type(), overrideData);
10074
10075 }
10076
10078
10080
10081
10083 {
10086
10089
10090 string config_to_search = "CfgVehicles";
10091 string muzzle_owner_config;
10092
10094 {
10095 if (IsInherited(Weapon))
10096 config_to_search = "CfgWeapons";
10097
10098 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10099
10100 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10101
10103
10104 if (config_OnFire_subclass_count > 0)
10105 {
10106 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10107
10108 for (int i = 0; i < config_OnFire_subclass_count; i++)
10109 {
10110 string particle_class = "";
10112 string config_OnFire_entry = config_OnFire_class + particle_class;
10113 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10114 WPOF_array.Insert(WPOF);
10115 }
10116
10117
10119 }
10120 }
10121
10123 {
10124 config_to_search = "CfgWeapons";
10125 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10126
10127 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10128
10130
10131 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10132 {
10133 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10134
10135 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10136 {
10137 string particle_class2 = "";
10139 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10140 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10141 WPOBE_array.Insert(WPOBE);
10142 }
10143
10144
10146 }
10147 }
10148 }
10149
10150
10152 {
10155
10157 {
10158 string config_to_search = "CfgVehicles";
10159
10160 if (IsInherited(Weapon))
10161 config_to_search = "CfgWeapons";
10162
10163 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10164 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10165
10166 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10167 {
10168
10170
10172 {
10174 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10176 return;
10177 }
10178
10181
10182
10183
10185 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10186
10187 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10188 {
10189 string particle_class = "";
10191 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10193
10194 if (entry_type == CT_CLASS)
10195 {
10196 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10197 WPOOH_array.Insert(WPOF);
10198 }
10199 }
10200
10201
10203 }
10204 }
10205 }
10206
10208 {
10210 }
10211
10213 {
10215 {
10217
10220
10223
10224 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10225 }
10226 }
10227
10229 {
10231 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10232
10234 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10235
10237 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10238
10240 {
10242 }
10243 }
10244
10246 {
10248 }
10249
10251 {
10254 else
10256
10258 {
10261 }
10262 else
10263 {
10266
10269 }
10270
10272 }
10273
10275 {
10277 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10278 }
10279
10281 {
10283 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10285 }
10286
10288 {
10290 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10291 }
10292
10294 {
10297
10298 OverheatingParticle OP = new OverheatingParticle();
10303
10305 }
10306
10308 {
10311
10312 return -1;
10313 }
10314
10316 {
10318 {
10321
10322 for (int i = count; i > 0; --i)
10323 {
10324 int id = i - 1;
10327
10330
10331 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10332 {
10333 if (p)
10334 {
10337 }
10338 }
10339 }
10340 }
10341 }
10342
10344 {
10346 {
10348 {
10349 int id = i - 1;
10351
10352 if (OP)
10353 {
10355
10356 if (p)
10357 {
10359 }
10360
10361 delete OP;
10362 }
10363 }
10364
10367 }
10368 }
10369
10372 {
10373 return 0.0;
10374 }
10375
10376
10378 {
10379 return 250;
10380 }
10381
10383 {
10384 return 0;
10385 }
10386
10389 {
10391 return true;
10392
10393 return false;
10394 }
10395
10398 {
10401
10403 {
10405 }
10406 else
10407 {
10408
10410 }
10411
10413 }
10414
10421 {
10422 return -1;
10423 }
10424
10425
10426
10427
10429 {
10431 {
10433 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10434
10435 if (r_index >= 0)
10436 {
10437 InventoryLocation r_il = new InventoryLocation;
10438 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10439
10440 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10443 {
10444 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10445 }
10447 {
10448 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10449 }
10450
10451 }
10452
10453 player.GetHumanInventory().ClearUserReservedLocation(this);
10454 }
10455
10458 }
10459
10460
10461
10462
10464 {
10465 return ItemBase.m_DebugActionsMask;
10466 }
10467
10469 {
10470 return ItemBase.m_DebugActionsMask & mask;
10471 }
10472
10474 {
10475 ItemBase.m_DebugActionsMask = mask;
10476 }
10477
10479 {
10480 ItemBase.m_DebugActionsMask |= mask;
10481 }
10482
10484 {
10485 ItemBase.m_DebugActionsMask &= ~mask;
10486 }
10487
10489 {
10491 {
10493 }
10494 else
10495 {
10497 }
10498 }
10499
10500
10502 {
10503 if (GetEconomyProfile())
10504 {
10505 float q_max = GetEconomyProfile().GetQuantityMax();
10506 if (q_max > 0)
10507 {
10508 float q_min = GetEconomyProfile().GetQuantityMin();
10509 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10510
10512 {
10513 ComponentEnergyManager comp = GetCompEM();
10515 {
10517 }
10518 }
10520 {
10522
10523 }
10524
10525 }
10526 }
10527 }
10528
10531 {
10532 EntityAI parent = GetHierarchyParent();
10533
10534 if (parent)
10535 {
10536 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10537 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10538 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10539 }
10540 }
10541
10544 {
10545 EntityAI parent = GetHierarchyParent();
10546
10547 if (parent)
10548 {
10549 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10550 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10551 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10552 }
10553 }
10554
10556 {
10557
10558
10559
10560
10562
10564 {
10565 if (ScriptInputUserData.CanStoreInputUserData())
10566 {
10567 ScriptInputUserData ctx = new ScriptInputUserData;
10573 ctx.
Write(use_stack_max);
10576
10578 {
10579 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10580 }
10581 }
10582 }
10583 else if (!
GetGame().IsMultiplayer())
10584 {
10586 }
10587 }
10588
10590 {
10592 }
10593
10595 {
10597 }
10598
10600 {
10602 }
10603
10605 {
10606
10607 return false;
10608 }
10609
10611 {
10612 return false;
10613 }
10614
10618 {
10619 return false;
10620 }
10621
10623 {
10624 return "";
10625 }
10626
10628
10630 {
10631 return false;
10632 }
10633
10635 {
10636 return true;
10637 }
10638
10639
10640
10642 {
10643 return true;
10644 }
10645
10647 {
10648 return true;
10649 }
10650
10652 {
10653 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10655 }
10656
10658 {
10660 }
10661
10663 {
10665 if (!is_being_placed)
10667 SetSynchDirty();
10668 }
10669
10670
10672
10674 {
10676 }
10677
10679 {
10681 }
10682
10684 {
10685 return 1;
10686 }
10687
10689 {
10690 return false;
10691 }
10692
10694 {
10696 SetSynchDirty();
10697 }
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10734 {
10735 super.OnMovedInsideCargo(container);
10736
10737 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10738 }
10739
10740 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10741 {
10742 super.EEItemLocationChanged(oldLoc,newLoc);
10743
10744 PlayerBase new_player = null;
10745 PlayerBase old_player = null;
10746
10747 if (newLoc.GetParent())
10748 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10749
10750 if (oldLoc.GetParent())
10751 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10752
10754 {
10755 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10756
10757 if (r_index >= 0)
10758 {
10759 InventoryLocation r_il = new InventoryLocation;
10760 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10761
10762 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10765 {
10766 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10767 }
10769 {
10770 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10771 }
10772
10773 }
10774 }
10775
10777 {
10778 if (new_player)
10779 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10780
10781 if (new_player == old_player)
10782 {
10783
10784 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10785 {
10787 {
10788 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10789 {
10790 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10791 }
10792 }
10793 else
10794 {
10795 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10796 }
10797 }
10798
10799 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10800 {
10801 int type = oldLoc.GetType();
10803 {
10804 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10805 }
10807 {
10808 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10809 }
10810 }
10811 if (!m_OldLocation)
10812 {
10813 m_OldLocation = new InventoryLocation;
10814 }
10815 m_OldLocation.Copy(oldLoc);
10816 }
10817 else
10818 {
10819 if (m_OldLocation)
10820 {
10821 m_OldLocation.Reset();
10822 }
10823 }
10824
10826 }
10827 else
10828 {
10829 if (new_player)
10830 {
10831 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10832 if (res_index >= 0)
10833 {
10834 InventoryLocation il = new InventoryLocation;
10835 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10837 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10840 {
10841 il.
GetParent().GetOnReleaseLock().Invoke(it);
10842 }
10844 {
10846 }
10847
10848 }
10849 }
10851 {
10852
10854 }
10855
10856 if (m_OldLocation)
10857 {
10858 m_OldLocation.Reset();
10859 }
10860 }
10861 }
10862
10863 override void EOnContact(IEntity other, Contact extra)
10864 {
10866 {
10867 int liquidType = -1;
10869 if (impactSpeed > 0.0)
10870 {
10872 #ifndef SERVER
10874 #else
10876 SetSynchDirty();
10877 #endif
10879 }
10880 }
10881
10882 #ifdef SERVER
10883 if (GetCompEM() && GetCompEM().IsPlugged())
10884 {
10885 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10886 GetCompEM().UnplugThis();
10887 }
10888 #endif
10889 }
10890
10892
10894 {
10896 }
10897
10899 {
10900
10901 }
10902
10904 {
10905 super.OnItemLocationChanged(old_owner, new_owner);
10906
10907 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10908 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10909
10910 if (!relatedPlayer && playerNew)
10911 relatedPlayer = playerNew;
10912
10913 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10914 {
10916 if (actionMgr)
10917 {
10918 ActionBase currentAction = actionMgr.GetRunningAction();
10919 if (currentAction)
10921 }
10922 }
10923
10924 Man ownerPlayerOld = null;
10925 Man ownerPlayerNew = null;
10926
10927 if (old_owner)
10928 {
10929 if (old_owner.
IsMan())
10930 {
10931 ownerPlayerOld = Man.Cast(old_owner);
10932 }
10933 else
10934 {
10935 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10936 }
10937 }
10938 else
10939 {
10941 {
10943
10944 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10945 {
10946 GetCompEM().UnplugThis();
10947 }
10948 }
10949 }
10950
10951 if (new_owner)
10952 {
10953 if (new_owner.
IsMan())
10954 {
10955 ownerPlayerNew = Man.Cast(new_owner);
10956 }
10957 else
10958 {
10959 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10960 }
10961 }
10962
10963 if (ownerPlayerOld != ownerPlayerNew)
10964 {
10965 if (ownerPlayerOld)
10966 {
10967 array<EntityAI> subItemsExit = new array<EntityAI>;
10969 for (int i = 0; i < subItemsExit.Count(); i++)
10970 {
10973 }
10974 }
10975
10976 if (ownerPlayerNew)
10977 {
10978 array<EntityAI> subItemsEnter = new array<EntityAI>;
10980 for (int j = 0; j < subItemsEnter.Count(); j++)
10981 {
10984 }
10985 }
10986 }
10987 else if (ownerPlayerNew != null)
10988 {
10989 PlayerBase nplayer;
10990 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10991 {
10992 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10994 for (int k = 0; k < subItemsUpdate.Count(); k++)
10995 {
10997 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10998 }
10999 }
11000 }
11001
11002 if (old_owner)
11003 old_owner.OnChildItemRemoved(this);
11004 if (new_owner)
11005 new_owner.OnChildItemReceived(this);
11006 }
11007
11008
11010 {
11011 super.EEDelete(parent);
11012 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
11013 if (player)
11014 {
11016
11017 if (player.IsAlive())
11018 {
11019 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
11020 if (r_index >= 0)
11021 {
11022 InventoryLocation r_il = new InventoryLocation;
11023 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
11024
11025 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
11028 {
11029 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
11030 }
11032 {
11033 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
11034 }
11035
11036 }
11037
11038 player.RemoveQuickBarEntityShortcut(this);
11039 }
11040 }
11041 }
11042
11044 {
11045 super.EEKilled(killer);
11046
11049 {
11050 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
11051 {
11052 if (IsMagazine())
11053 {
11054 if (Magazine.Cast(this).GetAmmoCount() > 0)
11055 {
11057 }
11058 }
11059 else
11060 {
11062 }
11063 }
11064 }
11065 }
11066
11068 {
11069 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
11070
11071 super.OnWasAttached(parent, slot_id);
11072
11075
11077 }
11078
11080 {
11081 super.OnWasDetached(parent, slot_id);
11082
11085 }
11086
11088 {
11089 int idx;
11092
11093 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11094 if (inventory_slots.Count() < 1)
11095 {
11096 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11097 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11098 }
11099 else
11100 {
11101 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11102 }
11103
11104 idx = inventory_slots.Find(slot);
11105 if (idx < 0)
11106 return "";
11107
11108 return attach_types.Get(idx);
11109 }
11110
11112 {
11113 int idx = -1;
11114 string slot;
11115
11118
11119 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11120 if (inventory_slots.Count() < 1)
11121 {
11122 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11123 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11124 }
11125 else
11126 {
11127 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11128 if (detach_types.Count() < 1)
11129 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11130 }
11131
11132 for (int i = 0; i < inventory_slots.Count(); i++)
11133 {
11134 slot = inventory_slots.Get(i);
11135 }
11136
11137 if (slot != "")
11138 {
11139 if (detach_types.Count() == 1)
11140 idx = 0;
11141 else
11142 idx = inventory_slots.Find(slot);
11143 }
11144 if (idx < 0)
11145 return "";
11146
11147 return detach_types.Get(idx);
11148 }
11149
11151 {
11152
11154
11155
11156 float min_time = 1;
11157 float max_time = 3;
11158 float delay = Math.RandomFloat(min_time, max_time);
11159
11160 explode_timer.Run(delay, this, "DoAmmoExplosion");
11161 }
11162
11164 {
11165 Magazine magazine = Magazine.Cast(this);
11166 int pop_sounds_count = 6;
11167 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11168
11169
11170 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11171 string sound_name = pop_sounds[ sound_idx ];
11173
11174
11175 magazine.ServerAddAmmoCount(-1);
11176
11177
11178 float min_temp_to_explode = 100;
11179
11180 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11181 {
11183 }
11184 }
11185
11186
11187 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11188 {
11189 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11190
11191 const int CHANCE_DAMAGE_CARGO = 4;
11192 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11193 const int CHANCE_DAMAGE_NOTHING = 2;
11194
11196 {
11197 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11198 int chances;
11199 int rnd;
11200
11201 if (GetInventory().GetCargo())
11202 {
11203 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11204 rnd = Math.RandomInt(0,chances);
11205
11206 if (rnd < CHANCE_DAMAGE_CARGO)
11207 {
11209 }
11210 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11211 {
11213 }
11214 }
11215 else
11216 {
11217 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11218 rnd = Math.RandomInt(0,chances);
11219
11220 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11221 {
11223 }
11224 }
11225 }
11226 }
11227
11229 {
11230 if (GetInventory().GetCargo())
11231 {
11232 int item_count = GetInventory().GetCargo().GetItemCount();
11233 if (item_count > 0)
11234 {
11235 int random_pick = Math.RandomInt(0, item_count);
11237 if (!item.IsExplosive())
11238 {
11239 item.AddHealth("","",damage);
11240 return true;
11241 }
11242 }
11243 }
11244 return false;
11245 }
11246
11248 {
11249 int attachment_count = GetInventory().AttachmentCount();
11250 if (attachment_count > 0)
11251 {
11252 int random_pick = Math.RandomInt(0, attachment_count);
11253 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11254 if (!attachment.IsExplosive())
11255 {
11256 attachment.AddHealth("","",damage);
11257 return true;
11258 }
11259 }
11260 return false;
11261 }
11262
11264 {
11266 }
11267
11269 {
11271 return GetInventory().CanRemoveEntity();
11272
11273 return false;
11274 }
11275
11277 {
11278
11280 return false;
11281
11282
11284 return false;
11285
11286
11287
11289 if (delta == 0)
11290 return false;
11291
11292
11293 return true;
11294 }
11295
11297 {
11299 {
11300 if (ScriptInputUserData.CanStoreInputUserData())
11301 {
11302 ScriptInputUserData ctx = new ScriptInputUserData;
11307 ctx.
Write(destination_entity);
11309 ctx.
Write(slot_id);
11311 }
11312 }
11313 else if (!
GetGame().IsMultiplayer())
11314 {
11316 }
11317 }
11318
11320 {
11321 float split_quantity_new;
11325 InventoryLocation loc = new InventoryLocation;
11326
11327 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11328 {
11330 split_quantity_new = stack_max;
11331 else
11333
11335 {
11336 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11337 if (new_item)
11338 {
11339 new_item.SetResultOfSplit(true);
11340 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11342 new_item.
SetQuantity(split_quantity_new,
false,
true);
11343 }
11344 }
11345 }
11346 else if (destination_entity && slot_id == -1)
11347 {
11348 if (quantity > stack_max)
11349 split_quantity_new = stack_max;
11350 else
11351 split_quantity_new = quantity;
11352
11354 {
11356 {
11359 }
11360
11361 if (new_item)
11362 {
11363 new_item.SetResultOfSplit(true);
11364 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11366 new_item.
SetQuantity(split_quantity_new,
false,
true);
11367 }
11368 }
11369 }
11370 else
11371 {
11372 if (stack_max != 0)
11373 {
11375 {
11377 }
11378
11379 if (split_quantity_new == 0)
11380 {
11381 if (!
GetGame().IsMultiplayer())
11382 player.PhysicalPredictiveDropItem(this);
11383 else
11384 player.ServerDropEntity(this);
11385 return;
11386 }
11387
11389 {
11391
11392 if (new_item)
11393 {
11394 new_item.SetResultOfSplit(true);
11395 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11398 new_item.PlaceOnSurface();
11399 }
11400 }
11401 }
11402 }
11403 }
11404
11406 {
11407 float split_quantity_new;
11411 InventoryLocation loc = new InventoryLocation;
11412
11413 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11414 {
11416 split_quantity_new = stack_max;
11417 else
11419
11421 {
11422 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11423 if (new_item)
11424 {
11425 new_item.SetResultOfSplit(true);
11426 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11428 new_item.
SetQuantity(split_quantity_new,
false,
true);
11429 }
11430 }
11431 }
11432 else if (destination_entity && slot_id == -1)
11433 {
11434 if (quantity > stack_max)
11435 split_quantity_new = stack_max;
11436 else
11437 split_quantity_new = quantity;
11438
11440 {
11442 {
11445 }
11446
11447 if (new_item)
11448 {
11449 new_item.SetResultOfSplit(true);
11450 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11452 new_item.
SetQuantity(split_quantity_new,
false,
true);
11453 }
11454 }
11455 }
11456 else
11457 {
11458 if (stack_max != 0)
11459 {
11461 {
11463 }
11464
11466 {
11468
11469 if (new_item)
11470 {
11471 new_item.SetResultOfSplit(true);
11472 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11475 new_item.PlaceOnSurface();
11476 }
11477 }
11478 }
11479 }
11480 }
11481
11483 {
11485 {
11486 if (ScriptInputUserData.CanStoreInputUserData())
11487 {
11488 ScriptInputUserData ctx = new ScriptInputUserData;
11493 dst.WriteToContext(ctx);
11495 }
11496 }
11497 else if (!
GetGame().IsMultiplayer())
11498 {
11500 }
11501 }
11502
11504 {
11506 {
11507 if (ScriptInputUserData.CanStoreInputUserData())
11508 {
11509 ScriptInputUserData ctx = new ScriptInputUserData;
11514 ctx.
Write(destination_entity);
11520 }
11521 }
11522 else if (!
GetGame().IsMultiplayer())
11523 {
11525 }
11526 }
11527
11529 {
11531 }
11532
11534 {
11536 float split_quantity_new;
11538 if (dst.IsValid())
11539 {
11540 int slot_id = dst.GetSlot();
11542
11543 if (quantity > stack_max)
11544 split_quantity_new = stack_max;
11545 else
11546 split_quantity_new = quantity;
11547
11549 {
11551
11552 if (new_item)
11553 {
11554 new_item.SetResultOfSplit(true);
11555 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11557 new_item.
SetQuantity(split_quantity_new,
false,
true);
11558 }
11559
11560 return new_item;
11561 }
11562 }
11563
11564 return null;
11565 }
11566
11568 {
11570 float split_quantity_new;
11572 if (destination_entity)
11573 {
11575 if (quantity > stackable)
11576 split_quantity_new = stackable;
11577 else
11578 split_quantity_new = quantity;
11579
11581 {
11582 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11583 if (new_item)
11584 {
11585 new_item.SetResultOfSplit(true);
11586 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11588 new_item.
SetQuantity(split_quantity_new,
false,
true);
11589 }
11590 }
11591 }
11592 }
11593
11595 {
11597 {
11598 if (ScriptInputUserData.CanStoreInputUserData())
11599 {
11600 ScriptInputUserData ctx = new ScriptInputUserData;
11605 ItemBase destination_entity =
this;
11606 ctx.
Write(destination_entity);
11610 }
11611 }
11612 else if (!
GetGame().IsMultiplayer())
11613 {
11615 }
11616 }
11617
11619 {
11621 float split_quantity_new;
11623 if (player)
11624 {
11626 if (quantity > stackable)
11627 split_quantity_new = stackable;
11628 else
11629 split_quantity_new = quantity;
11630
11632 {
11633 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11634 new_item =
ItemBase.Cast(in_hands);
11635 if (new_item)
11636 {
11637 new_item.SetResultOfSplit(true);
11638 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11640 new_item.SetQuantity(split_quantity_new, false, true);
11641 }
11642 }
11643 }
11644 }
11645
11647 {
11649 float split_quantity_new = Math.Floor(quantity * 0.5);
11650
11652 return;
11653
11655
11656 if (new_item)
11657 {
11658 if (new_item.GetQuantityMax() < split_quantity_new)
11659 {
11660 split_quantity_new = new_item.GetQuantityMax();
11661 }
11662
11663 new_item.SetResultOfSplit(true);
11664 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11665
11667 {
11670 }
11671 else
11672 {
11674 new_item.
SetQuantity(split_quantity_new,
false,
true);
11675 }
11676 }
11677 }
11678
11680 {
11682 float split_quantity_new = Math.Floor(quantity / 2);
11683
11685 return;
11686
11687 InventoryLocation invloc = new InventoryLocation;
11689
11691 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11692
11693 if (new_item)
11694 {
11695 if (new_item.GetQuantityMax() < split_quantity_new)
11696 {
11697 split_quantity_new = new_item.GetQuantityMax();
11698 }
11700 {
11703 }
11704 else if (split_quantity_new > 1)
11705 {
11707 new_item.
SetQuantity(split_quantity_new,
false,
true);
11708 }
11709 }
11710 }
11711
11714 {
11715 SetWeightDirty();
11717
11718 if (parent)
11719 parent.OnAttachmentQuantityChangedEx(this, delta);
11720
11722 {
11724 {
11726 }
11728 {
11729 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11731 }
11732 }
11733
11734 }
11735
11738 {
11739
11740 }
11741
11744 {
11746 }
11747
11749 {
11750 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11751
11753 {
11754 if (newLevel == GameConstants.STATE_RUINED)
11755 {
11757 EntityAI parent = GetHierarchyParent();
11758 if (parent && parent.IsFireplace())
11759 {
11760 CargoBase cargo = GetInventory().GetCargo();
11761 if (cargo)
11762 {
11764 {
11766 }
11767 }
11768 }
11769 }
11770
11772 {
11773
11775 return;
11776 }
11777
11778 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11779 {
11781 }
11782 }
11783 }
11784
11785
11787 {
11788 super.OnRightClick();
11789
11791 {
11793 {
11794 if (ScriptInputUserData.CanStoreInputUserData())
11795 {
11796 EntityAI root = GetHierarchyRoot();
11797 Man playerOwner = GetHierarchyRootPlayer();
11798 InventoryLocation dst = new InventoryLocation;
11799
11800
11801 if (!playerOwner && root && root == this)
11802 {
11804 }
11805 else
11806 {
11807
11808 GetInventory().GetCurrentInventoryLocation(dst);
11810 {
11813 {
11815 }
11816 else
11817 {
11819
11820
11821 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11822 {
11824 }
11825 else
11826 {
11827 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11828 }
11829 }
11830 }
11831 }
11832
11833 ScriptInputUserData ctx = new ScriptInputUserData;
11841 }
11842 }
11843 else if (!
GetGame().IsMultiplayer())
11844 {
11846 }
11847 }
11848 }
11849
11851 {
11852 if (root)
11853 {
11854 vector m4[4];
11855 root.GetTransform(m4);
11856 dst.SetGround(this, m4);
11857 }
11858 else
11859 {
11860 GetInventory().GetCurrentInventoryLocation(dst);
11861 }
11862 }
11863
11864 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11865 {
11866
11867 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11868 return false;
11869
11870 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11871 return false;
11872
11873
11875 return false;
11876
11877
11878 Magazine mag = Magazine.Cast(this);
11879 if (mag)
11880 {
11881 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11882 return false;
11883
11884 if (stack_max_limit)
11885 {
11886 Magazine other_mag = Magazine.Cast(other_item);
11887 if (other_item)
11888 {
11889 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11890 return false;
11891 }
11892
11893 }
11894 }
11895 else
11896 {
11897
11899 return false;
11900
11902 return false;
11903 }
11904
11905 PlayerBase player = null;
11906 if (CastTo(player, GetHierarchyRootPlayer()))
11907 {
11908 if (player.GetInventory().HasAttachment(this))
11909 return false;
11910
11911 if (player.IsItemsToDelete())
11912 return false;
11913 }
11914
11915 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11916 return false;
11917
11918 int slotID;
11920 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11921 return false;
11922
11923 return true;
11924 }
11925
11927 {
11929 }
11930
11932 {
11933 return m_IsResultOfSplit;
11934 }
11935
11937 {
11938 m_IsResultOfSplit = value;
11939 }
11940
11942 {
11944 }
11945
11947 {
11948 float other_item_quantity = other_item.GetQuantity();
11949 float this_free_space;
11950
11952
11954
11955 if (other_item_quantity > this_free_space)
11956 {
11957 return this_free_space;
11958 }
11959 else
11960 {
11961 return other_item_quantity;
11962 }
11963 }
11964
11966 {
11968 }
11969
11971 {
11973 return;
11974
11975 if (!IsMagazine() && other_item)
11976 {
11978 if (quantity_used != 0)
11979 {
11980 float hp1 = GetHealth01("","");
11981 float hp2 = other_item.GetHealth01("","");
11982 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11983 hpResult = hpResult / (
GetQuantity() + quantity_used);
11984
11985 hpResult *= GetMaxHealth();
11986 Math.Round(hpResult);
11987 SetHealth("", "Health", hpResult);
11988
11990 other_item.AddQuantity(-quantity_used);
11991 }
11992 }
11994 }
11995
11997 {
11998 #ifdef SERVER
11999 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
12000 GetHierarchyParent().IncreaseLifetimeUp();
12001 #endif
12002 };
12003
12005 {
12006 PlayerBase p = PlayerBase.Cast(player);
12007
12008 array<int> recipesIds = p.m_Recipes;
12009 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12010 if (moduleRecipesManager)
12011 {
12012 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
12013 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
12014 }
12015
12016 for (int i = 0;i < recipesIds.Count(); i++)
12017 {
12018 int key = recipesIds.Get(i);
12019 string recipeName = moduleRecipesManager.GetRecipeName(key);
12021 }
12022 }
12023
12024
12025 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
12026 {
12027 super.GetDebugActions(outputList);
12028
12029
12035
12036
12041
12046
12047
12051
12052
12054 {
12058 }
12059
12062
12063
12067
12069
12070 InventoryLocation loc = new InventoryLocation();
12071 GetInventory().GetCurrentInventoryLocation(loc);
12073 {
12074 if (Gizmo_IsSupported())
12077 }
12078
12080 }
12081
12082
12083
12084
12086 {
12087 super.OnAction(action_id, player, ctx);
12088
12090 {
12091 switch (action_id)
12092 {
12095 return true;
12098 return true;
12099 }
12100 }
12101
12103 {
12104 switch (action_id)
12105 {
12107 Delete();
12108 return true;
12109 }
12110 }
12111
12112 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12113 {
12114 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12115 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12116 PlayerBase p = PlayerBase.Cast(player);
12117 if (
EActions.RECIPES_RANGE_START < 1000)
12118 {
12119 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12120 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12121 }
12122 }
12123 #ifndef SERVER
12124 else if (action_id ==
EActions.WATCH_PLAYER)
12125 {
12126 PluginDeveloper.SetDeveloperItemClientEx(player);
12127 }
12128 #endif
12130 {
12131 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12132 {
12133 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12134 OnDebugButtonPressServer(id + 1);
12135 }
12136
12137 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12138 {
12139 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12141 }
12142
12143 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12144 {
12145 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12147 }
12148
12149 else if (action_id ==
EActions.ADD_QUANTITY)
12150 {
12151 if (IsMagazine())
12152 {
12153 Magazine mag = Magazine.Cast(this);
12154 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12155 }
12156 else
12157 {
12159 }
12160
12161 if (m_EM)
12162 {
12163 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12164 }
12165
12166 }
12167
12168 else if (action_id ==
EActions.REMOVE_QUANTITY)
12169 {
12170 if (IsMagazine())
12171 {
12172 Magazine mag2 = Magazine.Cast(this);
12173 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12174 }
12175 else
12176 {
12178 }
12179 if (m_EM)
12180 {
12181 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12182 }
12183
12184 }
12185
12186 else if (action_id ==
EActions.SET_QUANTITY_0)
12187 {
12189
12190 if (m_EM)
12191 {
12192 m_EM.SetEnergy(0);
12193 }
12194 }
12195
12196 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12197 {
12199
12200 if (m_EM)
12201 {
12202 m_EM.SetEnergy(m_EM.GetEnergyMax());
12203 }
12204 }
12205
12206 else if (action_id ==
EActions.ADD_HEALTH)
12207 {
12208 AddHealth("","",GetMaxHealth("","Health")/5);
12209 }
12210 else if (action_id ==
EActions.REMOVE_HEALTH)
12211 {
12212 AddHealth("","",-GetMaxHealth("","Health")/5);
12213 }
12214 else if (action_id ==
EActions.DESTROY_HEALTH)
12215 {
12216 SetHealth01("","",0);
12217 }
12218 else if (action_id ==
EActions.WATCH_ITEM)
12219 {
12221 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12222 #ifdef DEVELOPER
12223 SetDebugDeveloper_item(this);
12224 #endif
12225 }
12226
12227 else if (action_id ==
EActions.ADD_TEMPERATURE)
12228 {
12229 AddTemperature(20);
12230
12231 }
12232
12233 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12234 {
12235 AddTemperature(-20);
12236
12237 }
12238
12239 else if (action_id ==
EActions.FLIP_FROZEN)
12240 {
12241 SetFrozen(!GetIsFrozen());
12242
12243 }
12244
12245 else if (action_id ==
EActions.ADD_WETNESS)
12246 {
12248
12249 }
12250
12251 else if (action_id ==
EActions.REMOVE_WETNESS)
12252 {
12254
12255 }
12256
12257 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12258 {
12261
12262
12263 }
12264
12265 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12266 {
12269 }
12270
12271 else if (action_id ==
EActions.MAKE_SPECIAL)
12272 {
12273 auto debugParams = DebugSpawnParams.WithPlayer(player);
12274 OnDebugSpawnEx(debugParams);
12275 }
12276
12277 }
12278
12279
12280 return false;
12281 }
12282
12283
12284
12285
12289
12292
12293
12294
12296 {
12297 return false;
12298 }
12299
12300
12302 {
12303 return true;
12304 }
12305
12306
12308 {
12309 return true;
12310 }
12311
12312
12313
12315 {
12316 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12318 }
12319
12322 {
12323 return null;
12324 }
12325
12327 {
12328 return false;
12329 }
12330
12332 {
12333 return false;
12334 }
12335
12339
12340
12342 {
12343 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12344 return module_repairing.CanRepair(this, item_repair_kit);
12345 }
12346
12347
12348 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12349 {
12350 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12351 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12352 }
12353
12354
12356 {
12357
12358
12359
12360
12361
12362
12363
12364
12365 return 1;
12366 }
12367
12368
12369
12371 {
12373 }
12374
12375
12376
12378 {
12380 }
12381
12382
12391 {
12392 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12393
12394 if (player)
12395 {
12396 player.MessageStatus(text);
12397 }
12398 }
12399
12400
12409 {
12410 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12411
12412 if (player)
12413 {
12414 player.MessageAction(text);
12415 }
12416 }
12417
12418
12427 {
12428 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12429
12430 if (player)
12431 {
12432 player.MessageFriendly(text);
12433 }
12434 }
12435
12436
12445 {
12446 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12447
12448 if (player)
12449 {
12450 player.MessageImportant(text);
12451 }
12452 }
12453
12455 {
12456 return true;
12457 }
12458
12459
12460 override bool KindOf(
string tag)
12461 {
12462 bool found = false;
12463 string item_name = this.
GetType();
12466
12467 int array_size = item_tag_array.Count();
12468 for (int i = 0; i < array_size; i++)
12469 {
12470 if (item_tag_array.Get(i) == tag)
12471 {
12472 found = true;
12473 break;
12474 }
12475 }
12476 return found;
12477 }
12478
12479
12481 {
12482
12483 super.OnRPC(sender, rpc_type,ctx);
12484
12485
12486 switch (rpc_type)
12487 {
12488 #ifndef SERVER
12489 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12490 Param2<bool, string> p = new Param2<bool, string>(false, "");
12491
12493 return;
12494
12495 bool play = p.param1;
12496 string soundSet = p.param2;
12497
12498 if (play)
12499 {
12501 {
12503 {
12505 }
12506 }
12507 else
12508 {
12510 }
12511 }
12512 else
12513 {
12515 }
12516
12517 break;
12518 #endif
12519
12520 }
12521
12523 {
12525 }
12526 }
12527
12528
12529
12530
12532 {
12533 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12534 return plugin.GetID(
name);
12535 }
12536
12538 {
12539 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12540 return plugin.GetName(id);
12541 }
12542
12545 {
12546
12547
12548 int varFlags;
12549 if (!ctx.
Read(varFlags))
12550 return;
12551
12552 if (varFlags & ItemVariableFlags.FLOAT)
12553 {
12555 }
12556 }
12557
12559 {
12560
12561 super.SerializeNumericalVars(floats_out);
12562
12563
12564
12566 {
12568 }
12569
12571 {
12573 }
12574
12576 {
12578 }
12579
12581 {
12586 }
12587
12589 {
12591 }
12592 }
12593
12595 {
12596
12597 super.DeSerializeNumericalVars(floats);
12598
12599
12600 int index = 0;
12601 int mask = Math.Round(floats.Get(index));
12602
12603 index++;
12604
12606 {
12608 {
12610 }
12611 else
12612 {
12613 float quantity = floats.Get(index);
12614 SetQuantity(quantity,
true,
false,
false,
false);
12615 }
12616 index++;
12617 }
12618
12620 {
12621 float wet = floats.Get(index);
12623 index++;
12624 }
12625
12627 {
12628 int liquidtype = Math.Round(floats.Get(index));
12630 index++;
12631 }
12632
12634 {
12636 index++;
12638 index++;
12640 index++;
12642 index++;
12643 }
12644
12646 {
12647 int cleanness = Math.Round(floats.Get(index));
12649 index++;
12650 }
12651 }
12652
12654 {
12655 super.WriteVarsToCTX(ctx);
12656
12657
12659 {
12661 }
12662
12664 {
12666 }
12667
12669 {
12671 }
12672
12674 {
12675 int r,g,b,a;
12681 }
12682
12684 {
12686 }
12687 }
12688
12690 {
12691 if (!super.ReadVarsFromCTX(ctx,version))
12692 return false;
12693
12694 int intValue;
12695 float value;
12696
12697 if (version < 140)
12698 {
12699 if (!ctx.
Read(intValue))
12700 return false;
12701
12702 m_VariablesMask = intValue;
12703 }
12704
12706 {
12707 if (!ctx.
Read(value))
12708 return false;
12709
12711 {
12713 }
12714 else
12715 {
12717 }
12718 }
12719
12720 if (version < 140)
12721 {
12723 {
12724 if (!ctx.
Read(value))
12725 return false;
12726 SetTemperatureDirect(value);
12727 }
12728 }
12729
12731 {
12732 if (!ctx.
Read(value))
12733 return false;
12735 }
12736
12738 {
12739 if (!ctx.
Read(intValue))
12740 return false;
12742 }
12743
12745 {
12746 int r,g,b,a;
12748 return false;
12750 return false;
12752 return false;
12754 return false;
12755
12757 }
12758
12760 {
12761 if (!ctx.
Read(intValue))
12762 return false;
12764 }
12765
12766 if (version >= 138 && version < 140)
12767 {
12769 {
12770 if (!ctx.
Read(intValue))
12771 return false;
12772 SetFrozen(intValue);
12773 }
12774 }
12775
12776 return true;
12777 }
12778
12779
12781 {
12784 {
12786 }
12787
12788 if (!super.OnStoreLoad(ctx, version))
12789 {
12791 return false;
12792 }
12793
12794 if (version >= 114)
12795 {
12796 bool hasQuickBarIndexSaved;
12797
12798 if (!ctx.
Read(hasQuickBarIndexSaved))
12799 {
12801 return false;
12802 }
12803
12804 if (hasQuickBarIndexSaved)
12805 {
12806 int itmQBIndex;
12807
12808
12809 if (!ctx.
Read(itmQBIndex))
12810 {
12812 return false;
12813 }
12814
12815 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12816 if (itmQBIndex != -1 && parentPlayer)
12817 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12818 }
12819 }
12820 else
12821 {
12822
12823 PlayerBase player;
12824 int itemQBIndex;
12825 if (version ==
int.
MAX)
12826 {
12827 if (!ctx.
Read(itemQBIndex))
12828 {
12830 return false;
12831 }
12832 }
12833 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12834 {
12835
12836 if (!ctx.
Read(itemQBIndex))
12837 {
12839 return false;
12840 }
12841 if (itemQBIndex != -1 && player)
12842 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12843 }
12844 }
12845
12846 if (version < 140)
12847 {
12848
12849 if (!LoadVariables(ctx, version))
12850 {
12852 return false;
12853 }
12854 }
12855
12856
12858 {
12860 return false;
12861 }
12862 if (version >= 132)
12863 {
12865 if (raib)
12866 {
12868 {
12870 return false;
12871 }
12872 }
12873 }
12874
12876 return true;
12877 }
12878
12879
12880
12882 {
12883 super.OnStoreSave(ctx);
12884
12885 PlayerBase player;
12886 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12887 {
12889
12890 int itemQBIndex = -1;
12891 itemQBIndex = player.FindQuickBarEntityIndex(this);
12892 ctx.
Write(itemQBIndex);
12893 }
12894 else
12895 {
12897 }
12898
12900
12902 if (raib)
12903 {
12905 }
12906 }
12907
12908
12910 {
12911 super.AfterStoreLoad();
12912
12914 {
12916 }
12917
12919 {
12922 }
12923 }
12924
12926 {
12927 super.EEOnAfterLoad();
12928
12930 {
12932 }
12933
12936 }
12937
12939 {
12940 return false;
12941 }
12942
12943
12944
12946 {
12948 {
12949 #ifdef PLATFORM_CONSOLE
12950
12952 {
12954 if (menu)
12955 {
12957 }
12958 }
12959 #endif
12960 }
12961
12963 {
12966 }
12967
12969 {
12970 SetWeightDirty();
12972 }
12974 {
12977 }
12978
12980 {
12983 }
12985 {
12988 }
12989
12990 super.OnVariablesSynchronized();
12991 }
12992
12993
12994
12996 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12997 {
12998 if (!IsServerCheck(allow_client))
12999 return false;
13000
13002 return false;
13003
13006
13007 if (value <= (min + 0.001))
13008 value = min;
13009
13010 if (value == min)
13011 {
13012 if (destroy_config)
13013 {
13014 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
13015 if (dstr)
13016 {
13018 this.Delete();
13019 return true;
13020 }
13021 }
13022 else if (destroy_forced)
13023 {
13025 this.Delete();
13026 return true;
13027 }
13028
13030 }
13031
13034
13036 {
13038
13039 if (delta)
13041 }
13042
13044
13045 return false;
13046 }
13047
13048
13050 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13051 {
13053 }
13054
13056 {
13059 }
13060
13062 {
13065 }
13066
13068 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13069 {
13070 float value_clamped = Math.Clamp(value, 0, 1);
13072 SetQuantity(result, destroy_config, destroy_forced);
13073 }
13074
13075
13078 {
13080 }
13081
13083 {
13085 }
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13097 {
13098 int slot = -1;
13099 if (GetInventory())
13100 {
13101 InventoryLocation il = new InventoryLocation;
13102 GetInventory().GetCurrentInventoryLocation(il);
13104 }
13105
13107 }
13108
13110 {
13111 float quantity_max = 0;
13112
13114 {
13115 if (attSlotID != -1)
13116 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13117
13118 if (quantity_max <= 0)
13120 }
13121
13122 if (quantity_max <= 0)
13124
13125 return quantity_max;
13126 }
13127
13129 {
13131 }
13132
13134 {
13136 }
13137
13138
13140 {
13142 }
13143
13145 {
13147 }
13148
13150 {
13152 }
13153
13154
13156 {
13157
13158 float weightEx = GetWeightEx();
13159 float special = GetInventoryAndCargoWeight();
13160 return weightEx - special;
13161 }
13162
13163
13165 {
13167 }
13168
13170 {
13172 {
13173 #ifdef DEVELOPER
13174 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13175 {
13176 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13178 }
13179 #endif
13180
13181 return GetQuantity() * GetConfigWeightModified();
13182 }
13183 else if (HasEnergyManager())
13184 {
13185 #ifdef DEVELOPER
13186 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13187 {
13188 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13189 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13190 }
13191 #endif
13192 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13193 }
13194 else
13195 {
13196 #ifdef DEVELOPER
13197 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13198 {
13199 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13200 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13201 }
13202 #endif
13203 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13204 }
13205 }
13206
13209 {
13210 int item_count = 0;
13212
13213 if (GetInventory().GetCargo() != NULL)
13214 {
13215 item_count = GetInventory().GetCargo().GetItemCount();
13216 }
13217
13218 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13219 {
13220 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13221 if (item)
13222 item_count += item.GetNumberOfItems();
13223 }
13224 return item_count;
13225 }
13226
13229 {
13230 float weight = 0;
13231 float wetness = 1;
13232 if (include_wetness)
13235 {
13236 weight = wetness * m_ConfigWeight;
13237 }
13239 {
13240 weight = 1;
13241 }
13242 return weight;
13243 }
13244
13245
13246
13248 {
13249 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13250 {
13251 GameInventory inv = GetInventory();
13252 array<EntityAI> items = new array<EntityAI>;
13254 for (int i = 0; i < items.Count(); i++)
13255 {
13257 if (item)
13258 {
13260 }
13261 }
13262 }
13263 }
13264
13265
13266
13267
13269 {
13270 float energy = 0;
13271 if (HasEnergyManager())
13272 {
13273 energy = GetCompEM().GetEnergy();
13274 }
13275 return energy;
13276 }
13277
13278
13280 {
13281 super.OnEnergyConsumed();
13282
13284 }
13285
13287 {
13288 super.OnEnergyAdded();
13289
13291 }
13292
13293
13295 {
13296 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13297 {
13299 {
13300 float energy_0to1 = GetCompEM().GetEnergy0To1();
13302 }
13303 }
13304 }
13305
13306
13308 {
13309 return ConfigGetFloat("heatIsolation");
13310 }
13311
13313 {
13315 }
13316
13318 {
13319 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13320 if (
GetGame().ConfigIsExisting(paramPath))
13322
13323 return 0.0;
13324 }
13325
13327 {
13328 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13329 if (
GetGame().ConfigIsExisting(paramPath))
13331
13332 return 0.0;
13333 }
13334
13335 override void SetWet(
float value,
bool allow_client =
false)
13336 {
13337 if (!IsServerCheck(allow_client))
13338 return;
13339
13342
13344
13345 m_VarWet = Math.Clamp(value, min, max);
13346
13348 {
13351 }
13352 }
13353
13354 override void AddWet(
float value)
13355 {
13357 }
13358
13360 {
13362 }
13363
13365 {
13367 }
13368
13370 {
13372 }
13373
13375 {
13377 }
13378
13380 {
13382 }
13383
13384 override void OnWetChanged(
float newVal,
float oldVal)
13385 {
13388 if (newLevel != oldLevel)
13389 {
13391 }
13392 }
13393
13395 {
13396 SetWeightDirty();
13397 }
13398
13400 {
13401 return GetWetLevelInternal(
m_VarWet);
13402 }
13403
13404
13405
13407 {
13409 }
13410
13412 {
13414 }
13415
13417 {
13419 }
13420
13422 {
13424 }
13425
13426
13427
13429 {
13430 if (ConfigIsExisting("itemModelLength"))
13431 {
13432 return ConfigGetFloat("itemModelLength");
13433 }
13434 return 0;
13435 }
13436
13438 {
13439 if (ConfigIsExisting("itemAttachOffset"))
13440 {
13441 return ConfigGetFloat("itemAttachOffset");
13442 }
13443 return 0;
13444 }
13445
13446 override void SetCleanness(
int value,
bool allow_client =
false)
13447 {
13448 if (!IsServerCheck(allow_client))
13449 return;
13450
13452
13454
13457 }
13458
13460 {
13462 }
13463
13465 {
13466 return true;
13467 }
13468
13469
13470
13471
13473 {
13475 }
13476
13478 {
13480 }
13481
13482
13483
13484
13485 override void SetColor(
int r,
int g,
int b,
int a)
13486 {
13492 }
13494 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13495 {
13500 }
13501
13503 {
13505 }
13506
13509 {
13510 int r,g,b,a;
13512 r = r/255;
13513 g = g/255;
13514 b = b/255;
13515 a = a/255;
13516 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13517 }
13518
13519
13520
13521 override void SetLiquidType(
int value,
bool allow_client =
false)
13522 {
13523 if (!IsServerCheck(allow_client))
13524 return;
13525
13530 }
13531
13533 {
13534 return ConfigGetInt("varLiquidTypeInit");
13535 }
13536
13538 {
13540 }
13541
13543 {
13545 SetFrozen(false);
13546 }
13547
13550 {
13551 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13552 }
13553
13554
13557 {
13558 PlayerBase nplayer;
13559 if (PlayerBase.CastTo(nplayer, player))
13560 {
13562
13563 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13564 }
13565 }
13566
13567
13570 {
13571 PlayerBase nplayer;
13572 if (PlayerBase.CastTo(nplayer,player))
13573 {
13574
13575 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13576
13577 }
13578
13579
13580 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13581
13582
13583 if (HasEnergyManager())
13584 {
13585 GetCompEM().UpdatePlugState();
13586 }
13587 }
13588
13589
13591 {
13592 super.OnPlacementStarted(player);
13593
13595 }
13596
13597 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13598 {
13600 {
13601 m_AdminLog.OnPlacementComplete(player,
this);
13602 }
13603
13604 super.OnPlacementComplete(player, position, orientation);
13605 }
13606
13607
13608
13609
13610
13612 {
13614 {
13615 return true;
13616 }
13617 else
13618 {
13619 return false;
13620 }
13621 }
13622
13623
13625 {
13627 {
13629 }
13630 }
13631
13632
13634 {
13636 }
13637
13639 {
13641 }
13642
13643 override void InsertAgent(
int agent,
float count = 1)
13644 {
13645 if (count < 1)
13646 return;
13647
13649 }
13650
13653 {
13655 }
13656
13657
13659 {
13661 }
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13705 {
13707 return false;
13708 return true;
13709 }
13710
13712 {
13713
13715 }
13716
13717
13720 {
13721 super.CheckForRoofLimited(timeTresholdMS);
13722
13724 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13725 {
13726 m_PreviousRoofTestTime = time;
13727 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13728 }
13729 }
13730
13731
13733 {
13735 {
13736 return 0;
13737 }
13738
13739 if (GetInventory().GetAttachmentSlotsCount() != 0)
13740 {
13741 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13742 if (filter)
13743 return filter.GetProtectionLevel(type, false, system);
13744 else
13745 return 0;
13746 }
13747
13748 string subclassPath, entryName;
13749
13750 switch (type)
13751 {
13753 entryName = "biological";
13754 break;
13756 entryName = "chemical";
13757 break;
13758 default:
13759 entryName = "biological";
13760 break;
13761 }
13762
13763 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13764
13766 }
13767
13768
13769
13772 {
13773 if (!IsMagazine())
13775
13777 }
13778
13779
13780
13781
13782
13787 {
13788 return true;
13789 }
13790
13792 {
13794 }
13795
13796
13797
13798
13799
13801 {
13802 if (parent)
13803 {
13804 if (parent.IsInherited(DayZInfected))
13805 return true;
13806
13807 if (!parent.IsRuined())
13808 return true;
13809 }
13810
13811 return true;
13812 }
13813
13815 {
13816 if (!super.CanPutAsAttachment(parent))
13817 {
13818 return false;
13819 }
13820
13821 if (!IsRuined() && !parent.IsRuined())
13822 {
13823 return true;
13824 }
13825
13826 return false;
13827 }
13828
13830 {
13831
13832
13833
13834
13835 return super.CanReceiveItemIntoCargo(item);
13836 }
13837
13839 {
13840
13841
13842
13843
13844 GameInventory attachmentInv = attachment.GetInventory();
13846 {
13847 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13848 return false;
13849 }
13850
13851 InventoryLocation loc = new InventoryLocation();
13852 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13853 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13854 return false;
13855
13856 return super.CanReceiveAttachment(attachment, slotId);
13857 }
13858
13860 {
13861 if (!super.CanReleaseAttachment(attachment))
13862 return false;
13863
13864 return GetInventory().AreChildrenAccessible();
13865 }
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13888 {
13889 int id = muzzle_owner.GetMuzzleID();
13890 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13891
13892 if (WPOF_array)
13893 {
13894 for (int i = 0; i < WPOF_array.Count(); i++)
13895 {
13896 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13897
13898 if (WPOF)
13899 {
13900 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13901 }
13902 }
13903 }
13904 }
13905
13906
13908 {
13909 int id = muzzle_owner.GetMuzzleID();
13911
13912 if (WPOBE_array)
13913 {
13914 for (int i = 0; i < WPOBE_array.Count(); i++)
13915 {
13916 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13917
13918 if (WPOBE)
13919 {
13920 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13921 }
13922 }
13923 }
13924 }
13925
13926
13928 {
13929 int id = muzzle_owner.GetMuzzleID();
13930 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13931
13932 if (WPOOH_array)
13933 {
13934 for (int i = 0; i < WPOOH_array.Count(); i++)
13935 {
13936 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13937
13938 if (WPOOH)
13939 {
13940 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13941 }
13942 }
13943 }
13944 }
13945
13946
13948 {
13949 int id = muzzle_owner.GetMuzzleID();
13950 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13951
13952 if (WPOOH_array)
13953 {
13954 for (int i = 0; i < WPOOH_array.Count(); i++)
13955 {
13956 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13957
13958 if (WPOOH)
13959 {
13960 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13961 }
13962 }
13963 }
13964 }
13965
13966
13968 {
13969 int id = muzzle_owner.GetMuzzleID();
13970 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13971
13972 if (WPOOH_array)
13973 {
13974 for (int i = 0; i < WPOOH_array.Count(); i++)
13975 {
13976 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13977
13978 if (WPOOH)
13979 {
13980 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13981 }
13982 }
13983 }
13984 }
13985
13986
13987
13989 {
13991 {
13992 return true;
13993 }
13994
13995 return false;
13996 }
13997
13999 {
14001 {
14002 return true;
14003 }
14004
14005 return false;
14006 }
14007
14009 {
14011 {
14012 return true;
14013 }
14014
14015 return false;
14016 }
14017
14019 {
14020 return false;
14021 }
14022
14025 {
14026 return UATimeSpent.DEFAULT_DEPLOY;
14027 }
14028
14029
14030
14031
14033 {
14035 SetSynchDirty();
14036 }
14037
14039 {
14041 }
14042
14043
14045 {
14046 return false;
14047 }
14048
14051 {
14052 string att_type = "None";
14053
14054 if (ConfigIsExisting("soundAttType"))
14055 {
14056 att_type = ConfigGetString("soundAttType");
14057 }
14058
14060 }
14061
14063 {
14065 }
14066
14067
14068
14069
14070
14076
14078 {
14081
14083 }
14084
14085
14087 {
14089 return;
14090
14092
14095
14098
14099 SoundParameters params = new SoundParameters();
14103 }
14104
14105
14107 {
14109 return;
14110
14112 SetSynchDirty();
14113
14116 }
14117
14118
14120 {
14122 return;
14123
14125 SetSynchDirty();
14126
14129 }
14130
14132 {
14134 }
14135
14137 {
14139 }
14140
14143 {
14144 if (!
GetGame().IsDedicatedServer())
14145 {
14146 if (ConfigIsExisting("attachSoundSet"))
14147 {
14148 string cfg_path = "";
14149 string soundset = "";
14150 string type_name =
GetType();
14151
14154 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14155 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14156
14157 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14158 {
14159 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14160 {
14161 if (cfg_slot_array[i] == slot_type)
14162 {
14163 soundset = cfg_soundset_array[i];
14164 break;
14165 }
14166 }
14167 }
14168
14169 if (soundset != "")
14170 {
14171 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14173 }
14174 }
14175 }
14176 }
14177
14179 {
14180
14181 }
14182
14183 void OnApply(PlayerBase player);
14184
14186 {
14187 return 1.0;
14188 };
14189
14191 {
14193 }
14194
14196 {
14198 }
14199
14201
14203 {
14204 SetDynamicPhysicsLifeTime(0.01);
14206 }
14207
14209 {
14210 array<string> zone_names = new array<string>;
14211 GetDamageZones(zone_names);
14212 for (int i = 0; i < zone_names.Count(); i++)
14213 {
14214 SetHealthMax(zone_names.Get(i),"Health");
14215 }
14216 SetHealthMax("","Health");
14217 }
14218
14221 {
14222 float global_health = GetHealth01("","Health");
14223 array<string> zones = new array<string>;
14224 GetDamageZones(zones);
14225
14226 for (int i = 0; i < zones.Count(); i++)
14227 {
14228 SetHealth01(zones.Get(i),"Health",global_health);
14229 }
14230 }
14231
14234 {
14235 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14236 }
14237
14239 {
14240 if (!hasRootAsPlayer)
14241 {
14242 if (refParentIB)
14243 {
14244
14245 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14246 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14247
14248 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14249 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14250
14253 }
14254 else
14255 {
14256
14259 }
14260 }
14261 }
14262
14264 {
14266 {
14267 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14268 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14269 {
14270 float heatPermCoef = 1.0;
14272 while (ent)
14273 {
14274 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14275 ent = ent.GetHierarchyParent();
14276 }
14277
14278 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14279 }
14280 }
14281 }
14282
14284 {
14285
14286 EntityAI parent = GetHierarchyParent();
14287 if (!parent)
14288 {
14289 hasParent = false;
14290 hasRootAsPlayer = false;
14291 }
14292 else
14293 {
14294 hasParent = true;
14295 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14296 refParentIB =
ItemBase.Cast(parent);
14297 }
14298 }
14299
14300 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14301 {
14302
14303 }
14304
14306 {
14307
14308 return false;
14309 }
14310
14312 {
14313
14314
14315 return false;
14316 }
14317
14319 {
14320
14321 return false;
14322 }
14323
14326 {
14327 return !GetIsFrozen() &&
IsOpen();
14328 }
14329
14331 {
14332 bool hasParent = false, hasRootAsPlayer = false;
14334
14335 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14336 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14337
14338 if (wwtu || foodDecay)
14339 {
14343
14344 if (processWetness || processTemperature || processDecay)
14345 {
14347
14348 if (processWetness)
14349 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14350
14351 if (processTemperature)
14353
14354 if (processDecay)
14355 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14356 }
14357 }
14358 }
14359
14362 {
14364 }
14365
14367 {
14370
14371 return super.GetTemperatureFreezeThreshold();
14372 }
14373
14375 {
14378
14379 return super.GetTemperatureThawThreshold();
14380 }
14381
14383 {
14386
14387 return super.GetItemOverheatThreshold();
14388 }
14389
14391 {
14393 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14394
14395 return super.GetTemperatureFreezeTime();
14396 }
14397
14399 {
14401 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14402
14403 return super.GetTemperatureThawTime();
14404 }
14405
14410
14412 {
14413 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14414 }
14415
14417 {
14418 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14419 }
14420
14423 {
14425 }
14426
14428 {
14430 }
14431
14433 {
14435 }
14436
14439 {
14440 return null;
14441 }
14442
14445 {
14446 return false;
14447 }
14448
14450 {
14452 {
14455 if (!trg)
14456 {
14458 explosive = this;
14459 }
14460
14461 explosive.PairRemote(trg);
14463
14464 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14465 trg.SetPersistentPairID(persistentID);
14466 explosive.SetPersistentPairID(persistentID);
14467
14468 return true;
14469 }
14470 return false;
14471 }
14472
14475 {
14476 float ret = 1.0;
14479 ret *= GetHealth01();
14480
14481 return ret;
14482 }
14483
14484 #ifdef DEVELOPER
14485 override void SetDebugItem()
14486 {
14487 super.SetDebugItem();
14488 _itemBase = this;
14489 }
14490
14492 {
14493 string text = super.GetDebugText();
14494
14496 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14497
14498 return text;
14499 }
14500 #endif
14501
14503 {
14504 return true;
14505 }
14506
14508
14510
14512 {
14515 }
14516
14517
14525
14541}
14542
14544{
14546 if (entity)
14547 {
14548 bool is_item = entity.IsInherited(
ItemBase);
14549 if (is_item && full_quantity)
14550 {
14553 }
14554 }
14555 else
14556 {
14558 return NULL;
14559 }
14560 return entity;
14561}
14562
14564{
14565 if (item)
14566 {
14567 if (health > 0)
14568 item.SetHealth("", "", health);
14569
14570 if (item.CanHaveTemperature())
14571 {
14573 if (item.CanFreeze())
14574 item.SetFrozen(false);
14575 }
14576
14577 if (item.HasEnergyManager())
14578 {
14579 if (quantity >= 0)
14580 {
14581 item.GetCompEM().SetEnergy0To1(quantity);
14582 }
14583 else
14584 {
14586 }
14587 }
14588 else if (item.IsMagazine())
14589 {
14590 Magazine mag = Magazine.Cast(item);
14591 if (quantity >= 0)
14592 {
14593 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14594 }
14595 else
14596 {
14598 }
14599
14600 }
14601 else
14602 {
14603 if (quantity >= 0)
14604 {
14605 item.SetQuantityNormalized(quantity, false);
14606 }
14607 else
14608 {
14610 }
14611
14612 }
14613 }
14614}
14615
14616#ifdef DEVELOPER
14618#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.