9428{
9430 {
9431 return true;
9432 }
9433};
9434
9435
9436
9438{
9442
9444
9447
9448
9449
9450
9451
9460
9466
9471
9476
9497 protected bool m_IsResultOfSplit
9498
9500
9505
9506
9507
9509
9513
9514
9515
9517
9520
9521
9522
9528
9529
9537
9540
9541
9543
9544
9546
9547
9552
9553
9558
9559
9561
9562
9564 {
9569
9570 if (!
GetGame().IsDedicatedServer())
9571 {
9573 {
9575
9577 {
9579 }
9580 }
9581
9584 }
9585
9586 m_OldLocation = null;
9587
9589 {
9591 }
9592
9593 if (ConfigIsExisting("headSelectionsToHide"))
9594 {
9597 }
9598
9600 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9601 {
9603 }
9604
9606
9607 m_IsResultOfSplit = false;
9608
9610 }
9611
9613 {
9614 super.InitItemVariables();
9615
9621 m_Count = ConfigGetInt(
"count");
9622
9625
9630
9633
9638
9650
9654
9655
9658 if (ConfigIsExisting("canBeSplit"))
9659 {
9662 }
9663
9665 if (ConfigIsExisting("itemBehaviour"))
9667
9668
9671 RegisterNetSyncVariableInt("m_VarLiquidType");
9672 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9673
9674 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9675 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9676 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9677
9678 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9679 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9680 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9681 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9682
9683 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9684 RegisterNetSyncVariableBool("m_IsTakeable");
9685 RegisterNetSyncVariableBool("m_IsHologram");
9686
9689 {
9692 }
9693
9695
9697 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9699
9700 }
9701
9703 {
9705 }
9706
9708 {
9711 {
9716 }
9717 }
9718
9719 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9720 {
9722 {
9725 }
9726
9728 }
9729
9731 {
9737 }
9738
9740
9742 {
9744
9745 if (!action)
9746 {
9747 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9748 return;
9749 }
9750
9752 if (!ai)
9753 {
9755 return;
9756 }
9757
9759 if (!action_array)
9760 {
9761 action_array = new array<ActionBase_Basic>;
9763 }
9764 if (LogManager.IsActionLogEnable())
9765 {
9766 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9767 }
9768
9769 if (action_array.Find(action) != -1)
9770 {
9771 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9772 }
9773 else
9774 {
9775 action_array.Insert(action);
9776 }
9777 }
9778
9780 {
9782 ActionBase action = player.GetActionManager().GetAction(actionName);
9785
9786 if (action_array)
9787 {
9788 action_array.RemoveItem(action);
9789 }
9790 }
9791
9792
9793
9795 {
9796 ActionOverrideData overrideData = new ActionOverrideData();
9800
9802 if (!actionMap)
9803 {
9806 }
9807
9808 actionMap.Insert(this.
Type(), overrideData);
9809
9810 }
9811
9813
9815
9816
9818 {
9821
9824
9825 string config_to_search = "CfgVehicles";
9826 string muzzle_owner_config;
9827
9829 {
9830 if (IsInherited(Weapon))
9831 config_to_search = "CfgWeapons";
9832
9833 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9834
9835 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9836
9838
9839 if (config_OnFire_subclass_count > 0)
9840 {
9841 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9842
9843 for (int i = 0; i < config_OnFire_subclass_count; i++)
9844 {
9845 string particle_class = "";
9847 string config_OnFire_entry = config_OnFire_class + particle_class;
9848 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9849 WPOF_array.Insert(WPOF);
9850 }
9851
9852
9854 }
9855 }
9856
9858 {
9859 config_to_search = "CfgWeapons";
9860 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9861
9862 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9863
9865
9866 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9867 {
9868 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9869
9870 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9871 {
9872 string particle_class2 = "";
9874 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9875 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9876 WPOBE_array.Insert(WPOBE);
9877 }
9878
9879
9881 }
9882 }
9883 }
9884
9885
9887 {
9890
9892 {
9893 string config_to_search = "CfgVehicles";
9894
9895 if (IsInherited(Weapon))
9896 config_to_search = "CfgWeapons";
9897
9898 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9899 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9900
9901 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9902 {
9903
9905
9907 {
9909 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9911 return;
9912 }
9913
9916
9917
9918
9920 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9921
9922 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9923 {
9924 string particle_class = "";
9926 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9928
9929 if (entry_type == CT_CLASS)
9930 {
9931 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9932 WPOOH_array.Insert(WPOF);
9933 }
9934 }
9935
9936
9938 }
9939 }
9940 }
9941
9943 {
9945 }
9946
9948 {
9950 {
9952
9955
9958
9959 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9960 }
9961 }
9962
9964 {
9966 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9967
9969 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9970
9972 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9973
9975 {
9977 }
9978 }
9979
9981 {
9983 }
9984
9986 {
9989 else
9991
9993 {
9996 }
9997 else
9998 {
10001
10004 }
10005
10007 }
10008
10010 {
10012 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10013 }
10014
10016 {
10018 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10020 }
10021
10023 {
10025 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10026 }
10027
10029 {
10032
10033 OverheatingParticle OP = new OverheatingParticle();
10038
10040 }
10041
10043 {
10046
10047 return -1;
10048 }
10049
10051 {
10053 {
10056
10057 for (int i = count; i > 0; --i)
10058 {
10059 int id = i - 1;
10062
10065
10066 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10067 {
10068 if (p)
10069 {
10072 }
10073 }
10074 }
10075 }
10076 }
10077
10079 {
10081 {
10083 {
10084 int id = i - 1;
10086
10087 if (OP)
10088 {
10090
10091 if (p)
10092 {
10094 }
10095
10096 delete OP;
10097 }
10098 }
10099
10102 }
10103 }
10104
10107 {
10108 return 0.0;
10109 }
10110
10111
10113 {
10114 return 250;
10115 }
10116
10118 {
10119 return 0;
10120 }
10121
10124 {
10126 return true;
10127
10128 return false;
10129 }
10130
10133 {
10136
10138 {
10140 }
10141 else
10142 {
10143
10145 }
10146
10148 }
10149
10156 {
10157 return -1;
10158 }
10159
10160
10161
10162
10164 {
10166 {
10168 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10169
10170 if (r_index >= 0)
10171 {
10172 InventoryLocation r_il = new InventoryLocation;
10173 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10174
10175 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10178 {
10179 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10180 }
10182 {
10183 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10184 }
10185
10186 }
10187
10188 player.GetHumanInventory().ClearUserReservedLocation(this);
10189 }
10190
10193 }
10194
10195
10196
10197
10199 {
10200 return ItemBase.m_DebugActionsMask;
10201 }
10202
10204 {
10205 return ItemBase.m_DebugActionsMask & mask;
10206 }
10207
10209 {
10210 ItemBase.m_DebugActionsMask = mask;
10211 }
10212
10214 {
10215 ItemBase.m_DebugActionsMask |= mask;
10216 }
10217
10219 {
10220 ItemBase.m_DebugActionsMask &= ~mask;
10221 }
10222
10224 {
10226 {
10228 }
10229 else
10230 {
10232 }
10233 }
10234
10235
10237 {
10238 if (GetEconomyProfile())
10239 {
10240 float q_max = GetEconomyProfile().GetQuantityMax();
10241 if (q_max > 0)
10242 {
10243 float q_min = GetEconomyProfile().GetQuantityMin();
10244 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10245
10247 {
10248 ComponentEnergyManager comp = GetCompEM();
10250 {
10252 }
10253 }
10255 {
10257
10258 }
10259
10260 }
10261 }
10262 }
10263
10266 {
10267 EntityAI parent = GetHierarchyParent();
10268
10269 if (parent)
10270 {
10271 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10272 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10273 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10274 }
10275 }
10276
10279 {
10280 EntityAI parent = GetHierarchyParent();
10281
10282 if (parent)
10283 {
10284 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10285 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10286 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10287 }
10288 }
10289
10291 {
10292
10293
10294
10295
10297
10299 {
10300 if (ScriptInputUserData.CanStoreInputUserData())
10301 {
10302 ScriptInputUserData ctx = new ScriptInputUserData;
10308 ctx.
Write(use_stack_max);
10311
10313 {
10314 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10315 }
10316 }
10317 }
10318 else if (!
GetGame().IsMultiplayer())
10319 {
10321 }
10322 }
10323
10325 {
10327 }
10328
10330 {
10332 }
10333
10335 {
10337 }
10338
10340 {
10341
10342 return false;
10343 }
10344
10346 {
10347 return false;
10348 }
10349
10353 {
10354 return false;
10355 }
10356
10358 {
10359 return "";
10360 }
10361
10363
10365 {
10366 return false;
10367 }
10368
10370 {
10371 return true;
10372 }
10373
10374
10375
10377 {
10378 return true;
10379 }
10380
10382 {
10383 return true;
10384 }
10385
10387 {
10388 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10390 }
10391
10393 {
10395 }
10396
10398 {
10400 if (!is_being_placed)
10402 SetSynchDirty();
10403 }
10404
10405
10407
10409 {
10411 }
10412
10414 {
10416 }
10417
10419 {
10420 return 1;
10421 }
10422
10424 {
10425 return false;
10426 }
10427
10429 {
10431 SetSynchDirty();
10432 }
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10469 {
10470 super.OnMovedInsideCargo(container);
10471
10472 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10473 }
10474
10475 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10476 {
10477 super.EEItemLocationChanged(oldLoc,newLoc);
10478
10479 PlayerBase new_player = null;
10480 PlayerBase old_player = null;
10481
10482 if (newLoc.GetParent())
10483 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10484
10485 if (oldLoc.GetParent())
10486 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10487
10489 {
10490 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10491
10492 if (r_index >= 0)
10493 {
10494 InventoryLocation r_il = new InventoryLocation;
10495 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10496
10497 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10500 {
10501 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10502 }
10504 {
10505 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10506 }
10507
10508 }
10509 }
10510
10512 {
10513 if (new_player)
10514 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10515
10516 if (new_player == old_player)
10517 {
10518
10519 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10520 {
10522 {
10523 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10524 {
10525 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10526 }
10527 }
10528 else
10529 {
10530 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10531 }
10532 }
10533
10534 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10535 {
10536 int type = oldLoc.GetType();
10538 {
10539 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10540 }
10542 {
10543 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10544 }
10545 }
10546 if (!m_OldLocation)
10547 {
10548 m_OldLocation = new InventoryLocation;
10549 }
10550 m_OldLocation.Copy(oldLoc);
10551 }
10552 else
10553 {
10554 if (m_OldLocation)
10555 {
10556 m_OldLocation.Reset();
10557 }
10558 }
10559
10561 }
10562 else
10563 {
10564 if (new_player)
10565 {
10566 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10567 if (res_index >= 0)
10568 {
10569 InventoryLocation il = new InventoryLocation;
10570 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10572 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10575 {
10576 il.
GetParent().GetOnReleaseLock().Invoke(it);
10577 }
10579 {
10581 }
10582
10583 }
10584 }
10586 {
10587
10589 }
10590
10591 if (m_OldLocation)
10592 {
10593 m_OldLocation.Reset();
10594 }
10595 }
10596 }
10597
10598 override void EOnContact(IEntity other, Contact extra)
10599 {
10601 {
10602 int liquidType = -1;
10604 if (impactSpeed > 0.0)
10605 {
10607 #ifndef SERVER
10609 #else
10611 SetSynchDirty();
10612 #endif
10614 }
10615 }
10616
10617 #ifdef SERVER
10618 if (GetCompEM() && GetCompEM().IsPlugged())
10619 {
10620 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10621 GetCompEM().UnplugThis();
10622 }
10623 #endif
10624 }
10625
10627
10629 {
10631 }
10632
10634 {
10635
10636 }
10637
10639 {
10640 super.OnItemLocationChanged(old_owner, new_owner);
10641
10642 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10643 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10644
10645 if (!relatedPlayer && playerNew)
10646 relatedPlayer = playerNew;
10647
10648 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10649 {
10651 if (actionMgr)
10652 {
10653 ActionBase currentAction = actionMgr.GetRunningAction();
10654 if (currentAction)
10656 }
10657 }
10658
10659 Man ownerPlayerOld = null;
10660 Man ownerPlayerNew = null;
10661
10662 if (old_owner)
10663 {
10664 if (old_owner.
IsMan())
10665 {
10666 ownerPlayerOld = Man.Cast(old_owner);
10667 }
10668 else
10669 {
10670 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10671 }
10672 }
10673 else
10674 {
10676 {
10678
10679 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10680 {
10681 GetCompEM().UnplugThis();
10682 }
10683 }
10684 }
10685
10686 if (new_owner)
10687 {
10688 if (new_owner.
IsMan())
10689 {
10690 ownerPlayerNew = Man.Cast(new_owner);
10691 }
10692 else
10693 {
10694 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10695 }
10696 }
10697
10698 if (ownerPlayerOld != ownerPlayerNew)
10699 {
10700 if (ownerPlayerOld)
10701 {
10702 array<EntityAI> subItemsExit = new array<EntityAI>;
10704 for (int i = 0; i < subItemsExit.Count(); i++)
10705 {
10708 }
10709 }
10710
10711 if (ownerPlayerNew)
10712 {
10713 array<EntityAI> subItemsEnter = new array<EntityAI>;
10715 for (int j = 0; j < subItemsEnter.Count(); j++)
10716 {
10719 }
10720 }
10721 }
10722 else if (ownerPlayerNew != null)
10723 {
10724 PlayerBase nplayer;
10725 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10726 {
10727 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10729 for (int k = 0; k < subItemsUpdate.Count(); k++)
10730 {
10732 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10733 }
10734 }
10735 }
10736
10737 if (old_owner)
10738 old_owner.OnChildItemRemoved(this);
10739 if (new_owner)
10740 new_owner.OnChildItemReceived(this);
10741 }
10742
10743
10745 {
10746 super.EEDelete(parent);
10747 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10748 if (player)
10749 {
10751
10752 if (player.IsAlive())
10753 {
10754 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10755 if (r_index >= 0)
10756 {
10757 InventoryLocation r_il = new InventoryLocation;
10758 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10759
10760 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10763 {
10764 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10765 }
10767 {
10768 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10769 }
10770
10771 }
10772
10773 player.RemoveQuickBarEntityShortcut(this);
10774 }
10775 }
10776 }
10777
10779 {
10780 super.EEKilled(killer);
10781
10784 {
10785 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10786 {
10787 if (IsMagazine())
10788 {
10789 if (Magazine.Cast(this).GetAmmoCount() > 0)
10790 {
10792 }
10793 }
10794 else
10795 {
10797 }
10798 }
10799 }
10800 }
10801
10803 {
10804 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10805
10806 super.OnWasAttached(parent, slot_id);
10807
10810
10812 }
10813
10815 {
10816 super.OnWasDetached(parent, slot_id);
10817
10820 }
10821
10823 {
10824 int idx;
10827
10828 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10829 if (inventory_slots.Count() < 1)
10830 {
10831 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10832 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10833 }
10834 else
10835 {
10836 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10837 }
10838
10839 idx = inventory_slots.Find(slot);
10840 if (idx < 0)
10841 return "";
10842
10843 return attach_types.Get(idx);
10844 }
10845
10847 {
10848 int idx = -1;
10849 string slot;
10850
10853
10854 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10855 if (inventory_slots.Count() < 1)
10856 {
10857 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10858 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10859 }
10860 else
10861 {
10862 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10863 if (detach_types.Count() < 1)
10864 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10865 }
10866
10867 for (int i = 0; i < inventory_slots.Count(); i++)
10868 {
10869 slot = inventory_slots.Get(i);
10870 }
10871
10872 if (slot != "")
10873 {
10874 if (detach_types.Count() == 1)
10875 idx = 0;
10876 else
10877 idx = inventory_slots.Find(slot);
10878 }
10879 if (idx < 0)
10880 return "";
10881
10882 return detach_types.Get(idx);
10883 }
10884
10886 {
10887
10889
10890
10891 float min_time = 1;
10892 float max_time = 3;
10893 float delay = Math.RandomFloat(min_time, max_time);
10894
10895 explode_timer.Run(delay, this, "DoAmmoExplosion");
10896 }
10897
10899 {
10900 Magazine magazine = Magazine.Cast(this);
10901 int pop_sounds_count = 6;
10902 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10903
10904
10905 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10906 string sound_name = pop_sounds[ sound_idx ];
10908
10909
10910 magazine.ServerAddAmmoCount(-1);
10911
10912
10913 float min_temp_to_explode = 100;
10914
10915 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10916 {
10918 }
10919 }
10920
10921
10922 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10923 {
10924 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10925
10926 const int CHANCE_DAMAGE_CARGO = 4;
10927 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10928 const int CHANCE_DAMAGE_NOTHING = 2;
10929
10931 {
10932 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10933 int chances;
10934 int rnd;
10935
10936 if (GetInventory().GetCargo())
10937 {
10938 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10939 rnd = Math.RandomInt(0,chances);
10940
10941 if (rnd < CHANCE_DAMAGE_CARGO)
10942 {
10944 }
10945 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10946 {
10948 }
10949 }
10950 else
10951 {
10952 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10953 rnd = Math.RandomInt(0,chances);
10954
10955 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10956 {
10958 }
10959 }
10960 }
10961 }
10962
10964 {
10965 if (GetInventory().GetCargo())
10966 {
10967 int item_count = GetInventory().GetCargo().GetItemCount();
10968 if (item_count > 0)
10969 {
10970 int random_pick = Math.RandomInt(0, item_count);
10972 if (!item.IsExplosive())
10973 {
10974 item.AddHealth("","",damage);
10975 return true;
10976 }
10977 }
10978 }
10979 return false;
10980 }
10981
10983 {
10984 int attachment_count = GetInventory().AttachmentCount();
10985 if (attachment_count > 0)
10986 {
10987 int random_pick = Math.RandomInt(0, attachment_count);
10988 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10989 if (!attachment.IsExplosive())
10990 {
10991 attachment.AddHealth("","",damage);
10992 return true;
10993 }
10994 }
10995 return false;
10996 }
10997
10999 {
11001 }
11002
11004 {
11006 return GetInventory().CanRemoveEntity();
11007
11008 return false;
11009 }
11010
11012 {
11014 return;
11015
11017 {
11018 if (ScriptInputUserData.CanStoreInputUserData())
11019 {
11020 ScriptInputUserData ctx = new ScriptInputUserData;
11025 ctx.
Write(destination_entity);
11027 ctx.
Write(slot_id);
11029 }
11030 }
11031 else if (!
GetGame().IsMultiplayer())
11032 {
11034 }
11035 }
11036
11038 {
11040 return;
11041
11042 float split_quantity_new;
11046 InventoryLocation loc = new InventoryLocation;
11047
11048 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11049 {
11051 split_quantity_new = stack_max;
11052 else
11054
11055 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11056 if (new_item)
11057 {
11058 new_item.SetResultOfSplit(true);
11059 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11061 new_item.SetQuantity(split_quantity_new);
11062 }
11063 }
11064 else if (destination_entity && slot_id == -1)
11065 {
11066 if (quantity > stack_max)
11067 split_quantity_new = stack_max;
11068 else
11069 split_quantity_new = quantity;
11070
11072 {
11075 }
11076
11077 if (new_item)
11078 {
11079 new_item.SetResultOfSplit(true);
11080 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11082 new_item.SetQuantity(split_quantity_new);
11083 }
11084 }
11085 else
11086 {
11087 if (stack_max != 0)
11088 {
11090 {
11092 }
11093
11094 if (split_quantity_new == 0)
11095 {
11096 if (!
GetGame().IsMultiplayer())
11097 player.PhysicalPredictiveDropItem(this);
11098 else
11099 player.ServerDropEntity(this);
11100 return;
11101 }
11102
11104
11105 if (new_item)
11106 {
11107 new_item.SetResultOfSplit(true);
11108 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11110 new_item.SetQuantity(stack_max);
11111 new_item.PlaceOnSurface();
11112 }
11113 }
11114 }
11115 }
11116
11118 {
11120 return;
11121
11122 float split_quantity_new;
11126 InventoryLocation loc = new InventoryLocation;
11127
11128 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11129 {
11131 split_quantity_new = stack_max;
11132 else
11134
11135 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11136 if (new_item)
11137 {
11138 new_item.SetResultOfSplit(true);
11139 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11141 new_item.SetQuantity(split_quantity_new);
11142 }
11143 }
11144 else if (destination_entity && slot_id == -1)
11145 {
11146 if (quantity > stack_max)
11147 split_quantity_new = stack_max;
11148 else
11149 split_quantity_new = quantity;
11150
11152 {
11155 }
11156
11157 if (new_item)
11158 {
11159 new_item.SetResultOfSplit(true);
11160 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11162 new_item.SetQuantity(split_quantity_new);
11163 }
11164 }
11165 else
11166 {
11167 if (stack_max != 0)
11168 {
11170 {
11172 }
11173
11175
11176 if (new_item)
11177 {
11178 new_item.SetResultOfSplit(true);
11179 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11181 new_item.SetQuantity(stack_max);
11182 new_item.PlaceOnSurface();
11183 }
11184 }
11185 }
11186 }
11187
11189 {
11191 return;
11192
11194 {
11195 if (ScriptInputUserData.CanStoreInputUserData())
11196 {
11197 ScriptInputUserData ctx = new ScriptInputUserData;
11202 dst.WriteToContext(ctx);
11204 }
11205 }
11206 else if (!
GetGame().IsMultiplayer())
11207 {
11209 }
11210 }
11211
11213 {
11215 return;
11216
11218 {
11219 if (ScriptInputUserData.CanStoreInputUserData())
11220 {
11221 ScriptInputUserData ctx = new ScriptInputUserData;
11226 ctx.
Write(destination_entity);
11232 }
11233 }
11234 else if (!
GetGame().IsMultiplayer())
11235 {
11237 }
11238 }
11239
11241 {
11243 }
11244
11246 {
11248 return this;
11249
11251 float split_quantity_new;
11253 if (dst.IsValid())
11254 {
11255 int slot_id = dst.GetSlot();
11257
11258 if (quantity > stack_max)
11259 split_quantity_new = stack_max;
11260 else
11261 split_quantity_new = quantity;
11262
11264
11265 if (new_item)
11266 {
11267 new_item.SetResultOfSplit(true);
11268 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11271 }
11272
11273 return new_item;
11274 }
11275
11276 return null;
11277 }
11278
11280 {
11282 return;
11283
11285 float split_quantity_new;
11287 if (destination_entity)
11288 {
11290 if (quantity > stackable)
11291 split_quantity_new = stackable;
11292 else
11293 split_quantity_new = quantity;
11294
11295 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11296 if (new_item)
11297 {
11298 new_item.SetResultOfSplit(true);
11299 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11301 new_item.SetQuantity(split_quantity_new);
11302 }
11303 }
11304 }
11305
11307 {
11309 return;
11310
11312 {
11313 if (ScriptInputUserData.CanStoreInputUserData())
11314 {
11315 ScriptInputUserData ctx = new ScriptInputUserData;
11320 ItemBase destination_entity =
this;
11321 ctx.
Write(destination_entity);
11325 }
11326 }
11327 else if (!
GetGame().IsMultiplayer())
11328 {
11330 }
11331 }
11332
11334 {
11336 return;
11337
11339 float split_quantity_new;
11341 if (player)
11342 {
11344 if (quantity > stackable)
11345 split_quantity_new = stackable;
11346 else
11347 split_quantity_new = quantity;
11348
11349 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11350 new_item =
ItemBase.Cast(in_hands);
11351 if (new_item)
11352 {
11353 new_item.SetResultOfSplit(true);
11354 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11356 new_item.SetQuantity(split_quantity_new);
11357 }
11358 }
11359 }
11360
11362 {
11364 return;
11365
11367 float split_quantity_new = Math.Floor(quantity * 0.5);
11368
11370
11371 if (new_item)
11372 {
11373 if (new_item.GetQuantityMax() < split_quantity_new)
11374 {
11375 split_quantity_new = new_item.GetQuantityMax();
11376 }
11377
11378 new_item.SetResultOfSplit(true);
11379 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11380
11382 {
11385 }
11386 else
11387 {
11390 }
11391 }
11392 }
11393
11395 {
11397 return;
11398
11400 float split_quantity_new = Math.Floor(quantity / 2);
11401
11402 InventoryLocation invloc = new InventoryLocation;
11404
11406 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11407
11408 if (new_item)
11409 {
11410 if (new_item.GetQuantityMax() < split_quantity_new)
11411 {
11412 split_quantity_new = new_item.GetQuantityMax();
11413 }
11415 {
11418 }
11419 else
11420 {
11423 }
11424 }
11425 }
11426
11429 {
11430 SetWeightDirty();
11432
11433 if (parent)
11434 parent.OnAttachmentQuantityChangedEx(this, delta);
11435
11437 {
11439 {
11441 }
11443 {
11444 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11446 }
11447 }
11448
11449 }
11450
11453 {
11454
11455 }
11456
11459 {
11461 }
11462
11464 {
11465 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11466
11468 {
11469 if (newLevel == GameConstants.STATE_RUINED)
11470 {
11472 EntityAI parent = GetHierarchyParent();
11473 if (parent && parent.IsFireplace())
11474 {
11475 CargoBase cargo = GetInventory().GetCargo();
11476 if (cargo)
11477 {
11479 {
11481 }
11482 }
11483 }
11484 }
11485
11487 {
11488
11490 return;
11491 }
11492
11493 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11494 {
11496 }
11497 }
11498 }
11499
11500
11502 {
11503 super.OnRightClick();
11504
11506 {
11508 {
11509 if (ScriptInputUserData.CanStoreInputUserData())
11510 {
11511 vector m4[4];
11513
11514 EntityAI root = GetHierarchyRoot();
11515
11516 InventoryLocation dst = new InventoryLocation;
11518 {
11519 if (root)
11520 {
11521 root.GetTransform(m4);
11523 }
11524 else
11525 GetInventory().GetCurrentInventoryLocation(dst);
11526 }
11527 else
11528 {
11530
11531
11532 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11533 {
11534 if (root)
11535 {
11536 root.GetTransform(m4);
11538 }
11539 else
11540 GetInventory().GetCurrentInventoryLocation(dst);
11541 }
11542 else
11543 {
11544 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11545 }
11546 }
11547
11548 ScriptInputUserData ctx = new ScriptInputUserData;
11556 }
11557 }
11558 else if (!
GetGame().IsMultiplayer())
11559 {
11561 }
11562 }
11563 }
11564
11565 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11566 {
11567
11568 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11569 return false;
11570
11571 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11572 return false;
11573
11574
11576 return false;
11577
11578
11579 Magazine mag = Magazine.Cast(this);
11580 if (mag)
11581 {
11582 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11583 return false;
11584
11585 if (stack_max_limit)
11586 {
11587 Magazine other_mag = Magazine.Cast(other_item);
11588 if (other_item)
11589 {
11590 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11591 return false;
11592 }
11593
11594 }
11595 }
11596 else
11597 {
11598
11600 return false;
11601
11603 return false;
11604 }
11605
11606 PlayerBase player = null;
11607 if (CastTo(player, GetHierarchyRootPlayer()))
11608 {
11609 if (player.GetInventory().HasAttachment(this))
11610 return false;
11611
11612 if (player.IsItemsToDelete())
11613 return false;
11614 }
11615
11616 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11617 return false;
11618
11619 int slotID;
11621 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11622 return false;
11623
11624 return true;
11625 }
11626
11628 {
11630 }
11631
11633 {
11634 return m_IsResultOfSplit;
11635 }
11636
11638 {
11639 m_IsResultOfSplit = value;
11640 }
11641
11643 {
11645 }
11646
11648 {
11649 float other_item_quantity = other_item.GetQuantity();
11650 float this_free_space;
11651
11653
11655
11656 if (other_item_quantity > this_free_space)
11657 {
11658 return this_free_space;
11659 }
11660 else
11661 {
11662 return other_item_quantity;
11663 }
11664 }
11665
11667 {
11669 }
11670
11672 {
11674 return;
11675
11676 if (!IsMagazine() && other_item)
11677 {
11679 if (quantity_used != 0)
11680 {
11681 float hp1 = GetHealth01("","");
11682 float hp2 = other_item.GetHealth01("","");
11683 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11684 hpResult = hpResult / (
GetQuantity() + quantity_used);
11685
11686 hpResult *= GetMaxHealth();
11687 Math.Round(hpResult);
11688 SetHealth("", "Health", hpResult);
11689
11691 other_item.AddQuantity(-quantity_used);
11692 }
11693 }
11695 }
11696
11698 {
11699 #ifdef SERVER
11700 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11701 GetHierarchyParent().IncreaseLifetimeUp();
11702 #endif
11703 };
11704
11706 {
11707 PlayerBase p = PlayerBase.Cast(player);
11708
11709 array<int> recipesIds = p.m_Recipes;
11710 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11711 if (moduleRecipesManager)
11712 {
11713 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11714 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11715 }
11716
11717 for (int i = 0;i < recipesIds.Count(); i++)
11718 {
11719 int key = recipesIds.Get(i);
11720 string recipeName = moduleRecipesManager.GetRecipeName(key);
11722 }
11723 }
11724
11725
11726 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11727 {
11728 super.GetDebugActions(outputList);
11729
11730
11735
11736
11740
11744
11745
11748
11749
11751 {
11754 }
11755
11757
11760
11764 }
11765
11766
11767
11768
11770 {
11771 super.OnAction(action_id, player, ctx);
11772 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11773 {
11774 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11775 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11776 PlayerBase p = PlayerBase.Cast(player);
11777 if (
EActions.RECIPES_RANGE_START < 1000)
11778 {
11779 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11780 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11781 }
11782 }
11783 #ifndef SERVER
11784 else if (action_id ==
EActions.WATCH_PLAYER)
11785 {
11786 PluginDeveloper.SetDeveloperItemClientEx(player);
11787 }
11788 #endif
11790 {
11791 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11792 {
11793 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11794 OnDebugButtonPressServer(id + 1);
11795 }
11796
11797 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11798 {
11799 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11801 }
11802
11803 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11804 {
11805 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11807 }
11808
11809 else if (action_id ==
EActions.ADD_QUANTITY)
11810 {
11811 if (IsMagazine())
11812 {
11813 Magazine mag = Magazine.Cast(this);
11814 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11815 }
11816 else
11817 {
11819 }
11820
11821 if (m_EM)
11822 {
11823 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11824 }
11825
11826 }
11827
11828 else if (action_id ==
EActions.REMOVE_QUANTITY)
11829 {
11830 if (IsMagazine())
11831 {
11832 Magazine mag2 = Magazine.Cast(this);
11833 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11834 }
11835 else
11836 {
11838 }
11839 if (m_EM)
11840 {
11841 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11842 }
11843
11844 }
11845
11846 else if (action_id ==
EActions.SET_QUANTITY_0)
11847 {
11849
11850 if (m_EM)
11851 {
11852 m_EM.SetEnergy(0);
11853 }
11854 }
11855
11856 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11857 {
11859
11860 if (m_EM)
11861 {
11862 m_EM.SetEnergy(m_EM.GetEnergyMax());
11863 }
11864 }
11865
11866 else if (action_id ==
EActions.ADD_HEALTH)
11867 {
11868 AddHealth("","",GetMaxHealth("","Health")/5);
11869 }
11870 else if (action_id ==
EActions.REMOVE_HEALTH)
11871 {
11872 AddHealth("","",-GetMaxHealth("","Health")/5);
11873 }
11874 else if (action_id ==
EActions.DESTROY_HEALTH)
11875 {
11876 SetHealth01("","",0);
11877 }
11878 else if (action_id ==
EActions.WATCH_ITEM)
11879 {
11881 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11882 #ifdef DEVELOPER
11883 SetDebugDeveloper_item(this);
11884 #endif
11885 }
11886
11887 else if (action_id ==
EActions.ADD_TEMPERATURE)
11888 {
11889 AddTemperature(20);
11890
11891 }
11892
11893 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11894 {
11895 AddTemperature(-20);
11896
11897 }
11898
11899 else if (action_id ==
EActions.FLIP_FROZEN)
11900 {
11901 SetFrozen(!GetIsFrozen());
11902
11903 }
11904
11905 else if (action_id ==
EActions.ADD_WETNESS)
11906 {
11908
11909 }
11910
11911 else if (action_id ==
EActions.REMOVE_WETNESS)
11912 {
11914
11915 }
11916
11917 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11918 {
11921
11922
11923 }
11924
11925 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11926 {
11929 }
11930
11931 else if (action_id ==
EActions.MAKE_SPECIAL)
11932 {
11933 auto debugParams = DebugSpawnParams.WithPlayer(player);
11934 OnDebugSpawnEx(debugParams);
11935 }
11936
11937 else if (action_id ==
EActions.DELETE)
11938 {
11939 Delete();
11940 }
11941
11942 }
11943
11944
11945 return false;
11946 }
11947
11948
11949
11950
11954
11957
11958
11959
11961 {
11962 return false;
11963 }
11964
11965
11967 {
11968 return true;
11969 }
11970
11971
11973 {
11974 return true;
11975 }
11976
11977
11978
11980 {
11981 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11983 }
11984
11987 {
11988 return null;
11989 }
11990
11992 {
11993 return false;
11994 }
11995
11997 {
11998 return false;
11999 }
12000
12004
12005
12007 {
12008 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12009 return module_repairing.CanRepair(this, item_repair_kit);
12010 }
12011
12012
12013 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12014 {
12015 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12016 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12017 }
12018
12019
12021 {
12022
12023
12024
12025
12026
12027
12028
12029
12030 return 1;
12031 }
12032
12033
12034
12036 {
12038 }
12039
12040
12041
12043 {
12045 }
12046
12047
12056 {
12057 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12058
12059 if (player)
12060 {
12061 player.MessageStatus(text);
12062 }
12063 }
12064
12065
12074 {
12075 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12076
12077 if (player)
12078 {
12079 player.MessageAction(text);
12080 }
12081 }
12082
12083
12092 {
12093 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12094
12095 if (player)
12096 {
12097 player.MessageFriendly(text);
12098 }
12099 }
12100
12101
12110 {
12111 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12112
12113 if (player)
12114 {
12115 player.MessageImportant(text);
12116 }
12117 }
12118
12120 {
12121 return true;
12122 }
12123
12124
12125 override bool KindOf(
string tag)
12126 {
12127 bool found = false;
12128 string item_name = this.
GetType();
12131
12132 int array_size = item_tag_array.Count();
12133 for (int i = 0; i < array_size; i++)
12134 {
12135 if (item_tag_array.Get(i) == tag)
12136 {
12137 found = true;
12138 break;
12139 }
12140 }
12141 return found;
12142 }
12143
12144
12146 {
12147
12148 super.OnRPC(sender, rpc_type,ctx);
12149
12150
12151 switch (rpc_type)
12152 {
12153 #ifndef SERVER
12154 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12155 Param2<bool, string> p = new Param2<bool, string>(false, "");
12156
12158 return;
12159
12160 bool play = p.param1;
12161 string soundSet = p.param2;
12162
12163 if (play)
12164 {
12166 {
12168 {
12170 }
12171 }
12172 else
12173 {
12175 }
12176 }
12177 else
12178 {
12180 }
12181
12182 break;
12183 #endif
12184
12185 }
12186
12188 {
12190 }
12191 }
12192
12193
12194
12195
12197 {
12198 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12199 return plugin.GetID(
name);
12200 }
12201
12203 {
12204 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12205 return plugin.GetName(id);
12206 }
12207
12210 {
12211
12212
12213 int varFlags;
12214 if (!ctx.
Read(varFlags))
12215 return;
12216
12217 if (varFlags & ItemVariableFlags.FLOAT)
12218 {
12220 }
12221 }
12222
12224 {
12225
12226 super.SerializeNumericalVars(floats_out);
12227
12228
12229
12231 {
12233 }
12234
12236 {
12238 }
12239
12241 {
12243 }
12244
12246 {
12251 }
12252
12254 {
12256 }
12257 }
12258
12260 {
12261
12262 super.DeSerializeNumericalVars(floats);
12263
12264
12265 int index = 0;
12266 int mask = Math.Round(floats.Get(index));
12267
12268 index++;
12269
12271 {
12273 {
12275 }
12276 else
12277 {
12278 float quantity = floats.Get(index);
12279 SetQuantity(quantity,
true,
false,
false,
false);
12280 }
12281 index++;
12282 }
12283
12285 {
12286 float wet = floats.Get(index);
12288 index++;
12289 }
12290
12292 {
12293 int liquidtype = Math.Round(floats.Get(index));
12295 index++;
12296 }
12297
12299 {
12301 index++;
12303 index++;
12305 index++;
12307 index++;
12308 }
12309
12311 {
12312 int cleanness = Math.Round(floats.Get(index));
12314 index++;
12315 }
12316 }
12317
12319 {
12320 super.WriteVarsToCTX(ctx);
12321
12322
12324 {
12326 }
12327
12329 {
12331 }
12332
12334 {
12336 }
12337
12339 {
12340 int r,g,b,a;
12346 }
12347
12349 {
12351 }
12352 }
12353
12355 {
12356 if (!super.ReadVarsFromCTX(ctx,version))
12357 return false;
12358
12359 int intValue;
12360 float value;
12361
12362 if (version < 140)
12363 {
12364 if (!ctx.
Read(intValue))
12365 return false;
12366
12367 m_VariablesMask = intValue;
12368 }
12369
12371 {
12372 if (!ctx.
Read(value))
12373 return false;
12374
12376 {
12378 }
12379 else
12380 {
12382 }
12383 }
12384
12385 if (version < 140)
12386 {
12388 {
12389 if (!ctx.
Read(value))
12390 return false;
12391 SetTemperatureDirect(value);
12392 }
12393 }
12394
12396 {
12397 if (!ctx.
Read(value))
12398 return false;
12400 }
12401
12403 {
12404 if (!ctx.
Read(intValue))
12405 return false;
12407 }
12408
12410 {
12411 int r,g,b,a;
12413 return false;
12415 return false;
12417 return false;
12419 return false;
12420
12422 }
12423
12425 {
12426 if (!ctx.
Read(intValue))
12427 return false;
12429 }
12430
12431 if (version >= 138 && version < 140)
12432 {
12434 {
12435 if (!ctx.
Read(intValue))
12436 return false;
12437 SetFrozen(intValue);
12438 }
12439 }
12440
12441 return true;
12442 }
12443
12444
12446 {
12449 {
12451 }
12452
12453 if (!super.OnStoreLoad(ctx, version))
12454 {
12456 return false;
12457 }
12458
12459 if (version >= 114)
12460 {
12461 bool hasQuickBarIndexSaved;
12462
12463 if (!ctx.
Read(hasQuickBarIndexSaved))
12464 {
12466 return false;
12467 }
12468
12469 if (hasQuickBarIndexSaved)
12470 {
12471 int itmQBIndex;
12472
12473
12474 if (!ctx.
Read(itmQBIndex))
12475 {
12477 return false;
12478 }
12479
12480 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12481 if (itmQBIndex != -1 && parentPlayer)
12482 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12483 }
12484 }
12485 else
12486 {
12487
12488 PlayerBase player;
12489 int itemQBIndex;
12490 if (version ==
int.
MAX)
12491 {
12492 if (!ctx.
Read(itemQBIndex))
12493 {
12495 return false;
12496 }
12497 }
12498 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12499 {
12500
12501 if (!ctx.
Read(itemQBIndex))
12502 {
12504 return false;
12505 }
12506 if (itemQBIndex != -1 && player)
12507 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12508 }
12509 }
12510
12511 if (version < 140)
12512 {
12513
12514 if (!LoadVariables(ctx, version))
12515 {
12517 return false;
12518 }
12519 }
12520
12521
12523 {
12525 return false;
12526 }
12527 if (version >= 132)
12528 {
12530 if (raib)
12531 {
12533 {
12535 return false;
12536 }
12537 }
12538 }
12539
12541 return true;
12542 }
12543
12544
12545
12547 {
12548 super.OnStoreSave(ctx);
12549
12550 PlayerBase player;
12551 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12552 {
12554
12555 int itemQBIndex = -1;
12556 itemQBIndex = player.FindQuickBarEntityIndex(this);
12557 ctx.
Write(itemQBIndex);
12558 }
12559 else
12560 {
12562 }
12563
12565
12567 if (raib)
12568 {
12570 }
12571 }
12572
12573
12575 {
12576 super.AfterStoreLoad();
12577
12579 {
12581 }
12582
12584 {
12587 }
12588 }
12589
12591 {
12592 super.EEOnAfterLoad();
12593
12595 {
12597 }
12598
12601 }
12602
12604 {
12605 return false;
12606 }
12607
12608
12609
12611 {
12613 {
12614 #ifdef PLATFORM_CONSOLE
12615
12617 {
12619 if (menu)
12620 {
12622 }
12623 }
12624 #endif
12625 }
12626
12628 {
12631 }
12632
12634 {
12635 SetWeightDirty();
12637 }
12639 {
12642 }
12643
12645 {
12648 }
12650 {
12653 }
12654
12655 super.OnVariablesSynchronized();
12656 }
12657
12658
12659
12661 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12662 {
12663 if (!IsServerCheck(allow_client))
12664 return false;
12665
12667 return false;
12668
12671
12672 if (value <= (min + 0.001))
12673 value = min;
12674
12675 if (value == min)
12676 {
12677 if (destroy_config)
12678 {
12679 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12680 if (dstr)
12681 {
12683 this.Delete();
12684 return true;
12685 }
12686 }
12687 else if (destroy_forced)
12688 {
12690 this.Delete();
12691 return true;
12692 }
12693
12695 }
12696
12699
12701 {
12703
12704 if (delta)
12706 }
12707
12709
12710 return false;
12711 }
12712
12713
12715 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12716 {
12718 }
12719
12721 {
12724 }
12725
12727 {
12730 }
12731
12734 {
12735 float value_clamped = Math.Clamp(value, 0, 1);
12737 SetQuantity(result, destroy_config, destroy_forced);
12738 }
12739
12740
12743 {
12745 }
12746
12748 {
12750 }
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12762 {
12763 int slot = -1;
12764 if (GetInventory())
12765 {
12766 InventoryLocation il = new InventoryLocation;
12767 GetInventory().GetCurrentInventoryLocation(il);
12769 }
12770
12772 }
12773
12775 {
12776 float quantity_max = 0;
12777
12779 {
12780 if (attSlotID != -1)
12781 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12782
12783 if (quantity_max <= 0)
12785 }
12786
12787 if (quantity_max <= 0)
12789
12790 return quantity_max;
12791 }
12792
12794 {
12796 }
12797
12799 {
12801 }
12802
12803
12805 {
12807 }
12808
12810 {
12812 }
12813
12815 {
12817 }
12818
12819
12821 {
12822
12823 float weightEx = GetWeightEx();
12824 float special = GetInventoryAndCargoWeight();
12825 return weightEx - special;
12826 }
12827
12828
12830 {
12832 }
12833
12835 {
12837 {
12838 #ifdef DEVELOPER
12839 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12840 {
12841 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12843 }
12844 #endif
12845
12846 return GetQuantity() * GetConfigWeightModified();
12847 }
12848 else if (HasEnergyManager())
12849 {
12850 #ifdef DEVELOPER
12851 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12852 {
12853 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12854 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12855 }
12856 #endif
12857 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12858 }
12859 else
12860 {
12861 #ifdef DEVELOPER
12862 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12863 {
12864 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12865 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12866 }
12867 #endif
12868 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12869 }
12870 }
12871
12874 {
12875 int item_count = 0;
12877
12878 if (GetInventory().GetCargo() != NULL)
12879 {
12880 item_count = GetInventory().GetCargo().GetItemCount();
12881 }
12882
12883 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12884 {
12885 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12886 if (item)
12887 item_count += item.GetNumberOfItems();
12888 }
12889 return item_count;
12890 }
12891
12894 {
12895 float weight = 0;
12896 float wetness = 1;
12897 if (include_wetness)
12900 {
12901 weight = wetness * m_ConfigWeight;
12902 }
12904 {
12905 weight = 1;
12906 }
12907 return weight;
12908 }
12909
12910
12911
12913 {
12914 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12915 {
12916 GameInventory inv = GetInventory();
12917 array<EntityAI> items = new array<EntityAI>;
12919 for (int i = 0; i < items.Count(); i++)
12920 {
12922 if (item)
12923 {
12925 }
12926 }
12927 }
12928 }
12929
12930
12931
12932
12934 {
12935 float energy = 0;
12936 if (HasEnergyManager())
12937 {
12938 energy = GetCompEM().GetEnergy();
12939 }
12940 return energy;
12941 }
12942
12943
12945 {
12946 super.OnEnergyConsumed();
12947
12949 }
12950
12952 {
12953 super.OnEnergyAdded();
12954
12956 }
12957
12958
12960 {
12961 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12962 {
12964 {
12965 float energy_0to1 = GetCompEM().GetEnergy0To1();
12967 }
12968 }
12969 }
12970
12971
12973 {
12974 return ConfigGetFloat("heatIsolation");
12975 }
12976
12978 {
12980 }
12981
12983 {
12984 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12985 if (
GetGame().ConfigIsExisting(paramPath))
12987
12988 return 0.0;
12989 }
12990
12992 {
12993 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12994 if (
GetGame().ConfigIsExisting(paramPath))
12996
12997 return 0.0;
12998 }
12999
13000 override void SetWet(
float value,
bool allow_client =
false)
13001 {
13002 if (!IsServerCheck(allow_client))
13003 return;
13004
13007
13009
13010 m_VarWet = Math.Clamp(value, min, max);
13011
13013 {
13016 }
13017 }
13018
13019 override void AddWet(
float value)
13020 {
13022 }
13023
13025 {
13027 }
13028
13030 {
13032 }
13033
13035 {
13037 }
13038
13040 {
13042 }
13043
13045 {
13047 }
13048
13049 override void OnWetChanged(
float newVal,
float oldVal)
13050 {
13053 if (newLevel != oldLevel)
13054 {
13056 }
13057 }
13058
13060 {
13061 SetWeightDirty();
13062 }
13063
13065 {
13066 return GetWetLevelInternal(
m_VarWet);
13067 }
13068
13069
13070
13072 {
13074 }
13075
13077 {
13079 }
13080
13082 {
13084 }
13085
13087 {
13089 }
13090
13091
13092
13094 {
13095 if (ConfigIsExisting("itemModelLength"))
13096 {
13097 return ConfigGetFloat("itemModelLength");
13098 }
13099 return 0;
13100 }
13101
13103 {
13104 if (ConfigIsExisting("itemAttachOffset"))
13105 {
13106 return ConfigGetFloat("itemAttachOffset");
13107 }
13108 return 0;
13109 }
13110
13111 override void SetCleanness(
int value,
bool allow_client =
false)
13112 {
13113 if (!IsServerCheck(allow_client))
13114 return;
13115
13117
13119
13122 }
13123
13125 {
13127 }
13128
13130 {
13131 return true;
13132 }
13133
13134
13135
13136
13138 {
13140 }
13141
13143 {
13145 }
13146
13147
13148
13149
13150 override void SetColor(
int r,
int g,
int b,
int a)
13151 {
13157 }
13159 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13160 {
13165 }
13166
13168 {
13170 }
13171
13174 {
13175 int r,g,b,a;
13177 r = r/255;
13178 g = g/255;
13179 b = b/255;
13180 a = a/255;
13181 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13182 }
13183
13184
13185
13186 override void SetLiquidType(
int value,
bool allow_client =
false)
13187 {
13188 if (!IsServerCheck(allow_client))
13189 return;
13190
13195 }
13196
13198 {
13199 return ConfigGetInt("varLiquidTypeInit");
13200 }
13201
13203 {
13205 }
13206
13208 {
13210 SetFrozen(false);
13211 }
13212
13215 {
13216 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13217 }
13218
13219
13222 {
13223 PlayerBase nplayer;
13224 if (PlayerBase.CastTo(nplayer, player))
13225 {
13227
13228 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13229 }
13230 }
13231
13232
13235 {
13236 PlayerBase nplayer;
13237 if (PlayerBase.CastTo(nplayer,player))
13238 {
13239
13240 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13241
13242 }
13243
13244
13245 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13246
13247
13248 if (HasEnergyManager())
13249 {
13250 GetCompEM().UpdatePlugState();
13251 }
13252 }
13253
13254
13256 {
13257 super.OnPlacementStarted(player);
13258
13260 }
13261
13262 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13263 {
13265 {
13266 m_AdminLog.OnPlacementComplete(player,
this);
13267 }
13268
13269 super.OnPlacementComplete(player, position, orientation);
13270 }
13271
13272
13273
13274
13275
13277 {
13279 {
13280 return true;
13281 }
13282 else
13283 {
13284 return false;
13285 }
13286 }
13287
13288
13290 {
13292 {
13294 }
13295 }
13296
13297
13299 {
13301 }
13302
13304 {
13306 }
13307
13308 override void InsertAgent(
int agent,
float count = 1)
13309 {
13310 if (count < 1)
13311 return;
13312
13314 }
13315
13318 {
13320 }
13321
13322
13324 {
13326 }
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13370 {
13372 return false;
13373 return true;
13374 }
13375
13377 {
13378
13380 }
13381
13382
13385 {
13386 super.CheckForRoofLimited(timeTresholdMS);
13387
13389 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13390 {
13391 m_PreviousRoofTestTime = time;
13392 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13393 }
13394 }
13395
13396
13398 {
13400 {
13401 return 0;
13402 }
13403
13404 if (GetInventory().GetAttachmentSlotsCount() != 0)
13405 {
13406 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13407 if (filter)
13408 return filter.GetProtectionLevel(type, false, system);
13409 else
13410 return 0;
13411 }
13412
13413 string subclassPath, entryName;
13414
13415 switch (type)
13416 {
13418 entryName = "biological";
13419 break;
13421 entryName = "chemical";
13422 break;
13423 default:
13424 entryName = "biological";
13425 break;
13426 }
13427
13428 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13429
13431 }
13432
13433
13434
13437 {
13438 if (!IsMagazine())
13440
13442 }
13443
13444
13445
13446
13447
13452 {
13453 return true;
13454 }
13455
13457 {
13459 }
13460
13461
13462
13463
13464
13466 {
13467 if (parent)
13468 {
13469 if (parent.IsInherited(DayZInfected))
13470 return true;
13471
13472 if (!parent.IsRuined())
13473 return true;
13474 }
13475
13476 return true;
13477 }
13478
13480 {
13481 if (!super.CanPutAsAttachment(parent))
13482 {
13483 return false;
13484 }
13485
13486 if (!IsRuined() && !parent.IsRuined())
13487 {
13488 return true;
13489 }
13490
13491 return false;
13492 }
13493
13495 {
13496
13497
13498
13499
13500 return super.CanReceiveItemIntoCargo(item);
13501 }
13502
13504 {
13505
13506
13507
13508
13509 GameInventory attachmentInv = attachment.GetInventory();
13511 {
13512 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13513 return false;
13514 }
13515
13516 InventoryLocation loc = new InventoryLocation();
13517 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13518 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13519 return false;
13520
13521 return super.CanReceiveAttachment(attachment, slotId);
13522 }
13523
13525 {
13526 if (!super.CanReleaseAttachment(attachment))
13527 return false;
13528
13529 return GetInventory().AreChildrenAccessible();
13530 }
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13553 {
13554 int id = muzzle_owner.GetMuzzleID();
13555 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13556
13557 if (WPOF_array)
13558 {
13559 for (int i = 0; i < WPOF_array.Count(); i++)
13560 {
13561 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13562
13563 if (WPOF)
13564 {
13565 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13566 }
13567 }
13568 }
13569 }
13570
13571
13573 {
13574 int id = muzzle_owner.GetMuzzleID();
13576
13577 if (WPOBE_array)
13578 {
13579 for (int i = 0; i < WPOBE_array.Count(); i++)
13580 {
13581 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13582
13583 if (WPOBE)
13584 {
13585 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13586 }
13587 }
13588 }
13589 }
13590
13591
13593 {
13594 int id = muzzle_owner.GetMuzzleID();
13595 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13596
13597 if (WPOOH_array)
13598 {
13599 for (int i = 0; i < WPOOH_array.Count(); i++)
13600 {
13601 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13602
13603 if (WPOOH)
13604 {
13605 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13606 }
13607 }
13608 }
13609 }
13610
13611
13613 {
13614 int id = muzzle_owner.GetMuzzleID();
13615 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13616
13617 if (WPOOH_array)
13618 {
13619 for (int i = 0; i < WPOOH_array.Count(); i++)
13620 {
13621 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13622
13623 if (WPOOH)
13624 {
13625 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13626 }
13627 }
13628 }
13629 }
13630
13631
13633 {
13634 int id = muzzle_owner.GetMuzzleID();
13635 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13636
13637 if (WPOOH_array)
13638 {
13639 for (int i = 0; i < WPOOH_array.Count(); i++)
13640 {
13641 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13642
13643 if (WPOOH)
13644 {
13645 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13646 }
13647 }
13648 }
13649 }
13650
13651
13652
13654 {
13656 {
13657 return true;
13658 }
13659
13660 return false;
13661 }
13662
13664 {
13666 {
13667 return true;
13668 }
13669
13670 return false;
13671 }
13672
13674 {
13676 {
13677 return true;
13678 }
13679
13680 return false;
13681 }
13682
13684 {
13685 return false;
13686 }
13687
13690 {
13691 return UATimeSpent.DEFAULT_DEPLOY;
13692 }
13693
13694
13695
13696
13698 {
13700 SetSynchDirty();
13701 }
13702
13704 {
13706 }
13707
13708
13710 {
13711 return false;
13712 }
13713
13716 {
13717 string att_type = "None";
13718
13719 if (ConfigIsExisting("soundAttType"))
13720 {
13721 att_type = ConfigGetString("soundAttType");
13722 }
13723
13725 }
13726
13728 {
13730 }
13731
13732
13733
13734
13735
13739
13741 {
13744
13746 }
13747
13748
13750 {
13752 return;
13753
13755
13758
13761
13762 SoundParameters params = new SoundParameters();
13766 }
13767
13768
13770 {
13772 return;
13773
13775 SetSynchDirty();
13776
13779 }
13780
13781
13783 {
13785 return;
13786
13788 SetSynchDirty();
13789
13792 }
13793
13795 {
13797 }
13798
13800 {
13802 }
13803
13806 {
13807 if (!
GetGame().IsDedicatedServer())
13808 {
13809 if (ConfigIsExisting("attachSoundSet"))
13810 {
13811 string cfg_path = "";
13812 string soundset = "";
13813 string type_name =
GetType();
13814
13817 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13818 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13819
13820 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13821 {
13822 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13823 {
13824 if (cfg_slot_array[i] == slot_type)
13825 {
13826 soundset = cfg_soundset_array[i];
13827 break;
13828 }
13829 }
13830 }
13831
13832 if (soundset != "")
13833 {
13834 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13836 }
13837 }
13838 }
13839 }
13840
13842 {
13843
13844 }
13845
13846 void OnApply(PlayerBase player);
13847
13849 {
13850 return 1.0;
13851 };
13852
13854 {
13856 }
13857
13859 {
13861 }
13862
13864
13866 {
13867 SetDynamicPhysicsLifeTime(0.01);
13869 }
13870
13872 {
13873 array<string> zone_names = new array<string>;
13874 GetDamageZones(zone_names);
13875 for (int i = 0; i < zone_names.Count(); i++)
13876 {
13877 SetHealthMax(zone_names.Get(i),"Health");
13878 }
13879 SetHealthMax("","Health");
13880 }
13881
13884 {
13885 float global_health = GetHealth01("","Health");
13886 array<string> zones = new array<string>;
13887 GetDamageZones(zones);
13888
13889 for (int i = 0; i < zones.Count(); i++)
13890 {
13891 SetHealth01(zones.Get(i),"Health",global_health);
13892 }
13893 }
13894
13897 {
13898 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13899 }
13900
13902 {
13903 if (!hasRootAsPlayer)
13904 {
13905 if (refParentIB)
13906 {
13907
13908 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13909 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13910
13911 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13912 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13913
13916 }
13917 else
13918 {
13919
13922 }
13923 }
13924 }
13925
13927 {
13929 {
13930 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13931 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13932 {
13933 float heatPermCoef = 1.0;
13935 while (ent)
13936 {
13937 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13938 ent = ent.GetHierarchyParent();
13939 }
13940
13941 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13942 }
13943 }
13944 }
13945
13947 {
13948
13949 EntityAI parent = GetHierarchyParent();
13950 if (!parent)
13951 {
13952 hasParent = false;
13953 hasRootAsPlayer = false;
13954 }
13955 else
13956 {
13957 hasParent = true;
13958 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13959 refParentIB =
ItemBase.Cast(parent);
13960 }
13961 }
13962
13963 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13964 {
13965
13966 }
13967
13969 {
13970
13971 return false;
13972 }
13973
13975 {
13976
13977
13978 return false;
13979 }
13980
13982 {
13983
13984 return false;
13985 }
13986
13989 {
13990 return !GetIsFrozen() &&
IsOpen();
13991 }
13992
13994 {
13995 bool hasParent = false, hasRootAsPlayer = false;
13997
13998 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13999 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14000
14001 if (wwtu || foodDecay)
14002 {
14006
14007 if (processWetness || processTemperature || processDecay)
14008 {
14010
14011 if (processWetness)
14012 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14013
14014 if (processTemperature)
14016
14017 if (processDecay)
14018 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14019 }
14020 }
14021 }
14022
14025 {
14027 }
14028
14030 {
14033
14034 return super.GetTemperatureFreezeThreshold();
14035 }
14036
14038 {
14041
14042 return super.GetTemperatureThawThreshold();
14043 }
14044
14046 {
14049
14050 return super.GetItemOverheatThreshold();
14051 }
14052
14054 {
14056 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14057
14058 return super.GetTemperatureFreezeTime();
14059 }
14060
14062 {
14064 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14065
14066 return super.GetTemperatureThawTime();
14067 }
14068
14073
14075 {
14076 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14077 }
14078
14080 {
14081 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14082 }
14083
14086 {
14088 }
14089
14091 {
14093 }
14094
14096 {
14098 }
14099
14102 {
14103 return null;
14104 }
14105
14108 {
14109 return false;
14110 }
14111
14113 {
14115 {
14118 if (!trg)
14119 {
14121 explosive = this;
14122 }
14123
14124 explosive.PairRemote(trg);
14126
14127 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14128 trg.SetPersistentPairID(persistentID);
14129 explosive.SetPersistentPairID(persistentID);
14130
14131 return true;
14132 }
14133 return false;
14134 }
14135
14138 {
14139 float ret = 1.0;
14142 ret *= GetHealth01();
14143
14144 return ret;
14145 }
14146
14147 #ifdef DEVELOPER
14148 override void SetDebugItem()
14149 {
14150 super.SetDebugItem();
14151 _itemBase = this;
14152 }
14153
14155 {
14156 string text = super.GetDebugText();
14157
14159 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14160
14161 return text;
14162 }
14163 #endif
14164
14166 {
14167 return true;
14168 }
14169
14171
14173
14175 {
14178 }
14179
14180
14188
14204}
14205
14207{
14209 if (entity)
14210 {
14211 bool is_item = entity.IsInherited(
ItemBase);
14212 if (is_item && full_quantity)
14213 {
14216 }
14217 }
14218 else
14219 {
14221 return NULL;
14222 }
14223 return entity;
14224}
14225
14227{
14228 if (item)
14229 {
14230 if (health > 0)
14231 item.SetHealth("", "", health);
14232
14233 if (item.CanHaveTemperature())
14234 {
14236 if (item.CanFreeze())
14237 item.SetFrozen(false);
14238 }
14239
14240 if (item.HasEnergyManager())
14241 {
14242 if (quantity >= 0)
14243 {
14244 item.GetCompEM().SetEnergy0To1(quantity);
14245 }
14246 else
14247 {
14249 }
14250 }
14251 else if (item.IsMagazine())
14252 {
14253 Magazine mag = Magazine.Cast(item);
14254 if (quantity >= 0)
14255 {
14256 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14257 }
14258 else
14259 {
14261 }
14262
14263 }
14264 else
14265 {
14266 if (quantity >= 0)
14267 {
14268 item.SetQuantityNormalized(quantity, false);
14269 }
14270 else
14271 {
14273 }
14274
14275 }
14276 }
14277}
14278
14279#ifdef DEVELOPER
14281#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.