9423{
9425 {
9426 return true;
9427 }
9428};
9429
9430
9431
9433{
9437
9439
9442
9443
9444
9445
9446
9455
9461
9466
9471
9492 protected bool m_IsResultOfSplit
9493
9495
9500
9501
9502
9504
9508
9509
9510
9512
9515
9516
9517
9523
9524
9532
9535
9536
9538
9539
9541
9542
9547
9548
9553
9554
9556
9557
9559 {
9564
9565 if (!
GetGame().IsDedicatedServer())
9566 {
9568 {
9570
9572 {
9574 }
9575 }
9576
9579 }
9580
9581 m_OldLocation = null;
9582
9584 {
9586 }
9587
9588 if (ConfigIsExisting("headSelectionsToHide"))
9589 {
9592 }
9593
9595 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9596 {
9598 }
9599
9601
9602 m_IsResultOfSplit = false;
9603
9605 }
9606
9608 {
9609 super.InitItemVariables();
9610
9616 m_Count = ConfigGetInt(
"count");
9617
9620
9625
9628
9633
9645
9649
9650
9653 if (ConfigIsExisting("canBeSplit"))
9654 {
9657 }
9658
9660 if (ConfigIsExisting("itemBehaviour"))
9662
9663
9666 RegisterNetSyncVariableInt("m_VarLiquidType");
9667 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9668
9669 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9670 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9671 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9672
9673 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9674 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9675 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9676 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9677
9678 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9679 RegisterNetSyncVariableBool("m_IsTakeable");
9680 RegisterNetSyncVariableBool("m_IsHologram");
9681
9684 {
9687 }
9688
9690
9692 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9694
9695 }
9696
9698 {
9700 }
9701
9703 {
9706 {
9711 }
9712 }
9713
9714 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9715 {
9717 {
9720 }
9721
9723 }
9724
9726 {
9732 }
9733
9735
9737 {
9739
9740 if (!action)
9741 {
9742 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9743 return;
9744 }
9745
9747 if (!ai)
9748 {
9750 return;
9751 }
9752
9754 if (!action_array)
9755 {
9756 action_array = new array<ActionBase_Basic>;
9758 }
9759 if (LogManager.IsActionLogEnable())
9760 {
9761 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9762 }
9763
9764 if (action_array.Find(action) != -1)
9765 {
9766 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9767 }
9768 else
9769 {
9770 action_array.Insert(action);
9771 }
9772 }
9773
9775 {
9777 ActionBase action = player.GetActionManager().GetAction(actionName);
9780
9781 if (action_array)
9782 {
9783 action_array.RemoveItem(action);
9784 }
9785 }
9786
9787
9788
9790 {
9791 ActionOverrideData overrideData = new ActionOverrideData();
9795
9797 if (!actionMap)
9798 {
9801 }
9802
9803 actionMap.Insert(this.
Type(), overrideData);
9804
9805 }
9806
9808
9810
9811
9813 {
9816
9819
9820 string config_to_search = "CfgVehicles";
9821 string muzzle_owner_config;
9822
9824 {
9825 if (IsInherited(Weapon))
9826 config_to_search = "CfgWeapons";
9827
9828 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9829
9830 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9831
9833
9834 if (config_OnFire_subclass_count > 0)
9835 {
9836 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9837
9838 for (int i = 0; i < config_OnFire_subclass_count; i++)
9839 {
9840 string particle_class = "";
9842 string config_OnFire_entry = config_OnFire_class + particle_class;
9843 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9844 WPOF_array.Insert(WPOF);
9845 }
9846
9847
9849 }
9850 }
9851
9853 {
9854 config_to_search = "CfgWeapons";
9855 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9856
9857 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9858
9860
9861 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9862 {
9863 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9864
9865 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9866 {
9867 string particle_class2 = "";
9869 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9870 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9871 WPOBE_array.Insert(WPOBE);
9872 }
9873
9874
9876 }
9877 }
9878 }
9879
9880
9882 {
9885
9887 {
9888 string config_to_search = "CfgVehicles";
9889
9890 if (IsInherited(Weapon))
9891 config_to_search = "CfgWeapons";
9892
9893 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9894 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9895
9896 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9897 {
9898
9900
9902 {
9904 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9906 return;
9907 }
9908
9911
9912
9913
9915 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9916
9917 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9918 {
9919 string particle_class = "";
9921 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9923
9924 if (entry_type == CT_CLASS)
9925 {
9926 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9927 WPOOH_array.Insert(WPOF);
9928 }
9929 }
9930
9931
9933 }
9934 }
9935 }
9936
9938 {
9940 }
9941
9943 {
9945 {
9947
9950
9953
9954 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9955 }
9956 }
9957
9959 {
9961 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9962
9964 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9965
9967 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9968
9970 {
9972 }
9973 }
9974
9976 {
9978 }
9979
9981 {
9984 else
9986
9988 {
9991 }
9992 else
9993 {
9996
9999 }
10000
10002 }
10003
10005 {
10007 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10008 }
10009
10011 {
10013 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10015 }
10016
10018 {
10020 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10021 }
10022
10024 {
10027
10028 OverheatingParticle OP = new OverheatingParticle();
10033
10035 }
10036
10038 {
10041
10042 return -1;
10043 }
10044
10046 {
10048 {
10051
10052 for (int i = count; i > 0; --i)
10053 {
10054 int id = i - 1;
10057
10060
10061 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10062 {
10063 if (p)
10064 {
10067 }
10068 }
10069 }
10070 }
10071 }
10072
10074 {
10076 {
10078 {
10079 int id = i - 1;
10081
10082 if (OP)
10083 {
10085
10086 if (p)
10087 {
10089 }
10090
10091 delete OP;
10092 }
10093 }
10094
10097 }
10098 }
10099
10102 {
10103 return 0.0;
10104 }
10105
10106
10108 {
10109 return 250;
10110 }
10111
10113 {
10114 return 0;
10115 }
10116
10119 {
10121 return true;
10122
10123 return false;
10124 }
10125
10128 {
10131
10133 {
10135 }
10136 else
10137 {
10138
10140 }
10141
10143 }
10144
10151 {
10152 return -1;
10153 }
10154
10155
10156
10157
10159 {
10161 {
10163 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10164
10165 if (r_index >= 0)
10166 {
10167 InventoryLocation r_il = new InventoryLocation;
10168 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10169
10170 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10173 {
10174 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10175 }
10177 {
10178 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10179 }
10180
10181 }
10182
10183 player.GetHumanInventory().ClearUserReservedLocation(this);
10184 }
10185
10188 }
10189
10190
10191
10192
10194 {
10195 return ItemBase.m_DebugActionsMask;
10196 }
10197
10199 {
10200 return ItemBase.m_DebugActionsMask & mask;
10201 }
10202
10204 {
10205 ItemBase.m_DebugActionsMask = mask;
10206 }
10207
10209 {
10210 ItemBase.m_DebugActionsMask |= mask;
10211 }
10212
10214 {
10215 ItemBase.m_DebugActionsMask &= ~mask;
10216 }
10217
10219 {
10221 {
10223 }
10224 else
10225 {
10227 }
10228 }
10229
10230
10232 {
10233 if (GetEconomyProfile())
10234 {
10235 float q_max = GetEconomyProfile().GetQuantityMax();
10236 if (q_max > 0)
10237 {
10238 float q_min = GetEconomyProfile().GetQuantityMin();
10239 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10240
10242 {
10243 ComponentEnergyManager comp = GetCompEM();
10245 {
10247 }
10248 }
10250 {
10252
10253 }
10254
10255 }
10256 }
10257 }
10258
10261 {
10262 EntityAI parent = GetHierarchyParent();
10263
10264 if (parent)
10265 {
10266 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10267 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10268 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10269 }
10270 }
10271
10274 {
10275 EntityAI parent = GetHierarchyParent();
10276
10277 if (parent)
10278 {
10279 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10280 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10281 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10282 }
10283 }
10284
10286 {
10287
10288
10289
10290
10292
10294 {
10295 if (ScriptInputUserData.CanStoreInputUserData())
10296 {
10297 ScriptInputUserData ctx = new ScriptInputUserData;
10303 ctx.
Write(use_stack_max);
10306
10308 {
10309 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10310 }
10311 }
10312 }
10313 else if (!
GetGame().IsMultiplayer())
10314 {
10316 }
10317 }
10318
10320 {
10322 }
10323
10325 {
10327 }
10328
10330 {
10332 }
10333
10335 {
10336
10337 return false;
10338 }
10339
10341 {
10342 return false;
10343 }
10344
10348 {
10349 return false;
10350 }
10351
10353 {
10354 return "";
10355 }
10356
10358
10360 {
10361 return false;
10362 }
10363
10365 {
10366 return true;
10367 }
10368
10369
10370
10372 {
10373 return true;
10374 }
10375
10377 {
10378 return true;
10379 }
10380
10382 {
10383 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10385 }
10386
10388 {
10390 }
10391
10393 {
10395 if (!is_being_placed)
10397 SetSynchDirty();
10398 }
10399
10400
10402
10404 {
10406 }
10407
10409 {
10411 }
10412
10414 {
10415 return 1;
10416 }
10417
10419 {
10420 return false;
10421 }
10422
10424 {
10426 SetSynchDirty();
10427 }
10428
10429
10430
10431
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
10464 {
10465 super.OnMovedInsideCargo(container);
10466
10467 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10468 }
10469
10470 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10471 {
10472 super.EEItemLocationChanged(oldLoc,newLoc);
10473
10474 PlayerBase new_player = null;
10475 PlayerBase old_player = null;
10476
10477 if (newLoc.GetParent())
10478 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10479
10480 if (oldLoc.GetParent())
10481 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10482
10484 {
10485 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10486
10487 if (r_index >= 0)
10488 {
10489 InventoryLocation r_il = new InventoryLocation;
10490 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10491
10492 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10495 {
10496 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10497 }
10499 {
10500 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10501 }
10502
10503 }
10504 }
10505
10507 {
10508 if (new_player)
10509 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10510
10511 if (new_player == old_player)
10512 {
10513
10514 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10515 {
10517 {
10518 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10519 {
10520 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10521 }
10522 }
10523 else
10524 {
10525 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10526 }
10527 }
10528
10529 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10530 {
10531 int type = oldLoc.GetType();
10533 {
10534 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10535 }
10537 {
10538 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10539 }
10540 }
10541 if (!m_OldLocation)
10542 {
10543 m_OldLocation = new InventoryLocation;
10544 }
10545 m_OldLocation.Copy(oldLoc);
10546 }
10547 else
10548 {
10549 if (m_OldLocation)
10550 {
10551 m_OldLocation.Reset();
10552 }
10553 }
10554
10556 }
10557 else
10558 {
10559 if (new_player)
10560 {
10561 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10562 if (res_index >= 0)
10563 {
10564 InventoryLocation il = new InventoryLocation;
10565 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10567 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10570 {
10571 il.
GetParent().GetOnReleaseLock().Invoke(it);
10572 }
10574 {
10576 }
10577
10578 }
10579 }
10581 {
10582
10584 }
10585
10586 if (m_OldLocation)
10587 {
10588 m_OldLocation.Reset();
10589 }
10590 }
10591 }
10592
10593 override void EOnContact(IEntity other, Contact extra)
10594 {
10596 {
10597 int liquidType = -1;
10599 if (impactSpeed > 0.0)
10600 {
10602 #ifndef SERVER
10604 #else
10606 SetSynchDirty();
10607 #endif
10609 }
10610 }
10611
10612 #ifdef SERVER
10613 if (GetCompEM() && GetCompEM().IsPlugged())
10614 {
10615 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10616 GetCompEM().UnplugThis();
10617 }
10618 #endif
10619 }
10620
10622
10624 {
10626 }
10627
10629 {
10630
10631 }
10632
10634 {
10635 super.OnItemLocationChanged(old_owner, new_owner);
10636
10637 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10638 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10639
10640 if (!relatedPlayer && playerNew)
10641 relatedPlayer = playerNew;
10642
10643 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10644 {
10646 if (actionMgr)
10647 {
10648 ActionBase currentAction = actionMgr.GetRunningAction();
10649 if (currentAction)
10651 }
10652 }
10653
10654 Man ownerPlayerOld = null;
10655 Man ownerPlayerNew = null;
10656
10657 if (old_owner)
10658 {
10659 if (old_owner.
IsMan())
10660 {
10661 ownerPlayerOld = Man.Cast(old_owner);
10662 }
10663 else
10664 {
10665 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10666 }
10667 }
10668 else
10669 {
10671 {
10673
10674 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10675 {
10676 GetCompEM().UnplugThis();
10677 }
10678 }
10679 }
10680
10681 if (new_owner)
10682 {
10683 if (new_owner.
IsMan())
10684 {
10685 ownerPlayerNew = Man.Cast(new_owner);
10686 }
10687 else
10688 {
10689 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10690 }
10691 }
10692
10693 if (ownerPlayerOld != ownerPlayerNew)
10694 {
10695 if (ownerPlayerOld)
10696 {
10697 array<EntityAI> subItemsExit = new array<EntityAI>;
10699 for (int i = 0; i < subItemsExit.Count(); i++)
10700 {
10703 }
10704 }
10705
10706 if (ownerPlayerNew)
10707 {
10708 array<EntityAI> subItemsEnter = new array<EntityAI>;
10710 for (int j = 0; j < subItemsEnter.Count(); j++)
10711 {
10714 }
10715 }
10716 }
10717 else if (ownerPlayerNew != null)
10718 {
10719 PlayerBase nplayer;
10720 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10721 {
10722 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10724 for (int k = 0; k < subItemsUpdate.Count(); k++)
10725 {
10727 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10728 }
10729 }
10730 }
10731
10732 if (old_owner)
10733 old_owner.OnChildItemRemoved(this);
10734 if (new_owner)
10735 new_owner.OnChildItemReceived(this);
10736 }
10737
10738
10740 {
10741 super.EEDelete(parent);
10742 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10743 if (player)
10744 {
10746
10747 if (player.IsAlive())
10748 {
10749 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10750 if (r_index >= 0)
10751 {
10752 InventoryLocation r_il = new InventoryLocation;
10753 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10754
10755 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10758 {
10759 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10760 }
10762 {
10763 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10764 }
10765
10766 }
10767
10768 player.RemoveQuickBarEntityShortcut(this);
10769 }
10770 }
10771 }
10772
10774 {
10775 super.EEKilled(killer);
10776
10779 {
10780 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10781 {
10782 if (IsMagazine())
10783 {
10784 if (Magazine.Cast(this).GetAmmoCount() > 0)
10785 {
10787 }
10788 }
10789 else
10790 {
10792 }
10793 }
10794 }
10795 }
10796
10798 {
10799 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10800
10801 super.OnWasAttached(parent, slot_id);
10802
10805
10807 }
10808
10810 {
10811 super.OnWasDetached(parent, slot_id);
10812
10815 }
10816
10818 {
10819 int idx;
10822
10823 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10824 if (inventory_slots.Count() < 1)
10825 {
10826 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10827 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10828 }
10829 else
10830 {
10831 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10832 }
10833
10834 idx = inventory_slots.Find(slot);
10835 if (idx < 0)
10836 return "";
10837
10838 return attach_types.Get(idx);
10839 }
10840
10842 {
10843 int idx = -1;
10844 string slot;
10845
10848
10849 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10850 if (inventory_slots.Count() < 1)
10851 {
10852 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10853 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10854 }
10855 else
10856 {
10857 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10858 if (detach_types.Count() < 1)
10859 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10860 }
10861
10862 for (int i = 0; i < inventory_slots.Count(); i++)
10863 {
10864 slot = inventory_slots.Get(i);
10865 }
10866
10867 if (slot != "")
10868 {
10869 if (detach_types.Count() == 1)
10870 idx = 0;
10871 else
10872 idx = inventory_slots.Find(slot);
10873 }
10874 if (idx < 0)
10875 return "";
10876
10877 return detach_types.Get(idx);
10878 }
10879
10881 {
10882
10884
10885
10886 float min_time = 1;
10887 float max_time = 3;
10888 float delay = Math.RandomFloat(min_time, max_time);
10889
10890 explode_timer.Run(delay, this, "DoAmmoExplosion");
10891 }
10892
10894 {
10895 Magazine magazine = Magazine.Cast(this);
10896 int pop_sounds_count = 6;
10897 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10898
10899
10900 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10901 string sound_name = pop_sounds[ sound_idx ];
10903
10904
10905 magazine.ServerAddAmmoCount(-1);
10906
10907
10908 float min_temp_to_explode = 100;
10909
10910 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10911 {
10913 }
10914 }
10915
10916
10917 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10918 {
10919 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10920
10921 const int CHANCE_DAMAGE_CARGO = 4;
10922 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10923 const int CHANCE_DAMAGE_NOTHING = 2;
10924
10926 {
10927 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10928 int chances;
10929 int rnd;
10930
10931 if (GetInventory().GetCargo())
10932 {
10933 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10934 rnd = Math.RandomInt(0,chances);
10935
10936 if (rnd < CHANCE_DAMAGE_CARGO)
10937 {
10939 }
10940 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10941 {
10943 }
10944 }
10945 else
10946 {
10947 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10948 rnd = Math.RandomInt(0,chances);
10949
10950 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10951 {
10953 }
10954 }
10955 }
10956 }
10957
10959 {
10960 if (GetInventory().GetCargo())
10961 {
10962 int item_count = GetInventory().GetCargo().GetItemCount();
10963 if (item_count > 0)
10964 {
10965 int random_pick = Math.RandomInt(0, item_count);
10967 if (!item.IsExplosive())
10968 {
10969 item.AddHealth("","",damage);
10970 return true;
10971 }
10972 }
10973 }
10974 return false;
10975 }
10976
10978 {
10979 int attachment_count = GetInventory().AttachmentCount();
10980 if (attachment_count > 0)
10981 {
10982 int random_pick = Math.RandomInt(0, attachment_count);
10983 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10984 if (!attachment.IsExplosive())
10985 {
10986 attachment.AddHealth("","",damage);
10987 return true;
10988 }
10989 }
10990 return false;
10991 }
10992
10994 {
10996 }
10997
10999 {
11001 return GetInventory().CanRemoveEntity();
11002
11003 return false;
11004 }
11005
11007 {
11009 return;
11010
11012 {
11013 if (ScriptInputUserData.CanStoreInputUserData())
11014 {
11015 ScriptInputUserData ctx = new ScriptInputUserData;
11020 ctx.
Write(destination_entity);
11022 ctx.
Write(slot_id);
11024 }
11025 }
11026 else if (!
GetGame().IsMultiplayer())
11027 {
11029 }
11030 }
11031
11033 {
11035 return;
11036
11037 float split_quantity_new;
11041 InventoryLocation loc = new InventoryLocation;
11042
11043 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11044 {
11046 split_quantity_new = stack_max;
11047 else
11049
11050 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11051 if (new_item)
11052 {
11053 new_item.SetResultOfSplit(true);
11054 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11056 new_item.SetQuantity(split_quantity_new);
11057 }
11058 }
11059 else if (destination_entity && slot_id == -1)
11060 {
11061 if (quantity > stack_max)
11062 split_quantity_new = stack_max;
11063 else
11064 split_quantity_new = quantity;
11065
11067 {
11070 }
11071
11072 if (new_item)
11073 {
11074 new_item.SetResultOfSplit(true);
11075 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11077 new_item.SetQuantity(split_quantity_new);
11078 }
11079 }
11080 else
11081 {
11082 if (stack_max != 0)
11083 {
11085 {
11087 }
11088
11089 if (split_quantity_new == 0)
11090 {
11091 if (!
GetGame().IsMultiplayer())
11092 player.PhysicalPredictiveDropItem(this);
11093 else
11094 player.ServerDropEntity(this);
11095 return;
11096 }
11097
11099
11100 if (new_item)
11101 {
11102 new_item.SetResultOfSplit(true);
11103 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11105 new_item.SetQuantity(stack_max);
11106 new_item.PlaceOnSurface();
11107 }
11108 }
11109 }
11110 }
11111
11113 {
11115 return;
11116
11117 float split_quantity_new;
11121 InventoryLocation loc = new InventoryLocation;
11122
11123 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11124 {
11126 split_quantity_new = stack_max;
11127 else
11129
11130 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11131 if (new_item)
11132 {
11133 new_item.SetResultOfSplit(true);
11134 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11136 new_item.SetQuantity(split_quantity_new);
11137 }
11138 }
11139 else if (destination_entity && slot_id == -1)
11140 {
11141 if (quantity > stack_max)
11142 split_quantity_new = stack_max;
11143 else
11144 split_quantity_new = quantity;
11145
11147 {
11150 }
11151
11152 if (new_item)
11153 {
11154 new_item.SetResultOfSplit(true);
11155 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11157 new_item.SetQuantity(split_quantity_new);
11158 }
11159 }
11160 else
11161 {
11162 if (stack_max != 0)
11163 {
11165 {
11167 }
11168
11170
11171 if (new_item)
11172 {
11173 new_item.SetResultOfSplit(true);
11174 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11176 new_item.SetQuantity(stack_max);
11177 new_item.PlaceOnSurface();
11178 }
11179 }
11180 }
11181 }
11182
11184 {
11186 return;
11187
11189 {
11190 if (ScriptInputUserData.CanStoreInputUserData())
11191 {
11192 ScriptInputUserData ctx = new ScriptInputUserData;
11197 dst.WriteToContext(ctx);
11199 }
11200 }
11201 else if (!
GetGame().IsMultiplayer())
11202 {
11204 }
11205 }
11206
11208 {
11210 return;
11211
11213 {
11214 if (ScriptInputUserData.CanStoreInputUserData())
11215 {
11216 ScriptInputUserData ctx = new ScriptInputUserData;
11221 ctx.
Write(destination_entity);
11227 }
11228 }
11229 else if (!
GetGame().IsMultiplayer())
11230 {
11232 }
11233 }
11234
11236 {
11238 }
11239
11241 {
11243 return this;
11244
11246 float split_quantity_new;
11248 if (dst.IsValid())
11249 {
11250 int slot_id = dst.GetSlot();
11252
11253 if (quantity > stack_max)
11254 split_quantity_new = stack_max;
11255 else
11256 split_quantity_new = quantity;
11257
11259
11260 if (new_item)
11261 {
11262 new_item.SetResultOfSplit(true);
11263 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11266 }
11267
11268 return new_item;
11269 }
11270
11271 return null;
11272 }
11273
11275 {
11277 return;
11278
11280 float split_quantity_new;
11282 if (destination_entity)
11283 {
11285 if (quantity > stackable)
11286 split_quantity_new = stackable;
11287 else
11288 split_quantity_new = quantity;
11289
11290 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11291 if (new_item)
11292 {
11293 new_item.SetResultOfSplit(true);
11294 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11296 new_item.SetQuantity(split_quantity_new);
11297 }
11298 }
11299 }
11300
11302 {
11304 return;
11305
11307 {
11308 if (ScriptInputUserData.CanStoreInputUserData())
11309 {
11310 ScriptInputUserData ctx = new ScriptInputUserData;
11315 ItemBase destination_entity =
this;
11316 ctx.
Write(destination_entity);
11320 }
11321 }
11322 else if (!
GetGame().IsMultiplayer())
11323 {
11325 }
11326 }
11327
11329 {
11331 return;
11332
11334 float split_quantity_new;
11336 if (player)
11337 {
11339 if (quantity > stackable)
11340 split_quantity_new = stackable;
11341 else
11342 split_quantity_new = quantity;
11343
11344 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11345 new_item =
ItemBase.Cast(in_hands);
11346 if (new_item)
11347 {
11348 new_item.SetResultOfSplit(true);
11349 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11351 new_item.SetQuantity(split_quantity_new);
11352 }
11353 }
11354 }
11355
11357 {
11359 return;
11360
11362 float split_quantity_new = Math.Floor(quantity * 0.5);
11363
11365
11366 if (new_item)
11367 {
11368 if (new_item.GetQuantityMax() < split_quantity_new)
11369 {
11370 split_quantity_new = new_item.GetQuantityMax();
11371 }
11372
11373 new_item.SetResultOfSplit(true);
11374 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11375
11377 {
11380 }
11381 else
11382 {
11385 }
11386 }
11387 }
11388
11390 {
11392 return;
11393
11395 float split_quantity_new = Math.Floor(quantity / 2);
11396
11397 InventoryLocation invloc = new InventoryLocation;
11399
11401 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11402
11403 if (new_item)
11404 {
11405 if (new_item.GetQuantityMax() < split_quantity_new)
11406 {
11407 split_quantity_new = new_item.GetQuantityMax();
11408 }
11410 {
11413 }
11414 else
11415 {
11418 }
11419 }
11420 }
11421
11424 {
11425 SetWeightDirty();
11427
11428 if (parent)
11429 parent.OnAttachmentQuantityChangedEx(this, delta);
11430
11432 {
11434 {
11436 }
11438 {
11439 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11441 }
11442 }
11443
11444 }
11445
11448 {
11449
11450 }
11451
11454 {
11456 }
11457
11459 {
11460 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11461
11463 {
11464 if (newLevel == GameConstants.STATE_RUINED)
11465 {
11467 EntityAI parent = GetHierarchyParent();
11468 if (parent && parent.IsFireplace())
11469 {
11470 CargoBase cargo = GetInventory().GetCargo();
11471 if (cargo)
11472 {
11474 {
11476 }
11477 }
11478 }
11479 }
11480
11482 {
11483
11485 return;
11486 }
11487
11488 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11489 {
11491 }
11492 }
11493 }
11494
11495
11497 {
11498 super.OnRightClick();
11499
11501 {
11503 {
11504 if (ScriptInputUserData.CanStoreInputUserData())
11505 {
11506 vector m4[4];
11508
11509 EntityAI root = GetHierarchyRoot();
11510
11511 InventoryLocation dst = new InventoryLocation;
11513 {
11514 if (root)
11515 {
11516 root.GetTransform(m4);
11518 }
11519 else
11520 GetInventory().GetCurrentInventoryLocation(dst);
11521 }
11522 else
11523 {
11525
11526
11527 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11528 {
11529 if (root)
11530 {
11531 root.GetTransform(m4);
11533 }
11534 else
11535 GetInventory().GetCurrentInventoryLocation(dst);
11536 }
11537 else
11538 {
11539 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11540 }
11541 }
11542
11543 ScriptInputUserData ctx = new ScriptInputUserData;
11551 }
11552 }
11553 else if (!
GetGame().IsMultiplayer())
11554 {
11556 }
11557 }
11558 }
11559
11560 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11561 {
11562
11563 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11564 return false;
11565
11566 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11567 return false;
11568
11569
11571 return false;
11572
11573
11574 Magazine mag = Magazine.Cast(this);
11575 if (mag)
11576 {
11577 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11578 return false;
11579
11580 if (stack_max_limit)
11581 {
11582 Magazine other_mag = Magazine.Cast(other_item);
11583 if (other_item)
11584 {
11585 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11586 return false;
11587 }
11588
11589 }
11590 }
11591 else
11592 {
11593
11595 return false;
11596
11598 return false;
11599 }
11600
11601 PlayerBase player = null;
11602 if (CastTo(player, GetHierarchyRootPlayer()))
11603 {
11604 if (player.GetInventory().HasAttachment(this))
11605 return false;
11606
11607 if (player.IsItemsToDelete())
11608 return false;
11609 }
11610
11611 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11612 return false;
11613
11614 int slotID;
11616 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11617 return false;
11618
11619 return true;
11620 }
11621
11623 {
11625 }
11626
11628 {
11629 return m_IsResultOfSplit;
11630 }
11631
11633 {
11634 m_IsResultOfSplit = value;
11635 }
11636
11638 {
11640 }
11641
11643 {
11644 float other_item_quantity = other_item.GetQuantity();
11645 float this_free_space;
11646
11648
11650
11651 if (other_item_quantity > this_free_space)
11652 {
11653 return this_free_space;
11654 }
11655 else
11656 {
11657 return other_item_quantity;
11658 }
11659 }
11660
11662 {
11664 }
11665
11667 {
11669 return;
11670
11671 if (!IsMagazine() && other_item)
11672 {
11674 if (quantity_used != 0)
11675 {
11676 float hp1 = GetHealth01("","");
11677 float hp2 = other_item.GetHealth01("","");
11678 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11679 hpResult = hpResult / (
GetQuantity() + quantity_used);
11680
11681 hpResult *= GetMaxHealth();
11682 Math.Round(hpResult);
11683 SetHealth("", "Health", hpResult);
11684
11686 other_item.AddQuantity(-quantity_used);
11687 }
11688 }
11690 }
11691
11693 {
11694 #ifdef SERVER
11695 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11696 GetHierarchyParent().IncreaseLifetimeUp();
11697 #endif
11698 };
11699
11701 {
11702 PlayerBase p = PlayerBase.Cast(player);
11703
11704 array<int> recipesIds = p.m_Recipes;
11705 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11706 if (moduleRecipesManager)
11707 {
11708 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11709 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11710 }
11711
11712 for (int i = 0;i < recipesIds.Count(); i++)
11713 {
11714 int key = recipesIds.Get(i);
11715 string recipeName = moduleRecipesManager.GetRecipeName(key);
11717 }
11718 }
11719
11720
11721 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11722 {
11723 super.GetDebugActions(outputList);
11724
11725
11730
11731
11735
11739
11740
11743
11744
11746 {
11749 }
11750
11752
11755
11759 }
11760
11761
11762
11763
11765 {
11766 super.OnAction(action_id, player, ctx);
11767 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11768 {
11769 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11770 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11771 PlayerBase p = PlayerBase.Cast(player);
11772 if (
EActions.RECIPES_RANGE_START < 1000)
11773 {
11774 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11775 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11776 }
11777 }
11778 #ifndef SERVER
11779 else if (action_id ==
EActions.WATCH_PLAYER)
11780 {
11781 PluginDeveloper.SetDeveloperItemClientEx(player);
11782 }
11783 #endif
11785 {
11786 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11787 {
11788 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11789 OnDebugButtonPressServer(id + 1);
11790 }
11791
11792 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11793 {
11794 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11796 }
11797
11798 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11799 {
11800 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11802 }
11803
11804 else if (action_id ==
EActions.ADD_QUANTITY)
11805 {
11806 if (IsMagazine())
11807 {
11808 Magazine mag = Magazine.Cast(this);
11809 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11810 }
11811 else
11812 {
11814 }
11815
11816 if (m_EM)
11817 {
11818 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11819 }
11820
11821 }
11822
11823 else if (action_id ==
EActions.REMOVE_QUANTITY)
11824 {
11825 if (IsMagazine())
11826 {
11827 Magazine mag2 = Magazine.Cast(this);
11828 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11829 }
11830 else
11831 {
11833 }
11834 if (m_EM)
11835 {
11836 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11837 }
11838
11839 }
11840
11841 else if (action_id ==
EActions.SET_QUANTITY_0)
11842 {
11844
11845 if (m_EM)
11846 {
11847 m_EM.SetEnergy(0);
11848 }
11849 }
11850
11851 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11852 {
11854
11855 if (m_EM)
11856 {
11857 m_EM.SetEnergy(m_EM.GetEnergyMax());
11858 }
11859 }
11860
11861 else if (action_id ==
EActions.ADD_HEALTH)
11862 {
11863 AddHealth("","",GetMaxHealth("","Health")/5);
11864 }
11865 else if (action_id ==
EActions.REMOVE_HEALTH)
11866 {
11867 AddHealth("","",-GetMaxHealth("","Health")/5);
11868 }
11869 else if (action_id ==
EActions.DESTROY_HEALTH)
11870 {
11871 SetHealth01("","",0);
11872 }
11873 else if (action_id ==
EActions.WATCH_ITEM)
11874 {
11876 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11877 #ifdef DEVELOPER
11878 SetDebugDeveloper_item(this);
11879 #endif
11880 }
11881
11882 else if (action_id ==
EActions.ADD_TEMPERATURE)
11883 {
11884 AddTemperature(20);
11885
11886 }
11887
11888 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11889 {
11890 AddTemperature(-20);
11891
11892 }
11893
11894 else if (action_id ==
EActions.FLIP_FROZEN)
11895 {
11896 SetFrozen(!GetIsFrozen());
11897
11898 }
11899
11900 else if (action_id ==
EActions.ADD_WETNESS)
11901 {
11903
11904 }
11905
11906 else if (action_id ==
EActions.REMOVE_WETNESS)
11907 {
11909
11910 }
11911
11912 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11913 {
11916
11917
11918 }
11919
11920 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11921 {
11924 }
11925
11926 else if (action_id ==
EActions.MAKE_SPECIAL)
11927 {
11928 auto debugParams = DebugSpawnParams.WithPlayer(player);
11929 OnDebugSpawnEx(debugParams);
11930 }
11931
11932 else if (action_id ==
EActions.DELETE)
11933 {
11934 Delete();
11935 }
11936
11937 }
11938
11939
11940 return false;
11941 }
11942
11943
11944
11945
11949
11952
11953
11954
11956 {
11957 return false;
11958 }
11959
11960
11962 {
11963 return true;
11964 }
11965
11966
11968 {
11969 return true;
11970 }
11971
11972
11973
11975 {
11976 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11978 }
11979
11982 {
11983 return null;
11984 }
11985
11987 {
11988 return false;
11989 }
11990
11992 {
11993 return false;
11994 }
11995
11999
12000
12002 {
12003 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12004 return module_repairing.CanRepair(this, item_repair_kit);
12005 }
12006
12007
12008 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12009 {
12010 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12011 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12012 }
12013
12014
12016 {
12017
12018
12019
12020
12021
12022
12023
12024
12025 return 1;
12026 }
12027
12028
12029
12031 {
12033 }
12034
12035
12036
12038 {
12040 }
12041
12042
12051 {
12052 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12053
12054 if (player)
12055 {
12056 player.MessageStatus(text);
12057 }
12058 }
12059
12060
12069 {
12070 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12071
12072 if (player)
12073 {
12074 player.MessageAction(text);
12075 }
12076 }
12077
12078
12087 {
12088 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12089
12090 if (player)
12091 {
12092 player.MessageFriendly(text);
12093 }
12094 }
12095
12096
12105 {
12106 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12107
12108 if (player)
12109 {
12110 player.MessageImportant(text);
12111 }
12112 }
12113
12115 {
12116 return true;
12117 }
12118
12119
12120 override bool KindOf(
string tag)
12121 {
12122 bool found = false;
12123 string item_name = this.
GetType();
12126
12127 int array_size = item_tag_array.Count();
12128 for (int i = 0; i < array_size; i++)
12129 {
12130 if (item_tag_array.Get(i) == tag)
12131 {
12132 found = true;
12133 break;
12134 }
12135 }
12136 return found;
12137 }
12138
12139
12141 {
12142
12143 super.OnRPC(sender, rpc_type,ctx);
12144
12145
12146 switch (rpc_type)
12147 {
12148 #ifndef SERVER
12149 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12150 Param2<bool, string> p = new Param2<bool, string>(false, "");
12151
12153 return;
12154
12155 bool play = p.param1;
12156 string soundSet = p.param2;
12157
12158 if (play)
12159 {
12161 {
12163 {
12165 }
12166 }
12167 else
12168 {
12170 }
12171 }
12172 else
12173 {
12175 }
12176
12177 break;
12178 #endif
12179
12180 }
12181
12183 {
12185 }
12186 }
12187
12188
12189
12190
12192 {
12193 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12194 return plugin.GetID(
name);
12195 }
12196
12198 {
12199 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12200 return plugin.GetName(id);
12201 }
12202
12205 {
12206
12207
12208 int varFlags;
12209 if (!ctx.
Read(varFlags))
12210 return;
12211
12212 if (varFlags & ItemVariableFlags.FLOAT)
12213 {
12215 }
12216 }
12217
12219 {
12220
12221 super.SerializeNumericalVars(floats_out);
12222
12223
12224
12226 {
12228 }
12229
12231 {
12233 }
12234
12236 {
12238 }
12239
12241 {
12246 }
12247
12249 {
12251 }
12252 }
12253
12255 {
12256
12257 super.DeSerializeNumericalVars(floats);
12258
12259
12260 int index = 0;
12261 int mask = Math.Round(floats.Get(index));
12262
12263 index++;
12264
12266 {
12268 {
12270 }
12271 else
12272 {
12273 float quantity = floats.Get(index);
12274 SetQuantity(quantity,
true,
false,
false,
false);
12275 }
12276 index++;
12277 }
12278
12280 {
12281 float wet = floats.Get(index);
12283 index++;
12284 }
12285
12287 {
12288 int liquidtype = Math.Round(floats.Get(index));
12290 index++;
12291 }
12292
12294 {
12296 index++;
12298 index++;
12300 index++;
12302 index++;
12303 }
12304
12306 {
12307 int cleanness = Math.Round(floats.Get(index));
12309 index++;
12310 }
12311 }
12312
12314 {
12315 super.WriteVarsToCTX(ctx);
12316
12317
12319 {
12321 }
12322
12324 {
12326 }
12327
12329 {
12331 }
12332
12334 {
12335 int r,g,b,a;
12341 }
12342
12344 {
12346 }
12347 }
12348
12350 {
12351 if (!super.ReadVarsFromCTX(ctx,version))
12352 return false;
12353
12354 int intValue;
12355 float value;
12356
12357 if (version < 140)
12358 {
12359 if (!ctx.
Read(intValue))
12360 return false;
12361
12362 m_VariablesMask = intValue;
12363 }
12364
12366 {
12367 if (!ctx.
Read(value))
12368 return false;
12369
12371 {
12373 }
12374 else
12375 {
12377 }
12378 }
12379
12380 if (version < 140)
12381 {
12383 {
12384 if (!ctx.
Read(value))
12385 return false;
12386 SetTemperatureDirect(value);
12387 }
12388 }
12389
12391 {
12392 if (!ctx.
Read(value))
12393 return false;
12395 }
12396
12398 {
12399 if (!ctx.
Read(intValue))
12400 return false;
12402 }
12403
12405 {
12406 int r,g,b,a;
12408 return false;
12410 return false;
12412 return false;
12414 return false;
12415
12417 }
12418
12420 {
12421 if (!ctx.
Read(intValue))
12422 return false;
12424 }
12425
12426 if (version >= 138 && version < 140)
12427 {
12429 {
12430 if (!ctx.
Read(intValue))
12431 return false;
12432 SetFrozen(intValue);
12433 }
12434 }
12435
12436 return true;
12437 }
12438
12439
12441 {
12444 {
12446 }
12447
12448 if (!super.OnStoreLoad(ctx, version))
12449 {
12451 return false;
12452 }
12453
12454 if (version >= 114)
12455 {
12456 bool hasQuickBarIndexSaved;
12457
12458 if (!ctx.
Read(hasQuickBarIndexSaved))
12459 {
12461 return false;
12462 }
12463
12464 if (hasQuickBarIndexSaved)
12465 {
12466 int itmQBIndex;
12467
12468
12469 if (!ctx.
Read(itmQBIndex))
12470 {
12472 return false;
12473 }
12474
12475 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12476 if (itmQBIndex != -1 && parentPlayer)
12477 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12478 }
12479 }
12480 else
12481 {
12482
12483 PlayerBase player;
12484 int itemQBIndex;
12485 if (version ==
int.
MAX)
12486 {
12487 if (!ctx.
Read(itemQBIndex))
12488 {
12490 return false;
12491 }
12492 }
12493 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12494 {
12495
12496 if (!ctx.
Read(itemQBIndex))
12497 {
12499 return false;
12500 }
12501 if (itemQBIndex != -1 && player)
12502 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12503 }
12504 }
12505
12506 if (version < 140)
12507 {
12508
12509 if (!LoadVariables(ctx, version))
12510 {
12512 return false;
12513 }
12514 }
12515
12516
12518 {
12520 return false;
12521 }
12522 if (version >= 132)
12523 {
12525 if (raib)
12526 {
12528 {
12530 return false;
12531 }
12532 }
12533 }
12534
12536 return true;
12537 }
12538
12539
12540
12542 {
12543 super.OnStoreSave(ctx);
12544
12545 PlayerBase player;
12546 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12547 {
12549
12550 int itemQBIndex = -1;
12551 itemQBIndex = player.FindQuickBarEntityIndex(this);
12552 ctx.
Write(itemQBIndex);
12553 }
12554 else
12555 {
12557 }
12558
12560
12562 if (raib)
12563 {
12565 }
12566 }
12567
12568
12570 {
12571 super.AfterStoreLoad();
12572
12574 {
12576 }
12577
12579 {
12582 }
12583 }
12584
12586 {
12587 super.EEOnAfterLoad();
12588
12590 {
12592 }
12593
12596 }
12597
12599 {
12600 return false;
12601 }
12602
12603
12604
12606 {
12608 {
12609 #ifdef PLATFORM_CONSOLE
12610
12612 {
12614 if (menu)
12615 {
12617 }
12618 }
12619 #endif
12620 }
12621
12623 {
12626 }
12627
12629 {
12630 SetWeightDirty();
12632 }
12634 {
12637 }
12638
12640 {
12643 }
12645 {
12648 }
12649
12650 super.OnVariablesSynchronized();
12651 }
12652
12653
12654
12656 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12657 {
12658 if (!IsServerCheck(allow_client))
12659 return false;
12660
12662 return false;
12663
12666
12667 if (value <= (min + 0.001))
12668 value = min;
12669
12670 if (value == min)
12671 {
12672 if (destroy_config)
12673 {
12674 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12675 if (dstr)
12676 {
12678 this.Delete();
12679 return true;
12680 }
12681 }
12682 else if (destroy_forced)
12683 {
12685 this.Delete();
12686 return true;
12687 }
12688
12690 }
12691
12694
12696 {
12698
12699 if (delta)
12701 }
12702
12704
12705 return false;
12706 }
12707
12708
12710 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12711 {
12713 }
12714
12716 {
12719 }
12720
12722 {
12725 }
12726
12729 {
12730 float value_clamped = Math.Clamp(value, 0, 1);
12732 SetQuantity(result, destroy_config, destroy_forced);
12733 }
12734
12735
12738 {
12740 }
12741
12743 {
12745 }
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12757 {
12758 int slot = -1;
12759 if (GetInventory())
12760 {
12761 InventoryLocation il = new InventoryLocation;
12762 GetInventory().GetCurrentInventoryLocation(il);
12764 }
12765
12767 }
12768
12770 {
12771 float quantity_max = 0;
12772
12774 {
12775 if (attSlotID != -1)
12776 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12777
12778 if (quantity_max <= 0)
12780 }
12781
12782 if (quantity_max <= 0)
12784
12785 return quantity_max;
12786 }
12787
12789 {
12791 }
12792
12794 {
12796 }
12797
12798
12800 {
12802 }
12803
12805 {
12807 }
12808
12810 {
12812 }
12813
12814
12816 {
12817
12818 float weightEx = GetWeightEx();
12819 float special = GetInventoryAndCargoWeight();
12820 return weightEx - special;
12821 }
12822
12823
12825 {
12827 }
12828
12830 {
12832 {
12833 #ifdef DEVELOPER
12834 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12835 {
12836 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12838 }
12839 #endif
12840
12841 return GetQuantity() * GetConfigWeightModified();
12842 }
12843 else if (HasEnergyManager())
12844 {
12845 #ifdef DEVELOPER
12846 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12847 {
12848 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12849 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12850 }
12851 #endif
12852 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12853 }
12854 else
12855 {
12856 #ifdef DEVELOPER
12857 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12858 {
12859 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12860 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12861 }
12862 #endif
12863 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12864 }
12865 }
12866
12869 {
12870 int item_count = 0;
12872
12873 if (GetInventory().GetCargo() != NULL)
12874 {
12875 item_count = GetInventory().GetCargo().GetItemCount();
12876 }
12877
12878 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12879 {
12880 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12881 if (item)
12882 item_count += item.GetNumberOfItems();
12883 }
12884 return item_count;
12885 }
12886
12889 {
12890 float weight = 0;
12891 float wetness = 1;
12892 if (include_wetness)
12895 {
12896 weight = wetness * m_ConfigWeight;
12897 }
12899 {
12900 weight = 1;
12901 }
12902 return weight;
12903 }
12904
12905
12906
12908 {
12909 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12910 {
12911 GameInventory inv = GetInventory();
12912 array<EntityAI> items = new array<EntityAI>;
12914 for (int i = 0; i < items.Count(); i++)
12915 {
12917 if (item)
12918 {
12920 }
12921 }
12922 }
12923 }
12924
12925
12926
12927
12929 {
12930 float energy = 0;
12931 if (HasEnergyManager())
12932 {
12933 energy = GetCompEM().GetEnergy();
12934 }
12935 return energy;
12936 }
12937
12938
12940 {
12941 super.OnEnergyConsumed();
12942
12944 }
12945
12947 {
12948 super.OnEnergyAdded();
12949
12951 }
12952
12953
12955 {
12956 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12957 {
12959 {
12960 float energy_0to1 = GetCompEM().GetEnergy0To1();
12962 }
12963 }
12964 }
12965
12966
12968 {
12969 return ConfigGetFloat("heatIsolation");
12970 }
12971
12973 {
12975 }
12976
12978 {
12979 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12980 if (
GetGame().ConfigIsExisting(paramPath))
12982
12983 return 0.0;
12984 }
12985
12987 {
12988 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12989 if (
GetGame().ConfigIsExisting(paramPath))
12991
12992 return 0.0;
12993 }
12994
12995 override void SetWet(
float value,
bool allow_client =
false)
12996 {
12997 if (!IsServerCheck(allow_client))
12998 return;
12999
13002
13004
13005 m_VarWet = Math.Clamp(value, min, max);
13006
13008 {
13011 }
13012 }
13013
13014 override void AddWet(
float value)
13015 {
13017 }
13018
13020 {
13022 }
13023
13025 {
13027 }
13028
13030 {
13032 }
13033
13035 {
13037 }
13038
13040 {
13042 }
13043
13044 override void OnWetChanged(
float newVal,
float oldVal)
13045 {
13048 if (newLevel != oldLevel)
13049 {
13051 }
13052 }
13053
13055 {
13056 SetWeightDirty();
13057 }
13058
13060 {
13061 return GetWetLevelInternal(
m_VarWet);
13062 }
13063
13064
13065
13067 {
13069 }
13070
13072 {
13074 }
13075
13077 {
13079 }
13080
13082 {
13084 }
13085
13086
13087
13089 {
13090 if (ConfigIsExisting("itemModelLength"))
13091 {
13092 return ConfigGetFloat("itemModelLength");
13093 }
13094 return 0;
13095 }
13096
13098 {
13099 if (ConfigIsExisting("itemAttachOffset"))
13100 {
13101 return ConfigGetFloat("itemAttachOffset");
13102 }
13103 return 0;
13104 }
13105
13106 override void SetCleanness(
int value,
bool allow_client =
false)
13107 {
13108 if (!IsServerCheck(allow_client))
13109 return;
13110
13112
13114
13117 }
13118
13120 {
13122 }
13123
13125 {
13126 return true;
13127 }
13128
13129
13130
13131
13133 {
13135 }
13136
13138 {
13140 }
13141
13142
13143
13144
13145 override void SetColor(
int r,
int g,
int b,
int a)
13146 {
13152 }
13154 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13155 {
13160 }
13161
13163 {
13165 }
13166
13169 {
13170 int r,g,b,a;
13172 r = r/255;
13173 g = g/255;
13174 b = b/255;
13175 a = a/255;
13176 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13177 }
13178
13179
13180
13181 override void SetLiquidType(
int value,
bool allow_client =
false)
13182 {
13183 if (!IsServerCheck(allow_client))
13184 return;
13185
13190 }
13191
13193 {
13194 return ConfigGetInt("varLiquidTypeInit");
13195 }
13196
13198 {
13200 }
13201
13203 {
13205 SetFrozen(false);
13206 }
13207
13210 {
13211 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13212 }
13213
13214
13217 {
13218 PlayerBase nplayer;
13219 if (PlayerBase.CastTo(nplayer, player))
13220 {
13222
13223 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13224 }
13225 }
13226
13227
13230 {
13231 PlayerBase nplayer;
13232 if (PlayerBase.CastTo(nplayer,player))
13233 {
13234
13235 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13236
13237 }
13238
13239
13240 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13241
13242
13243 if (HasEnergyManager())
13244 {
13245 GetCompEM().UpdatePlugState();
13246 }
13247 }
13248
13249
13251 {
13252 super.OnPlacementStarted(player);
13253
13255 }
13256
13257 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13258 {
13260 {
13261 m_AdminLog.OnPlacementComplete(player,
this);
13262 }
13263
13264 super.OnPlacementComplete(player, position, orientation);
13265 }
13266
13267
13268
13269
13270
13272 {
13274 {
13275 return true;
13276 }
13277 else
13278 {
13279 return false;
13280 }
13281 }
13282
13283
13285 {
13287 {
13289 }
13290 }
13291
13292
13294 {
13296 }
13297
13299 {
13301 }
13302
13303 override void InsertAgent(
int agent,
float count = 1)
13304 {
13305 if (count < 1)
13306 return;
13307
13309 }
13310
13313 {
13315 }
13316
13317
13319 {
13321 }
13322
13323
13324
13325
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
13365 {
13367 return false;
13368 return true;
13369 }
13370
13372 {
13373
13375 }
13376
13377
13380 {
13381 super.CheckForRoofLimited(timeTresholdMS);
13382
13384 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13385 {
13386 m_PreviousRoofTestTime = time;
13387 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13388 }
13389 }
13390
13391
13393 {
13395 {
13396 return 0;
13397 }
13398
13399 if (GetInventory().GetAttachmentSlotsCount() != 0)
13400 {
13401 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13402 if (filter)
13403 return filter.GetProtectionLevel(type, false, system);
13404 else
13405 return 0;
13406 }
13407
13408 string subclassPath, entryName;
13409
13410 switch (type)
13411 {
13413 entryName = "biological";
13414 break;
13416 entryName = "chemical";
13417 break;
13418 default:
13419 entryName = "biological";
13420 break;
13421 }
13422
13423 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13424
13426 }
13427
13428
13429
13432 {
13433 if (!IsMagazine())
13435
13437 }
13438
13439
13440
13441
13442
13447 {
13448 return true;
13449 }
13450
13452 {
13454 }
13455
13456
13457
13458
13459
13461 {
13462 if (parent)
13463 {
13464 if (parent.IsInherited(DayZInfected))
13465 return true;
13466
13467 if (!parent.IsRuined())
13468 return true;
13469 }
13470
13471 return true;
13472 }
13473
13475 {
13476 if (!super.CanPutAsAttachment(parent))
13477 {
13478 return false;
13479 }
13480
13481 if (!IsRuined() && !parent.IsRuined())
13482 {
13483 return true;
13484 }
13485
13486 return false;
13487 }
13488
13490 {
13491
13492
13493
13494
13495 return super.CanReceiveItemIntoCargo(item);
13496 }
13497
13499 {
13500
13501
13502
13503
13504 GameInventory attachmentInv = attachment.GetInventory();
13506 {
13507 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13508 return false;
13509 }
13510
13511 InventoryLocation loc = new InventoryLocation();
13512 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13513 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13514 return false;
13515
13516 return super.CanReceiveAttachment(attachment, slotId);
13517 }
13518
13520 {
13521 if (!super.CanReleaseAttachment(attachment))
13522 return false;
13523
13524 return GetInventory().AreChildrenAccessible();
13525 }
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13548 {
13549 int id = muzzle_owner.GetMuzzleID();
13550 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13551
13552 if (WPOF_array)
13553 {
13554 for (int i = 0; i < WPOF_array.Count(); i++)
13555 {
13556 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13557
13558 if (WPOF)
13559 {
13560 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13561 }
13562 }
13563 }
13564 }
13565
13566
13568 {
13569 int id = muzzle_owner.GetMuzzleID();
13571
13572 if (WPOBE_array)
13573 {
13574 for (int i = 0; i < WPOBE_array.Count(); i++)
13575 {
13576 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13577
13578 if (WPOBE)
13579 {
13580 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13581 }
13582 }
13583 }
13584 }
13585
13586
13588 {
13589 int id = muzzle_owner.GetMuzzleID();
13590 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13591
13592 if (WPOOH_array)
13593 {
13594 for (int i = 0; i < WPOOH_array.Count(); i++)
13595 {
13596 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13597
13598 if (WPOOH)
13599 {
13600 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13601 }
13602 }
13603 }
13604 }
13605
13606
13608 {
13609 int id = muzzle_owner.GetMuzzleID();
13610 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13611
13612 if (WPOOH_array)
13613 {
13614 for (int i = 0; i < WPOOH_array.Count(); i++)
13615 {
13616 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13617
13618 if (WPOOH)
13619 {
13620 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13621 }
13622 }
13623 }
13624 }
13625
13626
13628 {
13629 int id = muzzle_owner.GetMuzzleID();
13630 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13631
13632 if (WPOOH_array)
13633 {
13634 for (int i = 0; i < WPOOH_array.Count(); i++)
13635 {
13636 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13637
13638 if (WPOOH)
13639 {
13640 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13641 }
13642 }
13643 }
13644 }
13645
13646
13647
13649 {
13651 {
13652 return true;
13653 }
13654
13655 return false;
13656 }
13657
13659 {
13661 {
13662 return true;
13663 }
13664
13665 return false;
13666 }
13667
13669 {
13671 {
13672 return true;
13673 }
13674
13675 return false;
13676 }
13677
13679 {
13680 return false;
13681 }
13682
13685 {
13686 return UATimeSpent.DEFAULT_DEPLOY;
13687 }
13688
13689
13690
13691
13693 {
13695 SetSynchDirty();
13696 }
13697
13699 {
13701 }
13702
13703
13705 {
13706 return false;
13707 }
13708
13711 {
13712 string att_type = "None";
13713
13714 if (ConfigIsExisting("soundAttType"))
13715 {
13716 att_type = ConfigGetString("soundAttType");
13717 }
13718
13720 }
13721
13723 {
13725 }
13726
13727
13728
13729
13730
13734
13736 {
13739
13741 }
13742
13743
13745 {
13747 return;
13748
13750
13753
13756
13757 SoundParameters params = new SoundParameters();
13761 }
13762
13763
13765 {
13767 return;
13768
13770 SetSynchDirty();
13771
13774 }
13775
13776
13778 {
13780 return;
13781
13783 SetSynchDirty();
13784
13787 }
13788
13790 {
13792 }
13793
13795 {
13797 }
13798
13801 {
13802 if (!
GetGame().IsDedicatedServer())
13803 {
13804 if (ConfigIsExisting("attachSoundSet"))
13805 {
13806 string cfg_path = "";
13807 string soundset = "";
13808 string type_name =
GetType();
13809
13812 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13813 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13814
13815 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13816 {
13817 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13818 {
13819 if (cfg_slot_array[i] == slot_type)
13820 {
13821 soundset = cfg_soundset_array[i];
13822 break;
13823 }
13824 }
13825 }
13826
13827 if (soundset != "")
13828 {
13829 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13831 }
13832 }
13833 }
13834 }
13835
13837 {
13838
13839 }
13840
13841 void OnApply(PlayerBase player);
13842
13844 {
13845 return 1.0;
13846 };
13847
13849 {
13851 }
13852
13854 {
13856 }
13857
13859
13861 {
13862 SetDynamicPhysicsLifeTime(0.01);
13864 }
13865
13867 {
13868 array<string> zone_names = new array<string>;
13869 GetDamageZones(zone_names);
13870 for (int i = 0; i < zone_names.Count(); i++)
13871 {
13872 SetHealthMax(zone_names.Get(i),"Health");
13873 }
13874 SetHealthMax("","Health");
13875 }
13876
13879 {
13880 float global_health = GetHealth01("","Health");
13881 array<string> zones = new array<string>;
13882 GetDamageZones(zones);
13883
13884 for (int i = 0; i < zones.Count(); i++)
13885 {
13886 SetHealth01(zones.Get(i),"Health",global_health);
13887 }
13888 }
13889
13892 {
13893 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13894 }
13895
13897 {
13898 if (!hasRootAsPlayer)
13899 {
13900 if (refParentIB)
13901 {
13902
13903 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13904 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13905
13906 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13907 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13908
13911 }
13912 else
13913 {
13914
13917 }
13918 }
13919 }
13920
13922 {
13924 {
13925 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13926 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13927 {
13928 float heatPermCoef = 1.0;
13930 while (ent)
13931 {
13932 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13933 ent = ent.GetHierarchyParent();
13934 }
13935
13936 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13937 }
13938 }
13939 }
13940
13942 {
13943
13944 EntityAI parent = GetHierarchyParent();
13945 if (!parent)
13946 {
13947 hasParent = false;
13948 hasRootAsPlayer = false;
13949 }
13950 else
13951 {
13952 hasParent = true;
13953 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13954 refParentIB =
ItemBase.Cast(parent);
13955 }
13956 }
13957
13958 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13959 {
13960
13961 }
13962
13964 {
13965
13966 return false;
13967 }
13968
13970 {
13971
13972
13973 return false;
13974 }
13975
13977 {
13978
13979 return false;
13980 }
13981
13984 {
13985 return !GetIsFrozen() &&
IsOpen();
13986 }
13987
13989 {
13990 bool hasParent = false, hasRootAsPlayer = false;
13992
13993 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13994 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13995
13996 if (wwtu || foodDecay)
13997 {
14001
14002 if (processWetness || processTemperature || processDecay)
14003 {
14005
14006 if (processWetness)
14007 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14008
14009 if (processTemperature)
14011
14012 if (processDecay)
14013 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14014 }
14015 }
14016 }
14017
14020 {
14022 }
14023
14025 {
14028
14029 return super.GetTemperatureFreezeThreshold();
14030 }
14031
14033 {
14036
14037 return super.GetTemperatureThawThreshold();
14038 }
14039
14041 {
14044
14045 return super.GetItemOverheatThreshold();
14046 }
14047
14049 {
14051 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14052
14053 return super.GetTemperatureFreezeTime();
14054 }
14055
14057 {
14059 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14060
14061 return super.GetTemperatureThawTime();
14062 }
14063
14068
14070 {
14071 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14072 }
14073
14075 {
14076 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14077 }
14078
14081 {
14083 }
14084
14086 {
14088 }
14089
14091 {
14093 }
14094
14097 {
14098 return null;
14099 }
14100
14103 {
14104 return false;
14105 }
14106
14108 {
14110 {
14113 if (!trg)
14114 {
14116 explosive = this;
14117 }
14118
14119 explosive.PairRemote(trg);
14121
14122 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14123 trg.SetPersistentPairID(persistentID);
14124 explosive.SetPersistentPairID(persistentID);
14125
14126 return true;
14127 }
14128 return false;
14129 }
14130
14133 {
14134 float ret = 1.0;
14137 ret *= GetHealth01();
14138
14139 return ret;
14140 }
14141
14142 #ifdef DEVELOPER
14143 override void SetDebugItem()
14144 {
14145 super.SetDebugItem();
14146 _itemBase = this;
14147 }
14148
14150 {
14151 string text = super.GetDebugText();
14152
14154 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14155
14156 return text;
14157 }
14158 #endif
14159
14161 {
14162 return true;
14163 }
14164
14166
14168
14170 {
14173 }
14174
14175
14183
14199}
14200
14202{
14204 if (entity)
14205 {
14206 bool is_item = entity.IsInherited(
ItemBase);
14207 if (is_item && full_quantity)
14208 {
14211 }
14212 }
14213 else
14214 {
14216 return NULL;
14217 }
14218 return entity;
14219}
14220
14222{
14223 if (item)
14224 {
14225 if (health > 0)
14226 item.SetHealth("", "", health);
14227
14228 if (item.CanHaveTemperature())
14229 {
14231 if (item.CanFreeze())
14232 item.SetFrozen(false);
14233 }
14234
14235 if (item.HasEnergyManager())
14236 {
14237 if (quantity >= 0)
14238 {
14239 item.GetCompEM().SetEnergy0To1(quantity);
14240 }
14241 else
14242 {
14244 }
14245 }
14246 else if (item.IsMagazine())
14247 {
14248 Magazine mag = Magazine.Cast(item);
14249 if (quantity >= 0)
14250 {
14251 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14252 }
14253 else
14254 {
14256 }
14257
14258 }
14259 else
14260 {
14261 if (quantity >= 0)
14262 {
14263 item.SetQuantityNormalized(quantity, false);
14264 }
14265 else
14266 {
14268 }
14269
14270 }
14271 }
14272}
14273
14274#ifdef DEVELOPER
14276#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.