9538{
9540 {
9541 return true;
9542 }
9543};
9544
9545
9546
9548{
9552
9554
9557
9558
9559
9560
9561
9570
9576
9581
9586
9607 protected bool m_IsResultOfSplit
9608
9610
9615
9616
9617
9619
9623
9624
9625
9627
9630
9631
9632
9638
9639
9647
9650
9651
9653
9654
9656
9657
9662
9663
9668
9669
9671
9672
9674 {
9679
9680 if (!
GetGame().IsDedicatedServer())
9681 {
9683 {
9685
9687 {
9689 }
9690 }
9691
9694 }
9695
9696 m_OldLocation = null;
9697
9699 {
9701 }
9702
9703 if (ConfigIsExisting("headSelectionsToHide"))
9704 {
9707 }
9708
9710 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9711 {
9713 }
9714
9716
9717 m_IsResultOfSplit = false;
9718
9720 }
9721
9723 {
9724 super.InitItemVariables();
9725
9731 m_Count = ConfigGetInt(
"count");
9732
9735
9740
9743
9748
9760
9764
9765
9768 if (ConfigIsExisting("canBeSplit"))
9769 {
9772 }
9773
9775 if (ConfigIsExisting("itemBehaviour"))
9777
9778
9781 RegisterNetSyncVariableInt("m_VarLiquidType");
9782 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9783
9784 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9785 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9786 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9787
9788 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9789 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9790 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9791 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9792
9793 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9794 RegisterNetSyncVariableBool("m_IsTakeable");
9795 RegisterNetSyncVariableBool("m_IsHologram");
9796
9799 {
9802 }
9803
9805
9807 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9809
9810 }
9811
9813 {
9815 }
9816
9818 {
9821 {
9826 }
9827 }
9828
9829 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9830 {
9832 {
9835 }
9836
9838 }
9839
9841 {
9847 }
9848
9850
9852 {
9854
9855 if (!action)
9856 {
9857 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9858 return;
9859 }
9860
9862 if (!ai)
9863 {
9865 return;
9866 }
9867
9869 if (!action_array)
9870 {
9871 action_array = new array<ActionBase_Basic>;
9873 }
9874 if (LogManager.IsActionLogEnable())
9875 {
9876 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9877 }
9878
9879 if (action_array.Find(action) != -1)
9880 {
9881 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9882 }
9883 else
9884 {
9885 action_array.Insert(action);
9886 }
9887 }
9888
9890 {
9892 ActionBase action = player.GetActionManager().GetAction(actionName);
9895
9896 if (action_array)
9897 {
9898 action_array.RemoveItem(action);
9899 }
9900 }
9901
9902
9903
9905 {
9906 ActionOverrideData overrideData = new ActionOverrideData();
9910
9912 if (!actionMap)
9913 {
9916 }
9917
9918 actionMap.Insert(this.
Type(), overrideData);
9919
9920 }
9921
9923
9925
9926
9928 {
9931
9934
9935 string config_to_search = "CfgVehicles";
9936 string muzzle_owner_config;
9937
9939 {
9940 if (IsInherited(Weapon))
9941 config_to_search = "CfgWeapons";
9942
9943 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9944
9945 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9946
9948
9949 if (config_OnFire_subclass_count > 0)
9950 {
9951 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9952
9953 for (int i = 0; i < config_OnFire_subclass_count; i++)
9954 {
9955 string particle_class = "";
9957 string config_OnFire_entry = config_OnFire_class + particle_class;
9958 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9959 WPOF_array.Insert(WPOF);
9960 }
9961
9962
9964 }
9965 }
9966
9968 {
9969 config_to_search = "CfgWeapons";
9970 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9971
9972 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9973
9975
9976 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9977 {
9978 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9979
9980 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9981 {
9982 string particle_class2 = "";
9984 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9985 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9986 WPOBE_array.Insert(WPOBE);
9987 }
9988
9989
9991 }
9992 }
9993 }
9994
9995
9997 {
10000
10002 {
10003 string config_to_search = "CfgVehicles";
10004
10005 if (IsInherited(Weapon))
10006 config_to_search = "CfgWeapons";
10007
10008 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10009 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10010
10011 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10012 {
10013
10015
10017 {
10019 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10021 return;
10022 }
10023
10026
10027
10028
10030 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10031
10032 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10033 {
10034 string particle_class = "";
10036 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10038
10039 if (entry_type == CT_CLASS)
10040 {
10041 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10042 WPOOH_array.Insert(WPOF);
10043 }
10044 }
10045
10046
10048 }
10049 }
10050 }
10051
10053 {
10055 }
10056
10058 {
10060 {
10062
10065
10068
10069 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10070 }
10071 }
10072
10074 {
10076 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10077
10079 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10080
10082 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10083
10085 {
10087 }
10088 }
10089
10091 {
10093 }
10094
10096 {
10099 else
10101
10103 {
10106 }
10107 else
10108 {
10111
10114 }
10115
10117 }
10118
10120 {
10122 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10123 }
10124
10126 {
10128 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10130 }
10131
10133 {
10135 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10136 }
10137
10139 {
10142
10143 OverheatingParticle OP = new OverheatingParticle();
10148
10150 }
10151
10153 {
10156
10157 return -1;
10158 }
10159
10161 {
10163 {
10166
10167 for (int i = count; i > 0; --i)
10168 {
10169 int id = i - 1;
10172
10175
10176 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10177 {
10178 if (p)
10179 {
10182 }
10183 }
10184 }
10185 }
10186 }
10187
10189 {
10191 {
10193 {
10194 int id = i - 1;
10196
10197 if (OP)
10198 {
10200
10201 if (p)
10202 {
10204 }
10205
10206 delete OP;
10207 }
10208 }
10209
10212 }
10213 }
10214
10217 {
10218 return 0.0;
10219 }
10220
10221
10223 {
10224 return 250;
10225 }
10226
10228 {
10229 return 0;
10230 }
10231
10234 {
10236 return true;
10237
10238 return false;
10239 }
10240
10243 {
10246
10248 {
10250 }
10251 else
10252 {
10253
10255 }
10256
10258 }
10259
10266 {
10267 return -1;
10268 }
10269
10270
10271
10272
10274 {
10276 {
10278 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10279
10280 if (r_index >= 0)
10281 {
10282 InventoryLocation r_il = new InventoryLocation;
10283 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10284
10285 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10288 {
10289 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10290 }
10292 {
10293 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10294 }
10295
10296 }
10297
10298 player.GetHumanInventory().ClearUserReservedLocation(this);
10299 }
10300
10303 }
10304
10305
10306
10307
10309 {
10310 return ItemBase.m_DebugActionsMask;
10311 }
10312
10314 {
10315 return ItemBase.m_DebugActionsMask & mask;
10316 }
10317
10319 {
10320 ItemBase.m_DebugActionsMask = mask;
10321 }
10322
10324 {
10325 ItemBase.m_DebugActionsMask |= mask;
10326 }
10327
10329 {
10330 ItemBase.m_DebugActionsMask &= ~mask;
10331 }
10332
10334 {
10336 {
10338 }
10339 else
10340 {
10342 }
10343 }
10344
10345
10347 {
10348 if (GetEconomyProfile())
10349 {
10350 float q_max = GetEconomyProfile().GetQuantityMax();
10351 if (q_max > 0)
10352 {
10353 float q_min = GetEconomyProfile().GetQuantityMin();
10354 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10355
10357 {
10358 ComponentEnergyManager comp = GetCompEM();
10360 {
10362 }
10363 }
10365 {
10367
10368 }
10369
10370 }
10371 }
10372 }
10373
10376 {
10377 EntityAI parent = GetHierarchyParent();
10378
10379 if (parent)
10380 {
10381 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10382 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10383 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10384 }
10385 }
10386
10389 {
10390 EntityAI parent = GetHierarchyParent();
10391
10392 if (parent)
10393 {
10394 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10395 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10396 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10397 }
10398 }
10399
10401 {
10402
10403
10404
10405
10407
10409 {
10410 if (ScriptInputUserData.CanStoreInputUserData())
10411 {
10412 ScriptInputUserData ctx = new ScriptInputUserData;
10418 ctx.
Write(use_stack_max);
10421
10423 {
10424 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10425 }
10426 }
10427 }
10428 else if (!
GetGame().IsMultiplayer())
10429 {
10431 }
10432 }
10433
10435 {
10437 }
10438
10440 {
10442 }
10443
10445 {
10447 }
10448
10450 {
10451
10452 return false;
10453 }
10454
10456 {
10457 return false;
10458 }
10459
10463 {
10464 return false;
10465 }
10466
10468 {
10469 return "";
10470 }
10471
10473
10475 {
10476 return false;
10477 }
10478
10480 {
10481 return true;
10482 }
10483
10484
10485
10487 {
10488 return true;
10489 }
10490
10492 {
10493 return true;
10494 }
10495
10497 {
10498 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10500 }
10501
10503 {
10505 }
10506
10508 {
10510 if (!is_being_placed)
10512 SetSynchDirty();
10513 }
10514
10515
10517
10519 {
10521 }
10522
10524 {
10526 }
10527
10529 {
10530 return 1;
10531 }
10532
10534 {
10535 return false;
10536 }
10537
10539 {
10541 SetSynchDirty();
10542 }
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10579 {
10580 super.OnMovedInsideCargo(container);
10581
10582 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10583 }
10584
10585 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10586 {
10587 super.EEItemLocationChanged(oldLoc,newLoc);
10588
10589 PlayerBase new_player = null;
10590 PlayerBase old_player = null;
10591
10592 if (newLoc.GetParent())
10593 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10594
10595 if (oldLoc.GetParent())
10596 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10597
10599 {
10600 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10601
10602 if (r_index >= 0)
10603 {
10604 InventoryLocation r_il = new InventoryLocation;
10605 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10606
10607 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10610 {
10611 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10612 }
10614 {
10615 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10616 }
10617
10618 }
10619 }
10620
10622 {
10623 if (new_player)
10624 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10625
10626 if (new_player == old_player)
10627 {
10628
10629 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10630 {
10632 {
10633 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10634 {
10635 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10636 }
10637 }
10638 else
10639 {
10640 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10641 }
10642 }
10643
10644 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10645 {
10646 int type = oldLoc.GetType();
10648 {
10649 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10650 }
10652 {
10653 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10654 }
10655 }
10656 if (!m_OldLocation)
10657 {
10658 m_OldLocation = new InventoryLocation;
10659 }
10660 m_OldLocation.Copy(oldLoc);
10661 }
10662 else
10663 {
10664 if (m_OldLocation)
10665 {
10666 m_OldLocation.Reset();
10667 }
10668 }
10669
10671 }
10672 else
10673 {
10674 if (new_player)
10675 {
10676 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10677 if (res_index >= 0)
10678 {
10679 InventoryLocation il = new InventoryLocation;
10680 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10682 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10685 {
10686 il.
GetParent().GetOnReleaseLock().Invoke(it);
10687 }
10689 {
10691 }
10692
10693 }
10694 }
10696 {
10697
10699 }
10700
10701 if (m_OldLocation)
10702 {
10703 m_OldLocation.Reset();
10704 }
10705 }
10706 }
10707
10708 override void EOnContact(IEntity other, Contact extra)
10709 {
10711 {
10712 int liquidType = -1;
10714 if (impactSpeed > 0.0)
10715 {
10717 #ifndef SERVER
10719 #else
10721 SetSynchDirty();
10722 #endif
10724 }
10725 }
10726
10727 #ifdef SERVER
10728 if (GetCompEM() && GetCompEM().IsPlugged())
10729 {
10730 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10731 GetCompEM().UnplugThis();
10732 }
10733 #endif
10734 }
10735
10737
10739 {
10741 }
10742
10744 {
10745
10746 }
10747
10749 {
10750 super.OnItemLocationChanged(old_owner, new_owner);
10751
10752 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10753 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10754
10755 if (!relatedPlayer && playerNew)
10756 relatedPlayer = playerNew;
10757
10758 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10759 {
10761 if (actionMgr)
10762 {
10763 ActionBase currentAction = actionMgr.GetRunningAction();
10764 if (currentAction)
10766 }
10767 }
10768
10769 Man ownerPlayerOld = null;
10770 Man ownerPlayerNew = null;
10771
10772 if (old_owner)
10773 {
10774 if (old_owner.
IsMan())
10775 {
10776 ownerPlayerOld = Man.Cast(old_owner);
10777 }
10778 else
10779 {
10780 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10781 }
10782 }
10783 else
10784 {
10786 {
10788
10789 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10790 {
10791 GetCompEM().UnplugThis();
10792 }
10793 }
10794 }
10795
10796 if (new_owner)
10797 {
10798 if (new_owner.
IsMan())
10799 {
10800 ownerPlayerNew = Man.Cast(new_owner);
10801 }
10802 else
10803 {
10804 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10805 }
10806 }
10807
10808 if (ownerPlayerOld != ownerPlayerNew)
10809 {
10810 if (ownerPlayerOld)
10811 {
10812 array<EntityAI> subItemsExit = new array<EntityAI>;
10814 for (int i = 0; i < subItemsExit.Count(); i++)
10815 {
10818 }
10819 }
10820
10821 if (ownerPlayerNew)
10822 {
10823 array<EntityAI> subItemsEnter = new array<EntityAI>;
10825 for (int j = 0; j < subItemsEnter.Count(); j++)
10826 {
10829 }
10830 }
10831 }
10832 else if (ownerPlayerNew != null)
10833 {
10834 PlayerBase nplayer;
10835 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10836 {
10837 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10839 for (int k = 0; k < subItemsUpdate.Count(); k++)
10840 {
10842 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10843 }
10844 }
10845 }
10846
10847 if (old_owner)
10848 old_owner.OnChildItemRemoved(this);
10849 if (new_owner)
10850 new_owner.OnChildItemReceived(this);
10851 }
10852
10853
10855 {
10856 super.EEDelete(parent);
10857 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10858 if (player)
10859 {
10861
10862 if (player.IsAlive())
10863 {
10864 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10865 if (r_index >= 0)
10866 {
10867 InventoryLocation r_il = new InventoryLocation;
10868 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10869
10870 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10873 {
10874 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10875 }
10877 {
10878 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10879 }
10880
10881 }
10882
10883 player.RemoveQuickBarEntityShortcut(this);
10884 }
10885 }
10886 }
10887
10889 {
10890 super.EEKilled(killer);
10891
10894 {
10895 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10896 {
10897 if (IsMagazine())
10898 {
10899 if (Magazine.Cast(this).GetAmmoCount() > 0)
10900 {
10902 }
10903 }
10904 else
10905 {
10907 }
10908 }
10909 }
10910 }
10911
10913 {
10914 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10915
10916 super.OnWasAttached(parent, slot_id);
10917
10920
10922 }
10923
10925 {
10926 super.OnWasDetached(parent, slot_id);
10927
10930 }
10931
10933 {
10934 int idx;
10937
10938 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10939 if (inventory_slots.Count() < 1)
10940 {
10941 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10942 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10943 }
10944 else
10945 {
10946 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10947 }
10948
10949 idx = inventory_slots.Find(slot);
10950 if (idx < 0)
10951 return "";
10952
10953 return attach_types.Get(idx);
10954 }
10955
10957 {
10958 int idx = -1;
10959 string slot;
10960
10963
10964 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10965 if (inventory_slots.Count() < 1)
10966 {
10967 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10968 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10969 }
10970 else
10971 {
10972 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10973 if (detach_types.Count() < 1)
10974 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10975 }
10976
10977 for (int i = 0; i < inventory_slots.Count(); i++)
10978 {
10979 slot = inventory_slots.Get(i);
10980 }
10981
10982 if (slot != "")
10983 {
10984 if (detach_types.Count() == 1)
10985 idx = 0;
10986 else
10987 idx = inventory_slots.Find(slot);
10988 }
10989 if (idx < 0)
10990 return "";
10991
10992 return detach_types.Get(idx);
10993 }
10994
10996 {
10997
10999
11000
11001 float min_time = 1;
11002 float max_time = 3;
11003 float delay = Math.RandomFloat(min_time, max_time);
11004
11005 explode_timer.Run(delay, this, "DoAmmoExplosion");
11006 }
11007
11009 {
11010 Magazine magazine = Magazine.Cast(this);
11011 int pop_sounds_count = 6;
11012 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11013
11014
11015 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11016 string sound_name = pop_sounds[ sound_idx ];
11018
11019
11020 magazine.ServerAddAmmoCount(-1);
11021
11022
11023 float min_temp_to_explode = 100;
11024
11025 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11026 {
11028 }
11029 }
11030
11031
11032 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11033 {
11034 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11035
11036 const int CHANCE_DAMAGE_CARGO = 4;
11037 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11038 const int CHANCE_DAMAGE_NOTHING = 2;
11039
11041 {
11042 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11043 int chances;
11044 int rnd;
11045
11046 if (GetInventory().GetCargo())
11047 {
11048 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11049 rnd = Math.RandomInt(0,chances);
11050
11051 if (rnd < CHANCE_DAMAGE_CARGO)
11052 {
11054 }
11055 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11056 {
11058 }
11059 }
11060 else
11061 {
11062 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11063 rnd = Math.RandomInt(0,chances);
11064
11065 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11066 {
11068 }
11069 }
11070 }
11071 }
11072
11074 {
11075 if (GetInventory().GetCargo())
11076 {
11077 int item_count = GetInventory().GetCargo().GetItemCount();
11078 if (item_count > 0)
11079 {
11080 int random_pick = Math.RandomInt(0, item_count);
11082 if (!item.IsExplosive())
11083 {
11084 item.AddHealth("","",damage);
11085 return true;
11086 }
11087 }
11088 }
11089 return false;
11090 }
11091
11093 {
11094 int attachment_count = GetInventory().AttachmentCount();
11095 if (attachment_count > 0)
11096 {
11097 int random_pick = Math.RandomInt(0, attachment_count);
11098 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11099 if (!attachment.IsExplosive())
11100 {
11101 attachment.AddHealth("","",damage);
11102 return true;
11103 }
11104 }
11105 return false;
11106 }
11107
11109 {
11111 }
11112
11114 {
11116 return GetInventory().CanRemoveEntity();
11117
11118 return false;
11119 }
11120
11122 {
11123
11125 return false;
11126
11127
11129 return false;
11130
11131
11132
11134 if (delta == 0)
11135 return false;
11136
11137
11138 return true;
11139 }
11140
11142 {
11144 {
11145 if (ScriptInputUserData.CanStoreInputUserData())
11146 {
11147 ScriptInputUserData ctx = new ScriptInputUserData;
11152 ctx.
Write(destination_entity);
11154 ctx.
Write(slot_id);
11156 }
11157 }
11158 else if (!
GetGame().IsMultiplayer())
11159 {
11161 }
11162 }
11163
11165 {
11166 float split_quantity_new;
11170 InventoryLocation loc = new InventoryLocation;
11171
11172 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11173 {
11175 split_quantity_new = stack_max;
11176 else
11178
11180 {
11181 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11182 if (new_item)
11183 {
11184 new_item.SetResultOfSplit(true);
11185 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11187 new_item.
SetQuantity(split_quantity_new,
false,
true);
11188 }
11189 }
11190 }
11191 else if (destination_entity && slot_id == -1)
11192 {
11193 if (quantity > stack_max)
11194 split_quantity_new = stack_max;
11195 else
11196 split_quantity_new = quantity;
11197
11199 {
11201 {
11204 }
11205
11206 if (new_item)
11207 {
11208 new_item.SetResultOfSplit(true);
11209 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11211 new_item.
SetQuantity(split_quantity_new,
false,
true);
11212 }
11213 }
11214 }
11215 else
11216 {
11217 if (stack_max != 0)
11218 {
11220 {
11222 }
11223
11224 if (split_quantity_new == 0)
11225 {
11226 if (!
GetGame().IsMultiplayer())
11227 player.PhysicalPredictiveDropItem(this);
11228 else
11229 player.ServerDropEntity(this);
11230 return;
11231 }
11232
11234 {
11236
11237 if (new_item)
11238 {
11239 new_item.SetResultOfSplit(true);
11240 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11243 new_item.PlaceOnSurface();
11244 }
11245 }
11246 }
11247 }
11248 }
11249
11251 {
11252 float split_quantity_new;
11256 InventoryLocation loc = new InventoryLocation;
11257
11258 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11259 {
11261 split_quantity_new = stack_max;
11262 else
11264
11266 {
11267 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11268 if (new_item)
11269 {
11270 new_item.SetResultOfSplit(true);
11271 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11273 new_item.
SetQuantity(split_quantity_new,
false,
true);
11274 }
11275 }
11276 }
11277 else if (destination_entity && slot_id == -1)
11278 {
11279 if (quantity > stack_max)
11280 split_quantity_new = stack_max;
11281 else
11282 split_quantity_new = quantity;
11283
11285 {
11287 {
11290 }
11291
11292 if (new_item)
11293 {
11294 new_item.SetResultOfSplit(true);
11295 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11297 new_item.
SetQuantity(split_quantity_new,
false,
true);
11298 }
11299 }
11300 }
11301 else
11302 {
11303 if (stack_max != 0)
11304 {
11306 {
11308 }
11309
11311 {
11313
11314 if (new_item)
11315 {
11316 new_item.SetResultOfSplit(true);
11317 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11320 new_item.PlaceOnSurface();
11321 }
11322 }
11323 }
11324 }
11325 }
11326
11328 {
11330 {
11331 if (ScriptInputUserData.CanStoreInputUserData())
11332 {
11333 ScriptInputUserData ctx = new ScriptInputUserData;
11338 dst.WriteToContext(ctx);
11340 }
11341 }
11342 else if (!
GetGame().IsMultiplayer())
11343 {
11345 }
11346 }
11347
11349 {
11351 {
11352 if (ScriptInputUserData.CanStoreInputUserData())
11353 {
11354 ScriptInputUserData ctx = new ScriptInputUserData;
11359 ctx.
Write(destination_entity);
11365 }
11366 }
11367 else if (!
GetGame().IsMultiplayer())
11368 {
11370 }
11371 }
11372
11374 {
11376 }
11377
11379 {
11381 float split_quantity_new;
11383 if (dst.IsValid())
11384 {
11385 int slot_id = dst.GetSlot();
11387
11388 if (quantity > stack_max)
11389 split_quantity_new = stack_max;
11390 else
11391 split_quantity_new = quantity;
11392
11394 {
11396
11397 if (new_item)
11398 {
11399 new_item.SetResultOfSplit(true);
11400 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11402 new_item.
SetQuantity(split_quantity_new,
false,
true);
11403 }
11404
11405 return new_item;
11406 }
11407 }
11408
11409 return null;
11410 }
11411
11413 {
11415 float split_quantity_new;
11417 if (destination_entity)
11418 {
11420 if (quantity > stackable)
11421 split_quantity_new = stackable;
11422 else
11423 split_quantity_new = quantity;
11424
11426 {
11427 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11428 if (new_item)
11429 {
11430 new_item.SetResultOfSplit(true);
11431 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11433 new_item.
SetQuantity(split_quantity_new,
false,
true);
11434 }
11435 }
11436 }
11437 }
11438
11440 {
11442 {
11443 if (ScriptInputUserData.CanStoreInputUserData())
11444 {
11445 ScriptInputUserData ctx = new ScriptInputUserData;
11450 ItemBase destination_entity =
this;
11451 ctx.
Write(destination_entity);
11455 }
11456 }
11457 else if (!
GetGame().IsMultiplayer())
11458 {
11460 }
11461 }
11462
11464 {
11466 float split_quantity_new;
11468 if (player)
11469 {
11471 if (quantity > stackable)
11472 split_quantity_new = stackable;
11473 else
11474 split_quantity_new = quantity;
11475
11477 {
11478 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11479 new_item =
ItemBase.Cast(in_hands);
11480 if (new_item)
11481 {
11482 new_item.SetResultOfSplit(true);
11483 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11485 new_item.SetQuantity(split_quantity_new, false, true);
11486 }
11487 }
11488 }
11489 }
11490
11492 {
11494 float split_quantity_new = Math.Floor(quantity * 0.5);
11495
11497 return;
11498
11500
11501 if (new_item)
11502 {
11503 if (new_item.GetQuantityMax() < split_quantity_new)
11504 {
11505 split_quantity_new = new_item.GetQuantityMax();
11506 }
11507
11508 new_item.SetResultOfSplit(true);
11509 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11510
11512 {
11515 }
11516 else
11517 {
11519 new_item.
SetQuantity(split_quantity_new,
false,
true);
11520 }
11521 }
11522 }
11523
11525 {
11527 float split_quantity_new = Math.Floor(quantity / 2);
11528
11530 return;
11531
11532 InventoryLocation invloc = new InventoryLocation;
11534
11536 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11537
11538 if (new_item)
11539 {
11540 if (new_item.GetQuantityMax() < split_quantity_new)
11541 {
11542 split_quantity_new = new_item.GetQuantityMax();
11543 }
11545 {
11548 }
11549 else if (split_quantity_new > 1)
11550 {
11552 new_item.
SetQuantity(split_quantity_new,
false,
true);
11553 }
11554 }
11555 }
11556
11559 {
11560 SetWeightDirty();
11562
11563 if (parent)
11564 parent.OnAttachmentQuantityChangedEx(this, delta);
11565
11567 {
11569 {
11571 }
11573 {
11574 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11576 }
11577 }
11578
11579 }
11580
11583 {
11584
11585 }
11586
11589 {
11591 }
11592
11594 {
11595 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11596
11598 {
11599 if (newLevel == GameConstants.STATE_RUINED)
11600 {
11602 EntityAI parent = GetHierarchyParent();
11603 if (parent && parent.IsFireplace())
11604 {
11605 CargoBase cargo = GetInventory().GetCargo();
11606 if (cargo)
11607 {
11609 {
11611 }
11612 }
11613 }
11614 }
11615
11617 {
11618
11620 return;
11621 }
11622
11623 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11624 {
11626 }
11627 }
11628 }
11629
11630
11632 {
11633 super.OnRightClick();
11634
11636 {
11638 {
11639 if (ScriptInputUserData.CanStoreInputUserData())
11640 {
11641 EntityAI root = GetHierarchyRoot();
11642 Man playerOwner = GetHierarchyRootPlayer();
11643 InventoryLocation dst = new InventoryLocation;
11644
11645
11646 if (!playerOwner && root && root == this)
11647 {
11649 }
11650 else
11651 {
11652
11653 GetInventory().GetCurrentInventoryLocation(dst);
11655 {
11658 {
11660 }
11661 else
11662 {
11664
11665
11666 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11667 {
11669 }
11670 else
11671 {
11672 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11673 }
11674 }
11675 }
11676 }
11677
11678 ScriptInputUserData ctx = new ScriptInputUserData;
11686 }
11687 }
11688 else if (!
GetGame().IsMultiplayer())
11689 {
11691 }
11692 }
11693 }
11694
11696 {
11697 if (root)
11698 {
11699 vector m4[4];
11700 root.GetTransform(m4);
11701 dst.SetGround(this, m4);
11702 }
11703 else
11704 {
11705 GetInventory().GetCurrentInventoryLocation(dst);
11706 }
11707 }
11708
11709 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11710 {
11711
11712 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11713 return false;
11714
11715 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11716 return false;
11717
11718
11720 return false;
11721
11722
11723 Magazine mag = Magazine.Cast(this);
11724 if (mag)
11725 {
11726 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11727 return false;
11728
11729 if (stack_max_limit)
11730 {
11731 Magazine other_mag = Magazine.Cast(other_item);
11732 if (other_item)
11733 {
11734 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11735 return false;
11736 }
11737
11738 }
11739 }
11740 else
11741 {
11742
11744 return false;
11745
11747 return false;
11748 }
11749
11750 PlayerBase player = null;
11751 if (CastTo(player, GetHierarchyRootPlayer()))
11752 {
11753 if (player.GetInventory().HasAttachment(this))
11754 return false;
11755
11756 if (player.IsItemsToDelete())
11757 return false;
11758 }
11759
11760 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11761 return false;
11762
11763 int slotID;
11765 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11766 return false;
11767
11768 return true;
11769 }
11770
11772 {
11774 }
11775
11777 {
11778 return m_IsResultOfSplit;
11779 }
11780
11782 {
11783 m_IsResultOfSplit = value;
11784 }
11785
11787 {
11789 }
11790
11792 {
11793 float other_item_quantity = other_item.GetQuantity();
11794 float this_free_space;
11795
11797
11799
11800 if (other_item_quantity > this_free_space)
11801 {
11802 return this_free_space;
11803 }
11804 else
11805 {
11806 return other_item_quantity;
11807 }
11808 }
11809
11811 {
11813 }
11814
11816 {
11818 return;
11819
11820 if (!IsMagazine() && other_item)
11821 {
11823 if (quantity_used != 0)
11824 {
11825 float hp1 = GetHealth01("","");
11826 float hp2 = other_item.GetHealth01("","");
11827 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11828 hpResult = hpResult / (
GetQuantity() + quantity_used);
11829
11830 hpResult *= GetMaxHealth();
11831 Math.Round(hpResult);
11832 SetHealth("", "Health", hpResult);
11833
11835 other_item.AddQuantity(-quantity_used);
11836 }
11837 }
11839 }
11840
11842 {
11843 #ifdef SERVER
11844 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11845 GetHierarchyParent().IncreaseLifetimeUp();
11846 #endif
11847 };
11848
11850 {
11851 PlayerBase p = PlayerBase.Cast(player);
11852
11853 array<int> recipesIds = p.m_Recipes;
11854 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11855 if (moduleRecipesManager)
11856 {
11857 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11858 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11859 }
11860
11861 for (int i = 0;i < recipesIds.Count(); i++)
11862 {
11863 int key = recipesIds.Get(i);
11864 string recipeName = moduleRecipesManager.GetRecipeName(key);
11866 }
11867 }
11868
11869
11870 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11871 {
11872 super.GetDebugActions(outputList);
11873
11874
11880
11881
11886
11891
11892
11896
11897
11899 {
11903 }
11904
11907
11908
11912
11914
11915 InventoryLocation loc = new InventoryLocation();
11916 GetInventory().GetCurrentInventoryLocation(loc);
11918 {
11919 if (Gizmo_IsSupported())
11922 }
11923
11925 }
11926
11927
11928
11929
11931 {
11932 super.OnAction(action_id, player, ctx);
11933
11935 {
11936 switch (action_id)
11937 {
11940 return true;
11943 return true;
11944 }
11945 }
11946
11948 {
11949 switch (action_id)
11950 {
11952 Delete();
11953 return true;
11954 }
11955 }
11956
11957 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11958 {
11959 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11960 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11961 PlayerBase p = PlayerBase.Cast(player);
11962 if (
EActions.RECIPES_RANGE_START < 1000)
11963 {
11964 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11965 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11966 }
11967 }
11968 #ifndef SERVER
11969 else if (action_id ==
EActions.WATCH_PLAYER)
11970 {
11971 PluginDeveloper.SetDeveloperItemClientEx(player);
11972 }
11973 #endif
11975 {
11976 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11977 {
11978 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11979 OnDebugButtonPressServer(id + 1);
11980 }
11981
11982 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11983 {
11984 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11986 }
11987
11988 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11989 {
11990 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11992 }
11993
11994 else if (action_id ==
EActions.ADD_QUANTITY)
11995 {
11996 if (IsMagazine())
11997 {
11998 Magazine mag = Magazine.Cast(this);
11999 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12000 }
12001 else
12002 {
12004 }
12005
12006 if (m_EM)
12007 {
12008 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12009 }
12010
12011 }
12012
12013 else if (action_id ==
EActions.REMOVE_QUANTITY)
12014 {
12015 if (IsMagazine())
12016 {
12017 Magazine mag2 = Magazine.Cast(this);
12018 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12019 }
12020 else
12021 {
12023 }
12024 if (m_EM)
12025 {
12026 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12027 }
12028
12029 }
12030
12031 else if (action_id ==
EActions.SET_QUANTITY_0)
12032 {
12034
12035 if (m_EM)
12036 {
12037 m_EM.SetEnergy(0);
12038 }
12039 }
12040
12041 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12042 {
12044
12045 if (m_EM)
12046 {
12047 m_EM.SetEnergy(m_EM.GetEnergyMax());
12048 }
12049 }
12050
12051 else if (action_id ==
EActions.ADD_HEALTH)
12052 {
12053 AddHealth("","",GetMaxHealth("","Health")/5);
12054 }
12055 else if (action_id ==
EActions.REMOVE_HEALTH)
12056 {
12057 AddHealth("","",-GetMaxHealth("","Health")/5);
12058 }
12059 else if (action_id ==
EActions.DESTROY_HEALTH)
12060 {
12061 SetHealth01("","",0);
12062 }
12063 else if (action_id ==
EActions.WATCH_ITEM)
12064 {
12066 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12067 #ifdef DEVELOPER
12068 SetDebugDeveloper_item(this);
12069 #endif
12070 }
12071
12072 else if (action_id ==
EActions.ADD_TEMPERATURE)
12073 {
12074 AddTemperature(20);
12075
12076 }
12077
12078 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12079 {
12080 AddTemperature(-20);
12081
12082 }
12083
12084 else if (action_id ==
EActions.FLIP_FROZEN)
12085 {
12086 SetFrozen(!GetIsFrozen());
12087
12088 }
12089
12090 else if (action_id ==
EActions.ADD_WETNESS)
12091 {
12093
12094 }
12095
12096 else if (action_id ==
EActions.REMOVE_WETNESS)
12097 {
12099
12100 }
12101
12102 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12103 {
12106
12107
12108 }
12109
12110 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12111 {
12114 }
12115
12116 else if (action_id ==
EActions.MAKE_SPECIAL)
12117 {
12118 auto debugParams = DebugSpawnParams.WithPlayer(player);
12119 OnDebugSpawnEx(debugParams);
12120 }
12121
12122 }
12123
12124
12125 return false;
12126 }
12127
12128
12129
12130
12134
12137
12138
12139
12141 {
12142 return false;
12143 }
12144
12145
12147 {
12148 return true;
12149 }
12150
12151
12153 {
12154 return true;
12155 }
12156
12157
12158
12160 {
12161 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12163 }
12164
12167 {
12168 return null;
12169 }
12170
12172 {
12173 return false;
12174 }
12175
12177 {
12178 return false;
12179 }
12180
12184
12185
12187 {
12188 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12189 return module_repairing.CanRepair(this, item_repair_kit);
12190 }
12191
12192
12193 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12194 {
12195 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12196 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12197 }
12198
12199
12201 {
12202
12203
12204
12205
12206
12207
12208
12209
12210 return 1;
12211 }
12212
12213
12214
12216 {
12218 }
12219
12220
12221
12223 {
12225 }
12226
12227
12236 {
12237 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12238
12239 if (player)
12240 {
12241 player.MessageStatus(text);
12242 }
12243 }
12244
12245
12254 {
12255 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12256
12257 if (player)
12258 {
12259 player.MessageAction(text);
12260 }
12261 }
12262
12263
12272 {
12273 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12274
12275 if (player)
12276 {
12277 player.MessageFriendly(text);
12278 }
12279 }
12280
12281
12290 {
12291 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12292
12293 if (player)
12294 {
12295 player.MessageImportant(text);
12296 }
12297 }
12298
12300 {
12301 return true;
12302 }
12303
12304
12305 override bool KindOf(
string tag)
12306 {
12307 bool found = false;
12308 string item_name = this.
GetType();
12311
12312 int array_size = item_tag_array.Count();
12313 for (int i = 0; i < array_size; i++)
12314 {
12315 if (item_tag_array.Get(i) == tag)
12316 {
12317 found = true;
12318 break;
12319 }
12320 }
12321 return found;
12322 }
12323
12324
12326 {
12327
12328 super.OnRPC(sender, rpc_type,ctx);
12329
12330
12331 switch (rpc_type)
12332 {
12333 #ifndef SERVER
12334 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12335 Param2<bool, string> p = new Param2<bool, string>(false, "");
12336
12338 return;
12339
12340 bool play = p.param1;
12341 string soundSet = p.param2;
12342
12343 if (play)
12344 {
12346 {
12348 {
12350 }
12351 }
12352 else
12353 {
12355 }
12356 }
12357 else
12358 {
12360 }
12361
12362 break;
12363 #endif
12364
12365 }
12366
12368 {
12370 }
12371 }
12372
12373
12374
12375
12377 {
12378 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12379 return plugin.GetID(
name);
12380 }
12381
12383 {
12384 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12385 return plugin.GetName(id);
12386 }
12387
12390 {
12391
12392
12393 int varFlags;
12394 if (!ctx.
Read(varFlags))
12395 return;
12396
12397 if (varFlags & ItemVariableFlags.FLOAT)
12398 {
12400 }
12401 }
12402
12404 {
12405
12406 super.SerializeNumericalVars(floats_out);
12407
12408
12409
12411 {
12413 }
12414
12416 {
12418 }
12419
12421 {
12423 }
12424
12426 {
12431 }
12432
12434 {
12436 }
12437 }
12438
12440 {
12441
12442 super.DeSerializeNumericalVars(floats);
12443
12444
12445 int index = 0;
12446 int mask = Math.Round(floats.Get(index));
12447
12448 index++;
12449
12451 {
12453 {
12455 }
12456 else
12457 {
12458 float quantity = floats.Get(index);
12459 SetQuantity(quantity,
true,
false,
false,
false);
12460 }
12461 index++;
12462 }
12463
12465 {
12466 float wet = floats.Get(index);
12468 index++;
12469 }
12470
12472 {
12473 int liquidtype = Math.Round(floats.Get(index));
12475 index++;
12476 }
12477
12479 {
12481 index++;
12483 index++;
12485 index++;
12487 index++;
12488 }
12489
12491 {
12492 int cleanness = Math.Round(floats.Get(index));
12494 index++;
12495 }
12496 }
12497
12499 {
12500 super.WriteVarsToCTX(ctx);
12501
12502
12504 {
12506 }
12507
12509 {
12511 }
12512
12514 {
12516 }
12517
12519 {
12520 int r,g,b,a;
12526 }
12527
12529 {
12531 }
12532 }
12533
12535 {
12536 if (!super.ReadVarsFromCTX(ctx,version))
12537 return false;
12538
12539 int intValue;
12540 float value;
12541
12542 if (version < 140)
12543 {
12544 if (!ctx.
Read(intValue))
12545 return false;
12546
12547 m_VariablesMask = intValue;
12548 }
12549
12551 {
12552 if (!ctx.
Read(value))
12553 return false;
12554
12556 {
12558 }
12559 else
12560 {
12562 }
12563 }
12564
12565 if (version < 140)
12566 {
12568 {
12569 if (!ctx.
Read(value))
12570 return false;
12571 SetTemperatureDirect(value);
12572 }
12573 }
12574
12576 {
12577 if (!ctx.
Read(value))
12578 return false;
12580 }
12581
12583 {
12584 if (!ctx.
Read(intValue))
12585 return false;
12587 }
12588
12590 {
12591 int r,g,b,a;
12593 return false;
12595 return false;
12597 return false;
12599 return false;
12600
12602 }
12603
12605 {
12606 if (!ctx.
Read(intValue))
12607 return false;
12609 }
12610
12611 if (version >= 138 && version < 140)
12612 {
12614 {
12615 if (!ctx.
Read(intValue))
12616 return false;
12617 SetFrozen(intValue);
12618 }
12619 }
12620
12621 return true;
12622 }
12623
12624
12626 {
12629 {
12631 }
12632
12633 if (!super.OnStoreLoad(ctx, version))
12634 {
12636 return false;
12637 }
12638
12639 if (version >= 114)
12640 {
12641 bool hasQuickBarIndexSaved;
12642
12643 if (!ctx.
Read(hasQuickBarIndexSaved))
12644 {
12646 return false;
12647 }
12648
12649 if (hasQuickBarIndexSaved)
12650 {
12651 int itmQBIndex;
12652
12653
12654 if (!ctx.
Read(itmQBIndex))
12655 {
12657 return false;
12658 }
12659
12660 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12661 if (itmQBIndex != -1 && parentPlayer)
12662 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12663 }
12664 }
12665 else
12666 {
12667
12668 PlayerBase player;
12669 int itemQBIndex;
12670 if (version ==
int.
MAX)
12671 {
12672 if (!ctx.
Read(itemQBIndex))
12673 {
12675 return false;
12676 }
12677 }
12678 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12679 {
12680
12681 if (!ctx.
Read(itemQBIndex))
12682 {
12684 return false;
12685 }
12686 if (itemQBIndex != -1 && player)
12687 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12688 }
12689 }
12690
12691 if (version < 140)
12692 {
12693
12694 if (!LoadVariables(ctx, version))
12695 {
12697 return false;
12698 }
12699 }
12700
12701
12703 {
12705 return false;
12706 }
12707 if (version >= 132)
12708 {
12710 if (raib)
12711 {
12713 {
12715 return false;
12716 }
12717 }
12718 }
12719
12721 return true;
12722 }
12723
12724
12725
12727 {
12728 super.OnStoreSave(ctx);
12729
12730 PlayerBase player;
12731 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12732 {
12734
12735 int itemQBIndex = -1;
12736 itemQBIndex = player.FindQuickBarEntityIndex(this);
12737 ctx.
Write(itemQBIndex);
12738 }
12739 else
12740 {
12742 }
12743
12745
12747 if (raib)
12748 {
12750 }
12751 }
12752
12753
12755 {
12756 super.AfterStoreLoad();
12757
12759 {
12761 }
12762
12764 {
12767 }
12768 }
12769
12771 {
12772 super.EEOnAfterLoad();
12773
12775 {
12777 }
12778
12781 }
12782
12784 {
12785 return false;
12786 }
12787
12788
12789
12791 {
12793 {
12794 #ifdef PLATFORM_CONSOLE
12795
12797 {
12799 if (menu)
12800 {
12802 }
12803 }
12804 #endif
12805 }
12806
12808 {
12811 }
12812
12814 {
12815 SetWeightDirty();
12817 }
12819 {
12822 }
12823
12825 {
12828 }
12830 {
12833 }
12834
12835 super.OnVariablesSynchronized();
12836 }
12837
12838
12839
12841 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12842 {
12843 if (!IsServerCheck(allow_client))
12844 return false;
12845
12847 return false;
12848
12851
12852 if (value <= (min + 0.001))
12853 value = min;
12854
12855 if (value == min)
12856 {
12857 if (destroy_config)
12858 {
12859 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12860 if (dstr)
12861 {
12863 this.Delete();
12864 return true;
12865 }
12866 }
12867 else if (destroy_forced)
12868 {
12870 this.Delete();
12871 return true;
12872 }
12873
12875 }
12876
12879
12881 {
12883
12884 if (delta)
12886 }
12887
12889
12890 return false;
12891 }
12892
12893
12895 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12896 {
12898 }
12899
12901 {
12904 }
12905
12907 {
12910 }
12911
12913 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12914 {
12915 float value_clamped = Math.Clamp(value, 0, 1);
12917 SetQuantity(result, destroy_config, destroy_forced);
12918 }
12919
12920
12923 {
12925 }
12926
12928 {
12930 }
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12942 {
12943 int slot = -1;
12944 if (GetInventory())
12945 {
12946 InventoryLocation il = new InventoryLocation;
12947 GetInventory().GetCurrentInventoryLocation(il);
12949 }
12950
12952 }
12953
12955 {
12956 float quantity_max = 0;
12957
12959 {
12960 if (attSlotID != -1)
12961 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12962
12963 if (quantity_max <= 0)
12965 }
12966
12967 if (quantity_max <= 0)
12969
12970 return quantity_max;
12971 }
12972
12974 {
12976 }
12977
12979 {
12981 }
12982
12983
12985 {
12987 }
12988
12990 {
12992 }
12993
12995 {
12997 }
12998
12999
13001 {
13002
13003 float weightEx = GetWeightEx();
13004 float special = GetInventoryAndCargoWeight();
13005 return weightEx - special;
13006 }
13007
13008
13010 {
13012 }
13013
13015 {
13017 {
13018 #ifdef DEVELOPER
13019 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13020 {
13021 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13023 }
13024 #endif
13025
13026 return GetQuantity() * GetConfigWeightModified();
13027 }
13028 else if (HasEnergyManager())
13029 {
13030 #ifdef DEVELOPER
13031 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13032 {
13033 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13034 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13035 }
13036 #endif
13037 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13038 }
13039 else
13040 {
13041 #ifdef DEVELOPER
13042 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13043 {
13044 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13045 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13046 }
13047 #endif
13048 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13049 }
13050 }
13051
13054 {
13055 int item_count = 0;
13057
13058 if (GetInventory().GetCargo() != NULL)
13059 {
13060 item_count = GetInventory().GetCargo().GetItemCount();
13061 }
13062
13063 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13064 {
13065 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13066 if (item)
13067 item_count += item.GetNumberOfItems();
13068 }
13069 return item_count;
13070 }
13071
13074 {
13075 float weight = 0;
13076 float wetness = 1;
13077 if (include_wetness)
13080 {
13081 weight = wetness * m_ConfigWeight;
13082 }
13084 {
13085 weight = 1;
13086 }
13087 return weight;
13088 }
13089
13090
13091
13093 {
13094 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13095 {
13096 GameInventory inv = GetInventory();
13097 array<EntityAI> items = new array<EntityAI>;
13099 for (int i = 0; i < items.Count(); i++)
13100 {
13102 if (item)
13103 {
13105 }
13106 }
13107 }
13108 }
13109
13110
13111
13112
13114 {
13115 float energy = 0;
13116 if (HasEnergyManager())
13117 {
13118 energy = GetCompEM().GetEnergy();
13119 }
13120 return energy;
13121 }
13122
13123
13125 {
13126 super.OnEnergyConsumed();
13127
13129 }
13130
13132 {
13133 super.OnEnergyAdded();
13134
13136 }
13137
13138
13140 {
13141 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13142 {
13144 {
13145 float energy_0to1 = GetCompEM().GetEnergy0To1();
13147 }
13148 }
13149 }
13150
13151
13153 {
13154 return ConfigGetFloat("heatIsolation");
13155 }
13156
13158 {
13160 }
13161
13163 {
13164 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13165 if (
GetGame().ConfigIsExisting(paramPath))
13167
13168 return 0.0;
13169 }
13170
13172 {
13173 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13174 if (
GetGame().ConfigIsExisting(paramPath))
13176
13177 return 0.0;
13178 }
13179
13180 override void SetWet(
float value,
bool allow_client =
false)
13181 {
13182 if (!IsServerCheck(allow_client))
13183 return;
13184
13187
13189
13190 m_VarWet = Math.Clamp(value, min, max);
13191
13193 {
13196 }
13197 }
13198
13199 override void AddWet(
float value)
13200 {
13202 }
13203
13205 {
13207 }
13208
13210 {
13212 }
13213
13215 {
13217 }
13218
13220 {
13222 }
13223
13225 {
13227 }
13228
13229 override void OnWetChanged(
float newVal,
float oldVal)
13230 {
13233 if (newLevel != oldLevel)
13234 {
13236 }
13237 }
13238
13240 {
13241 SetWeightDirty();
13242 }
13243
13245 {
13246 return GetWetLevelInternal(
m_VarWet);
13247 }
13248
13249
13250
13252 {
13254 }
13255
13257 {
13259 }
13260
13262 {
13264 }
13265
13267 {
13269 }
13270
13271
13272
13274 {
13275 if (ConfigIsExisting("itemModelLength"))
13276 {
13277 return ConfigGetFloat("itemModelLength");
13278 }
13279 return 0;
13280 }
13281
13283 {
13284 if (ConfigIsExisting("itemAttachOffset"))
13285 {
13286 return ConfigGetFloat("itemAttachOffset");
13287 }
13288 return 0;
13289 }
13290
13291 override void SetCleanness(
int value,
bool allow_client =
false)
13292 {
13293 if (!IsServerCheck(allow_client))
13294 return;
13295
13297
13299
13302 }
13303
13305 {
13307 }
13308
13310 {
13311 return true;
13312 }
13313
13314
13315
13316
13318 {
13320 }
13321
13323 {
13325 }
13326
13327
13328
13329
13330 override void SetColor(
int r,
int g,
int b,
int a)
13331 {
13337 }
13339 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13340 {
13345 }
13346
13348 {
13350 }
13351
13354 {
13355 int r,g,b,a;
13357 r = r/255;
13358 g = g/255;
13359 b = b/255;
13360 a = a/255;
13361 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13362 }
13363
13364
13365
13366 override void SetLiquidType(
int value,
bool allow_client =
false)
13367 {
13368 if (!IsServerCheck(allow_client))
13369 return;
13370
13375 }
13376
13378 {
13379 return ConfigGetInt("varLiquidTypeInit");
13380 }
13381
13383 {
13385 }
13386
13388 {
13390 SetFrozen(false);
13391 }
13392
13395 {
13396 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13397 }
13398
13399
13402 {
13403 PlayerBase nplayer;
13404 if (PlayerBase.CastTo(nplayer, player))
13405 {
13407
13408 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13409 }
13410 }
13411
13412
13415 {
13416 PlayerBase nplayer;
13417 if (PlayerBase.CastTo(nplayer,player))
13418 {
13419
13420 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13421
13422 }
13423
13424
13425 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13426
13427
13428 if (HasEnergyManager())
13429 {
13430 GetCompEM().UpdatePlugState();
13431 }
13432 }
13433
13434
13436 {
13437 super.OnPlacementStarted(player);
13438
13440 }
13441
13442 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13443 {
13445 {
13446 m_AdminLog.OnPlacementComplete(player,
this);
13447 }
13448
13449 super.OnPlacementComplete(player, position, orientation);
13450 }
13451
13452
13453
13454
13455
13457 {
13459 {
13460 return true;
13461 }
13462 else
13463 {
13464 return false;
13465 }
13466 }
13467
13468
13470 {
13472 {
13474 }
13475 }
13476
13477
13479 {
13481 }
13482
13484 {
13486 }
13487
13488 override void InsertAgent(
int agent,
float count = 1)
13489 {
13490 if (count < 1)
13491 return;
13492
13494 }
13495
13498 {
13500 }
13501
13502
13504 {
13506 }
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13550 {
13552 return false;
13553 return true;
13554 }
13555
13557 {
13558
13560 }
13561
13562
13565 {
13566 super.CheckForRoofLimited(timeTresholdMS);
13567
13569 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13570 {
13571 m_PreviousRoofTestTime = time;
13572 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13573 }
13574 }
13575
13576
13578 {
13580 {
13581 return 0;
13582 }
13583
13584 if (GetInventory().GetAttachmentSlotsCount() != 0)
13585 {
13586 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13587 if (filter)
13588 return filter.GetProtectionLevel(type, false, system);
13589 else
13590 return 0;
13591 }
13592
13593 string subclassPath, entryName;
13594
13595 switch (type)
13596 {
13598 entryName = "biological";
13599 break;
13601 entryName = "chemical";
13602 break;
13603 default:
13604 entryName = "biological";
13605 break;
13606 }
13607
13608 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13609
13611 }
13612
13613
13614
13617 {
13618 if (!IsMagazine())
13620
13622 }
13623
13624
13625
13626
13627
13632 {
13633 return true;
13634 }
13635
13637 {
13639 }
13640
13641
13642
13643
13644
13646 {
13647 if (parent)
13648 {
13649 if (parent.IsInherited(DayZInfected))
13650 return true;
13651
13652 if (!parent.IsRuined())
13653 return true;
13654 }
13655
13656 return true;
13657 }
13658
13660 {
13661 if (!super.CanPutAsAttachment(parent))
13662 {
13663 return false;
13664 }
13665
13666 if (!IsRuined() && !parent.IsRuined())
13667 {
13668 return true;
13669 }
13670
13671 return false;
13672 }
13673
13675 {
13676
13677
13678
13679
13680 return super.CanReceiveItemIntoCargo(item);
13681 }
13682
13684 {
13685
13686
13687
13688
13689 GameInventory attachmentInv = attachment.GetInventory();
13691 {
13692 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13693 return false;
13694 }
13695
13696 InventoryLocation loc = new InventoryLocation();
13697 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13698 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13699 return false;
13700
13701 return super.CanReceiveAttachment(attachment, slotId);
13702 }
13703
13705 {
13706 if (!super.CanReleaseAttachment(attachment))
13707 return false;
13708
13709 return GetInventory().AreChildrenAccessible();
13710 }
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13733 {
13734 int id = muzzle_owner.GetMuzzleID();
13735 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13736
13737 if (WPOF_array)
13738 {
13739 for (int i = 0; i < WPOF_array.Count(); i++)
13740 {
13741 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13742
13743 if (WPOF)
13744 {
13745 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13746 }
13747 }
13748 }
13749 }
13750
13751
13753 {
13754 int id = muzzle_owner.GetMuzzleID();
13756
13757 if (WPOBE_array)
13758 {
13759 for (int i = 0; i < WPOBE_array.Count(); i++)
13760 {
13761 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13762
13763 if (WPOBE)
13764 {
13765 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13766 }
13767 }
13768 }
13769 }
13770
13771
13773 {
13774 int id = muzzle_owner.GetMuzzleID();
13775 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13776
13777 if (WPOOH_array)
13778 {
13779 for (int i = 0; i < WPOOH_array.Count(); i++)
13780 {
13781 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13782
13783 if (WPOOH)
13784 {
13785 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13786 }
13787 }
13788 }
13789 }
13790
13791
13793 {
13794 int id = muzzle_owner.GetMuzzleID();
13795 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13796
13797 if (WPOOH_array)
13798 {
13799 for (int i = 0; i < WPOOH_array.Count(); i++)
13800 {
13801 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13802
13803 if (WPOOH)
13804 {
13805 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13806 }
13807 }
13808 }
13809 }
13810
13811
13813 {
13814 int id = muzzle_owner.GetMuzzleID();
13815 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13816
13817 if (WPOOH_array)
13818 {
13819 for (int i = 0; i < WPOOH_array.Count(); i++)
13820 {
13821 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13822
13823 if (WPOOH)
13824 {
13825 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13826 }
13827 }
13828 }
13829 }
13830
13831
13832
13834 {
13836 {
13837 return true;
13838 }
13839
13840 return false;
13841 }
13842
13844 {
13846 {
13847 return true;
13848 }
13849
13850 return false;
13851 }
13852
13854 {
13856 {
13857 return true;
13858 }
13859
13860 return false;
13861 }
13862
13864 {
13865 return false;
13866 }
13867
13870 {
13871 return UATimeSpent.DEFAULT_DEPLOY;
13872 }
13873
13874
13875
13876
13878 {
13880 SetSynchDirty();
13881 }
13882
13884 {
13886 }
13887
13888
13890 {
13891 return false;
13892 }
13893
13896 {
13897 string att_type = "None";
13898
13899 if (ConfigIsExisting("soundAttType"))
13900 {
13901 att_type = ConfigGetString("soundAttType");
13902 }
13903
13905 }
13906
13908 {
13910 }
13911
13912
13913
13914
13915
13921
13923 {
13926
13928 }
13929
13930
13932 {
13934 return;
13935
13937
13940
13943
13944 SoundParameters params = new SoundParameters();
13948 }
13949
13950
13952 {
13954 return;
13955
13957 SetSynchDirty();
13958
13961 }
13962
13963
13965 {
13967 return;
13968
13970 SetSynchDirty();
13971
13974 }
13975
13977 {
13979 }
13980
13982 {
13984 }
13985
13988 {
13989 if (!
GetGame().IsDedicatedServer())
13990 {
13991 if (ConfigIsExisting("attachSoundSet"))
13992 {
13993 string cfg_path = "";
13994 string soundset = "";
13995 string type_name =
GetType();
13996
13999 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14000 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14001
14002 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14003 {
14004 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14005 {
14006 if (cfg_slot_array[i] == slot_type)
14007 {
14008 soundset = cfg_soundset_array[i];
14009 break;
14010 }
14011 }
14012 }
14013
14014 if (soundset != "")
14015 {
14016 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14018 }
14019 }
14020 }
14021 }
14022
14024 {
14025
14026 }
14027
14028 void OnApply(PlayerBase player);
14029
14031 {
14032 return 1.0;
14033 };
14034
14036 {
14038 }
14039
14041 {
14043 }
14044
14046
14048 {
14049 SetDynamicPhysicsLifeTime(0.01);
14051 }
14052
14054 {
14055 array<string> zone_names = new array<string>;
14056 GetDamageZones(zone_names);
14057 for (int i = 0; i < zone_names.Count(); i++)
14058 {
14059 SetHealthMax(zone_names.Get(i),"Health");
14060 }
14061 SetHealthMax("","Health");
14062 }
14063
14066 {
14067 float global_health = GetHealth01("","Health");
14068 array<string> zones = new array<string>;
14069 GetDamageZones(zones);
14070
14071 for (int i = 0; i < zones.Count(); i++)
14072 {
14073 SetHealth01(zones.Get(i),"Health",global_health);
14074 }
14075 }
14076
14079 {
14080 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14081 }
14082
14084 {
14085 if (!hasRootAsPlayer)
14086 {
14087 if (refParentIB)
14088 {
14089
14090 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14091 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14092
14093 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14094 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14095
14098 }
14099 else
14100 {
14101
14104 }
14105 }
14106 }
14107
14109 {
14111 {
14112 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14113 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14114 {
14115 float heatPermCoef = 1.0;
14117 while (ent)
14118 {
14119 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14120 ent = ent.GetHierarchyParent();
14121 }
14122
14123 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14124 }
14125 }
14126 }
14127
14129 {
14130
14131 EntityAI parent = GetHierarchyParent();
14132 if (!parent)
14133 {
14134 hasParent = false;
14135 hasRootAsPlayer = false;
14136 }
14137 else
14138 {
14139 hasParent = true;
14140 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14141 refParentIB =
ItemBase.Cast(parent);
14142 }
14143 }
14144
14145 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14146 {
14147
14148 }
14149
14151 {
14152
14153 return false;
14154 }
14155
14157 {
14158
14159
14160 return false;
14161 }
14162
14164 {
14165
14166 return false;
14167 }
14168
14171 {
14172 return !GetIsFrozen() &&
IsOpen();
14173 }
14174
14176 {
14177 bool hasParent = false, hasRootAsPlayer = false;
14179
14180 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14181 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14182
14183 if (wwtu || foodDecay)
14184 {
14188
14189 if (processWetness || processTemperature || processDecay)
14190 {
14192
14193 if (processWetness)
14194 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14195
14196 if (processTemperature)
14198
14199 if (processDecay)
14200 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14201 }
14202 }
14203 }
14204
14207 {
14209 }
14210
14212 {
14215
14216 return super.GetTemperatureFreezeThreshold();
14217 }
14218
14220 {
14223
14224 return super.GetTemperatureThawThreshold();
14225 }
14226
14228 {
14231
14232 return super.GetItemOverheatThreshold();
14233 }
14234
14236 {
14238 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14239
14240 return super.GetTemperatureFreezeTime();
14241 }
14242
14244 {
14246 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14247
14248 return super.GetTemperatureThawTime();
14249 }
14250
14255
14257 {
14258 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14259 }
14260
14262 {
14263 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14264 }
14265
14268 {
14270 }
14271
14273 {
14275 }
14276
14278 {
14280 }
14281
14284 {
14285 return null;
14286 }
14287
14290 {
14291 return false;
14292 }
14293
14295 {
14297 {
14300 if (!trg)
14301 {
14303 explosive = this;
14304 }
14305
14306 explosive.PairRemote(trg);
14308
14309 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14310 trg.SetPersistentPairID(persistentID);
14311 explosive.SetPersistentPairID(persistentID);
14312
14313 return true;
14314 }
14315 return false;
14316 }
14317
14320 {
14321 float ret = 1.0;
14324 ret *= GetHealth01();
14325
14326 return ret;
14327 }
14328
14329 #ifdef DEVELOPER
14330 override void SetDebugItem()
14331 {
14332 super.SetDebugItem();
14333 _itemBase = this;
14334 }
14335
14337 {
14338 string text = super.GetDebugText();
14339
14341 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14342
14343 return text;
14344 }
14345 #endif
14346
14348 {
14349 return true;
14350 }
14351
14353
14355
14357 {
14360 }
14361
14362
14370
14386}
14387
14389{
14391 if (entity)
14392 {
14393 bool is_item = entity.IsInherited(
ItemBase);
14394 if (is_item && full_quantity)
14395 {
14398 }
14399 }
14400 else
14401 {
14403 return NULL;
14404 }
14405 return entity;
14406}
14407
14409{
14410 if (item)
14411 {
14412 if (health > 0)
14413 item.SetHealth("", "", health);
14414
14415 if (item.CanHaveTemperature())
14416 {
14418 if (item.CanFreeze())
14419 item.SetFrozen(false);
14420 }
14421
14422 if (item.HasEnergyManager())
14423 {
14424 if (quantity >= 0)
14425 {
14426 item.GetCompEM().SetEnergy0To1(quantity);
14427 }
14428 else
14429 {
14431 }
14432 }
14433 else if (item.IsMagazine())
14434 {
14435 Magazine mag = Magazine.Cast(item);
14436 if (quantity >= 0)
14437 {
14438 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14439 }
14440 else
14441 {
14443 }
14444
14445 }
14446 else
14447 {
14448 if (quantity >= 0)
14449 {
14450 item.SetQuantityNormalized(quantity, false);
14451 }
14452 else
14453 {
14455 }
14456
14457 }
14458 }
14459}
14460
14461#ifdef DEVELOPER
14463#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.