9444{
9446 {
9447 return true;
9448 }
9449};
9450
9451
9452
9454{
9458
9460
9463
9464
9465
9466
9467
9476
9482
9487
9492
9513 protected bool m_IsResultOfSplit
9514
9516
9521
9522
9523
9525
9529
9530
9531
9533
9536
9537
9538
9544
9545
9553
9556
9557
9559
9560
9562
9563
9568
9569
9574
9575
9577
9578
9580 {
9585
9586 if (!
GetGame().IsDedicatedServer())
9587 {
9589 {
9591
9593 {
9595 }
9596 }
9597
9600 }
9601
9602 m_OldLocation = null;
9603
9605 {
9607 }
9608
9609 if (ConfigIsExisting("headSelectionsToHide"))
9610 {
9613 }
9614
9616 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9617 {
9619 }
9620
9622
9623 m_IsResultOfSplit = false;
9624
9626 }
9627
9629 {
9630 super.InitItemVariables();
9631
9637 m_Count = ConfigGetInt(
"count");
9638
9641
9646
9649
9654
9666
9670
9671
9674 if (ConfigIsExisting("canBeSplit"))
9675 {
9678 }
9679
9681 if (ConfigIsExisting("itemBehaviour"))
9683
9684
9687 RegisterNetSyncVariableInt("m_VarLiquidType");
9688 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9689
9690 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9691 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9692 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9693
9694 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9695 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9696 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9697 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9698
9699 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9700 RegisterNetSyncVariableBool("m_IsTakeable");
9701 RegisterNetSyncVariableBool("m_IsHologram");
9702
9705 {
9708 }
9709
9711
9713 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9715
9716 }
9717
9719 {
9721 }
9722
9724 {
9727 {
9732 }
9733 }
9734
9735 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9736 {
9738 {
9741 }
9742
9744 }
9745
9747 {
9753 }
9754
9756
9758 {
9760
9761 if (!action)
9762 {
9763 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9764 return;
9765 }
9766
9768 if (!ai)
9769 {
9771 return;
9772 }
9773
9775 if (!action_array)
9776 {
9777 action_array = new array<ActionBase_Basic>;
9779 }
9780 if (LogManager.IsActionLogEnable())
9781 {
9782 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9783 }
9784
9785 if (action_array.Find(action) != -1)
9786 {
9787 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9788 }
9789 else
9790 {
9791 action_array.Insert(action);
9792 }
9793 }
9794
9796 {
9798 ActionBase action = player.GetActionManager().GetAction(actionName);
9801
9802 if (action_array)
9803 {
9804 action_array.RemoveItem(action);
9805 }
9806 }
9807
9808
9809
9811 {
9812 ActionOverrideData overrideData = new ActionOverrideData();
9816
9818 if (!actionMap)
9819 {
9822 }
9823
9824 actionMap.Insert(this.
Type(), overrideData);
9825
9826 }
9827
9829
9831
9832
9834 {
9837
9840
9841 string config_to_search = "CfgVehicles";
9842 string muzzle_owner_config;
9843
9845 {
9846 if (IsInherited(Weapon))
9847 config_to_search = "CfgWeapons";
9848
9849 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9850
9851 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9852
9854
9855 if (config_OnFire_subclass_count > 0)
9856 {
9857 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9858
9859 for (int i = 0; i < config_OnFire_subclass_count; i++)
9860 {
9861 string particle_class = "";
9863 string config_OnFire_entry = config_OnFire_class + particle_class;
9864 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9865 WPOF_array.Insert(WPOF);
9866 }
9867
9868
9870 }
9871 }
9872
9874 {
9875 config_to_search = "CfgWeapons";
9876 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9877
9878 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9879
9881
9882 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9883 {
9884 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9885
9886 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9887 {
9888 string particle_class2 = "";
9890 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9891 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9892 WPOBE_array.Insert(WPOBE);
9893 }
9894
9895
9897 }
9898 }
9899 }
9900
9901
9903 {
9906
9908 {
9909 string config_to_search = "CfgVehicles";
9910
9911 if (IsInherited(Weapon))
9912 config_to_search = "CfgWeapons";
9913
9914 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9915 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9916
9917 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9918 {
9919
9921
9923 {
9925 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9927 return;
9928 }
9929
9932
9933
9934
9936 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9937
9938 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9939 {
9940 string particle_class = "";
9942 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9944
9945 if (entry_type == CT_CLASS)
9946 {
9947 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9948 WPOOH_array.Insert(WPOF);
9949 }
9950 }
9951
9952
9954 }
9955 }
9956 }
9957
9959 {
9961 }
9962
9964 {
9966 {
9968
9971
9974
9975 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9976 }
9977 }
9978
9980 {
9982 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9983
9985 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9986
9988 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9989
9991 {
9993 }
9994 }
9995
9997 {
9999 }
10000
10002 {
10005 else
10007
10009 {
10012 }
10013 else
10014 {
10017
10020 }
10021
10023 }
10024
10026 {
10028 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10029 }
10030
10032 {
10034 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10036 }
10037
10039 {
10041 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10042 }
10043
10045 {
10048
10049 OverheatingParticle OP = new OverheatingParticle();
10054
10056 }
10057
10059 {
10062
10063 return -1;
10064 }
10065
10067 {
10069 {
10072
10073 for (int i = count; i > 0; --i)
10074 {
10075 int id = i - 1;
10078
10081
10082 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10083 {
10084 if (p)
10085 {
10088 }
10089 }
10090 }
10091 }
10092 }
10093
10095 {
10097 {
10099 {
10100 int id = i - 1;
10102
10103 if (OP)
10104 {
10106
10107 if (p)
10108 {
10110 }
10111
10112 delete OP;
10113 }
10114 }
10115
10118 }
10119 }
10120
10123 {
10124 return 0.0;
10125 }
10126
10127
10129 {
10130 return 250;
10131 }
10132
10134 {
10135 return 0;
10136 }
10137
10140 {
10142 return true;
10143
10144 return false;
10145 }
10146
10149 {
10152
10154 {
10156 }
10157 else
10158 {
10159
10161 }
10162
10164 }
10165
10172 {
10173 return -1;
10174 }
10175
10176
10177
10178
10180 {
10182 {
10184 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10185
10186 if (r_index >= 0)
10187 {
10188 InventoryLocation r_il = new InventoryLocation;
10189 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10190
10191 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10194 {
10195 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10196 }
10198 {
10199 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10200 }
10201
10202 }
10203
10204 player.GetHumanInventory().ClearUserReservedLocation(this);
10205 }
10206
10209 }
10210
10211
10212
10213
10215 {
10216 return ItemBase.m_DebugActionsMask;
10217 }
10218
10220 {
10221 return ItemBase.m_DebugActionsMask & mask;
10222 }
10223
10225 {
10226 ItemBase.m_DebugActionsMask = mask;
10227 }
10228
10230 {
10231 ItemBase.m_DebugActionsMask |= mask;
10232 }
10233
10235 {
10236 ItemBase.m_DebugActionsMask &= ~mask;
10237 }
10238
10240 {
10242 {
10244 }
10245 else
10246 {
10248 }
10249 }
10250
10251
10253 {
10254 if (GetEconomyProfile())
10255 {
10256 float q_max = GetEconomyProfile().GetQuantityMax();
10257 if (q_max > 0)
10258 {
10259 float q_min = GetEconomyProfile().GetQuantityMin();
10260 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10261
10263 {
10264 ComponentEnergyManager comp = GetCompEM();
10266 {
10268 }
10269 }
10271 {
10273
10274 }
10275
10276 }
10277 }
10278 }
10279
10282 {
10283 EntityAI parent = GetHierarchyParent();
10284
10285 if (parent)
10286 {
10287 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10288 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10289 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10290 }
10291 }
10292
10295 {
10296 EntityAI parent = GetHierarchyParent();
10297
10298 if (parent)
10299 {
10300 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10301 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10302 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10303 }
10304 }
10305
10307 {
10308
10309
10310
10311
10313
10315 {
10316 if (ScriptInputUserData.CanStoreInputUserData())
10317 {
10318 ScriptInputUserData ctx = new ScriptInputUserData;
10324 ctx.
Write(use_stack_max);
10327
10329 {
10330 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10331 }
10332 }
10333 }
10334 else if (!
GetGame().IsMultiplayer())
10335 {
10337 }
10338 }
10339
10341 {
10343 }
10344
10346 {
10348 }
10349
10351 {
10353 }
10354
10356 {
10357
10358 return false;
10359 }
10360
10362 {
10363 return false;
10364 }
10365
10369 {
10370 return false;
10371 }
10372
10374 {
10375 return "";
10376 }
10377
10379
10381 {
10382 return false;
10383 }
10384
10386 {
10387 return true;
10388 }
10389
10390
10391
10393 {
10394 return true;
10395 }
10396
10398 {
10399 return true;
10400 }
10401
10403 {
10404 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10406 }
10407
10409 {
10411 }
10412
10414 {
10416 if (!is_being_placed)
10418 SetSynchDirty();
10419 }
10420
10421
10423
10425 {
10427 }
10428
10430 {
10432 }
10433
10435 {
10436 return 1;
10437 }
10438
10440 {
10441 return false;
10442 }
10443
10445 {
10447 SetSynchDirty();
10448 }
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10485 {
10486 super.OnMovedInsideCargo(container);
10487
10488 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10489 }
10490
10491 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10492 {
10493 super.EEItemLocationChanged(oldLoc,newLoc);
10494
10495 PlayerBase new_player = null;
10496 PlayerBase old_player = null;
10497
10498 if (newLoc.GetParent())
10499 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10500
10501 if (oldLoc.GetParent())
10502 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10503
10505 {
10506 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10507
10508 if (r_index >= 0)
10509 {
10510 InventoryLocation r_il = new InventoryLocation;
10511 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10512
10513 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10516 {
10517 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10518 }
10520 {
10521 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10522 }
10523
10524 }
10525 }
10526
10528 {
10529 if (new_player)
10530 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10531
10532 if (new_player == old_player)
10533 {
10534
10535 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10536 {
10538 {
10539 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10540 {
10541 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10542 }
10543 }
10544 else
10545 {
10546 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10547 }
10548 }
10549
10550 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10551 {
10552 int type = oldLoc.GetType();
10554 {
10555 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10556 }
10558 {
10559 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10560 }
10561 }
10562 if (!m_OldLocation)
10563 {
10564 m_OldLocation = new InventoryLocation;
10565 }
10566 m_OldLocation.Copy(oldLoc);
10567 }
10568 else
10569 {
10570 if (m_OldLocation)
10571 {
10572 m_OldLocation.Reset();
10573 }
10574 }
10575
10577 }
10578 else
10579 {
10580 if (new_player)
10581 {
10582 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10583 if (res_index >= 0)
10584 {
10585 InventoryLocation il = new InventoryLocation;
10586 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10588 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10591 {
10592 il.
GetParent().GetOnReleaseLock().Invoke(it);
10593 }
10595 {
10597 }
10598
10599 }
10600 }
10602 {
10603
10605 }
10606
10607 if (m_OldLocation)
10608 {
10609 m_OldLocation.Reset();
10610 }
10611 }
10612 }
10613
10614 override void EOnContact(IEntity other, Contact extra)
10615 {
10617 {
10618 int liquidType = -1;
10620 if (impactSpeed > 0.0)
10621 {
10623 #ifndef SERVER
10625 #else
10627 SetSynchDirty();
10628 #endif
10630 }
10631 }
10632
10633 #ifdef SERVER
10634 if (GetCompEM() && GetCompEM().IsPlugged())
10635 {
10636 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10637 GetCompEM().UnplugThis();
10638 }
10639 #endif
10640 }
10641
10643
10645 {
10647 }
10648
10650 {
10651
10652 }
10653
10655 {
10656 super.OnItemLocationChanged(old_owner, new_owner);
10657
10658 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10659 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10660
10661 if (!relatedPlayer && playerNew)
10662 relatedPlayer = playerNew;
10663
10664 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10665 {
10667 if (actionMgr)
10668 {
10669 ActionBase currentAction = actionMgr.GetRunningAction();
10670 if (currentAction)
10672 }
10673 }
10674
10675 Man ownerPlayerOld = null;
10676 Man ownerPlayerNew = null;
10677
10678 if (old_owner)
10679 {
10680 if (old_owner.
IsMan())
10681 {
10682 ownerPlayerOld = Man.Cast(old_owner);
10683 }
10684 else
10685 {
10686 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10687 }
10688 }
10689 else
10690 {
10692 {
10694
10695 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10696 {
10697 GetCompEM().UnplugThis();
10698 }
10699 }
10700 }
10701
10702 if (new_owner)
10703 {
10704 if (new_owner.
IsMan())
10705 {
10706 ownerPlayerNew = Man.Cast(new_owner);
10707 }
10708 else
10709 {
10710 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10711 }
10712 }
10713
10714 if (ownerPlayerOld != ownerPlayerNew)
10715 {
10716 if (ownerPlayerOld)
10717 {
10718 array<EntityAI> subItemsExit = new array<EntityAI>;
10720 for (int i = 0; i < subItemsExit.Count(); i++)
10721 {
10724 }
10725 }
10726
10727 if (ownerPlayerNew)
10728 {
10729 array<EntityAI> subItemsEnter = new array<EntityAI>;
10731 for (int j = 0; j < subItemsEnter.Count(); j++)
10732 {
10735 }
10736 }
10737 }
10738 else if (ownerPlayerNew != null)
10739 {
10740 PlayerBase nplayer;
10741 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10742 {
10743 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10745 for (int k = 0; k < subItemsUpdate.Count(); k++)
10746 {
10748 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10749 }
10750 }
10751 }
10752
10753 if (old_owner)
10754 old_owner.OnChildItemRemoved(this);
10755 if (new_owner)
10756 new_owner.OnChildItemReceived(this);
10757 }
10758
10759
10761 {
10762 super.EEDelete(parent);
10763 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10764 if (player)
10765 {
10767
10768 if (player.IsAlive())
10769 {
10770 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10771 if (r_index >= 0)
10772 {
10773 InventoryLocation r_il = new InventoryLocation;
10774 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10775
10776 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10779 {
10780 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10781 }
10783 {
10784 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10785 }
10786
10787 }
10788
10789 player.RemoveQuickBarEntityShortcut(this);
10790 }
10791 }
10792 }
10793
10795 {
10796 super.EEKilled(killer);
10797
10800 {
10801 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10802 {
10803 if (IsMagazine())
10804 {
10805 if (Magazine.Cast(this).GetAmmoCount() > 0)
10806 {
10808 }
10809 }
10810 else
10811 {
10813 }
10814 }
10815 }
10816 }
10817
10819 {
10820 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10821
10822 super.OnWasAttached(parent, slot_id);
10823
10826
10828 }
10829
10831 {
10832 super.OnWasDetached(parent, slot_id);
10833
10836 }
10837
10839 {
10840 int idx;
10843
10844 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10845 if (inventory_slots.Count() < 1)
10846 {
10847 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10848 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10849 }
10850 else
10851 {
10852 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10853 }
10854
10855 idx = inventory_slots.Find(slot);
10856 if (idx < 0)
10857 return "";
10858
10859 return attach_types.Get(idx);
10860 }
10861
10863 {
10864 int idx = -1;
10865 string slot;
10866
10869
10870 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10871 if (inventory_slots.Count() < 1)
10872 {
10873 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10874 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10875 }
10876 else
10877 {
10878 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10879 if (detach_types.Count() < 1)
10880 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10881 }
10882
10883 for (int i = 0; i < inventory_slots.Count(); i++)
10884 {
10885 slot = inventory_slots.Get(i);
10886 }
10887
10888 if (slot != "")
10889 {
10890 if (detach_types.Count() == 1)
10891 idx = 0;
10892 else
10893 idx = inventory_slots.Find(slot);
10894 }
10895 if (idx < 0)
10896 return "";
10897
10898 return detach_types.Get(idx);
10899 }
10900
10902 {
10903
10905
10906
10907 float min_time = 1;
10908 float max_time = 3;
10909 float delay = Math.RandomFloat(min_time, max_time);
10910
10911 explode_timer.Run(delay, this, "DoAmmoExplosion");
10912 }
10913
10915 {
10916 Magazine magazine = Magazine.Cast(this);
10917 int pop_sounds_count = 6;
10918 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10919
10920
10921 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10922 string sound_name = pop_sounds[ sound_idx ];
10924
10925
10926 magazine.ServerAddAmmoCount(-1);
10927
10928
10929 float min_temp_to_explode = 100;
10930
10931 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10932 {
10934 }
10935 }
10936
10937
10938 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10939 {
10940 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10941
10942 const int CHANCE_DAMAGE_CARGO = 4;
10943 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10944 const int CHANCE_DAMAGE_NOTHING = 2;
10945
10947 {
10948 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10949 int chances;
10950 int rnd;
10951
10952 if (GetInventory().GetCargo())
10953 {
10954 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10955 rnd = Math.RandomInt(0,chances);
10956
10957 if (rnd < CHANCE_DAMAGE_CARGO)
10958 {
10960 }
10961 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10962 {
10964 }
10965 }
10966 else
10967 {
10968 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10969 rnd = Math.RandomInt(0,chances);
10970
10971 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10972 {
10974 }
10975 }
10976 }
10977 }
10978
10980 {
10981 if (GetInventory().GetCargo())
10982 {
10983 int item_count = GetInventory().GetCargo().GetItemCount();
10984 if (item_count > 0)
10985 {
10986 int random_pick = Math.RandomInt(0, item_count);
10988 if (!item.IsExplosive())
10989 {
10990 item.AddHealth("","",damage);
10991 return true;
10992 }
10993 }
10994 }
10995 return false;
10996 }
10997
10999 {
11000 int attachment_count = GetInventory().AttachmentCount();
11001 if (attachment_count > 0)
11002 {
11003 int random_pick = Math.RandomInt(0, attachment_count);
11004 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11005 if (!attachment.IsExplosive())
11006 {
11007 attachment.AddHealth("","",damage);
11008 return true;
11009 }
11010 }
11011 return false;
11012 }
11013
11015 {
11017 }
11018
11020 {
11022 return GetInventory().CanRemoveEntity();
11023
11024 return false;
11025 }
11026
11028 {
11030 return;
11031
11033 {
11034 if (ScriptInputUserData.CanStoreInputUserData())
11035 {
11036 ScriptInputUserData ctx = new ScriptInputUserData;
11041 ctx.
Write(destination_entity);
11043 ctx.
Write(slot_id);
11045 }
11046 }
11047 else if (!
GetGame().IsMultiplayer())
11048 {
11050 }
11051 }
11052
11054 {
11056 return;
11057
11058 float split_quantity_new;
11062 InventoryLocation loc = new InventoryLocation;
11063
11064 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11065 {
11067 split_quantity_new = stack_max;
11068 else
11070
11071 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
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 if (destination_entity && slot_id == -1)
11081 {
11082 if (quantity > stack_max)
11083 split_quantity_new = stack_max;
11084 else
11085 split_quantity_new = quantity;
11086
11088 {
11091 }
11092
11093 if (new_item)
11094 {
11095 new_item.SetResultOfSplit(true);
11096 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11098 new_item.SetQuantity(split_quantity_new);
11099 }
11100 }
11101 else
11102 {
11103 if (stack_max != 0)
11104 {
11106 {
11108 }
11109
11110 if (split_quantity_new == 0)
11111 {
11112 if (!
GetGame().IsMultiplayer())
11113 player.PhysicalPredictiveDropItem(this);
11114 else
11115 player.ServerDropEntity(this);
11116 return;
11117 }
11118
11120
11121 if (new_item)
11122 {
11123 new_item.SetResultOfSplit(true);
11124 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11126 new_item.SetQuantity(stack_max);
11127 new_item.PlaceOnSurface();
11128 }
11129 }
11130 }
11131 }
11132
11134 {
11136 return;
11137
11138 float split_quantity_new;
11142 InventoryLocation loc = new InventoryLocation;
11143
11144 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11145 {
11147 split_quantity_new = stack_max;
11148 else
11150
11151 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
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 if (destination_entity && slot_id == -1)
11161 {
11162 if (quantity > stack_max)
11163 split_quantity_new = stack_max;
11164 else
11165 split_quantity_new = quantity;
11166
11168 {
11171 }
11172
11173 if (new_item)
11174 {
11175 new_item.SetResultOfSplit(true);
11176 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11178 new_item.SetQuantity(split_quantity_new);
11179 }
11180 }
11181 else
11182 {
11183 if (stack_max != 0)
11184 {
11186 {
11188 }
11189
11191
11192 if (new_item)
11193 {
11194 new_item.SetResultOfSplit(true);
11195 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11197 new_item.SetQuantity(stack_max);
11198 new_item.PlaceOnSurface();
11199 }
11200 }
11201 }
11202 }
11203
11205 {
11207 return;
11208
11210 {
11211 if (ScriptInputUserData.CanStoreInputUserData())
11212 {
11213 ScriptInputUserData ctx = new ScriptInputUserData;
11218 dst.WriteToContext(ctx);
11220 }
11221 }
11222 else if (!
GetGame().IsMultiplayer())
11223 {
11225 }
11226 }
11227
11229 {
11231 return;
11232
11234 {
11235 if (ScriptInputUserData.CanStoreInputUserData())
11236 {
11237 ScriptInputUserData ctx = new ScriptInputUserData;
11242 ctx.
Write(destination_entity);
11248 }
11249 }
11250 else if (!
GetGame().IsMultiplayer())
11251 {
11253 }
11254 }
11255
11257 {
11259 }
11260
11262 {
11264 return this;
11265
11267 float split_quantity_new;
11269 if (dst.IsValid())
11270 {
11271 int slot_id = dst.GetSlot();
11273
11274 if (quantity > stack_max)
11275 split_quantity_new = stack_max;
11276 else
11277 split_quantity_new = quantity;
11278
11280
11281 if (new_item)
11282 {
11283 new_item.SetResultOfSplit(true);
11284 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11287 }
11288
11289 return new_item;
11290 }
11291
11292 return null;
11293 }
11294
11296 {
11298 return;
11299
11301 float split_quantity_new;
11303 if (destination_entity)
11304 {
11306 if (quantity > stackable)
11307 split_quantity_new = stackable;
11308 else
11309 split_quantity_new = quantity;
11310
11311 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11312 if (new_item)
11313 {
11314 new_item.SetResultOfSplit(true);
11315 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11317 new_item.SetQuantity(split_quantity_new);
11318 }
11319 }
11320 }
11321
11323 {
11325 return;
11326
11328 {
11329 if (ScriptInputUserData.CanStoreInputUserData())
11330 {
11331 ScriptInputUserData ctx = new ScriptInputUserData;
11336 ItemBase destination_entity =
this;
11337 ctx.
Write(destination_entity);
11341 }
11342 }
11343 else if (!
GetGame().IsMultiplayer())
11344 {
11346 }
11347 }
11348
11350 {
11352 return;
11353
11355 float split_quantity_new;
11357 if (player)
11358 {
11360 if (quantity > stackable)
11361 split_quantity_new = stackable;
11362 else
11363 split_quantity_new = quantity;
11364
11365 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11366 new_item =
ItemBase.Cast(in_hands);
11367 if (new_item)
11368 {
11369 new_item.SetResultOfSplit(true);
11370 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11372 new_item.SetQuantity(split_quantity_new);
11373 }
11374 }
11375 }
11376
11378 {
11380 return;
11381
11383 float split_quantity_new = Math.Floor(quantity * 0.5);
11384
11386
11387 if (new_item)
11388 {
11389 if (new_item.GetQuantityMax() < split_quantity_new)
11390 {
11391 split_quantity_new = new_item.GetQuantityMax();
11392 }
11393
11394 new_item.SetResultOfSplit(true);
11395 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11396
11398 {
11401 }
11402 else
11403 {
11406 }
11407 }
11408 }
11409
11411 {
11413 return;
11414
11416 float split_quantity_new = Math.Floor(quantity / 2);
11417
11418 InventoryLocation invloc = new InventoryLocation;
11420
11422 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11423
11424 if (new_item)
11425 {
11426 if (new_item.GetQuantityMax() < split_quantity_new)
11427 {
11428 split_quantity_new = new_item.GetQuantityMax();
11429 }
11431 {
11434 }
11435 else
11436 {
11439 }
11440 }
11441 }
11442
11445 {
11446 SetWeightDirty();
11448
11449 if (parent)
11450 parent.OnAttachmentQuantityChangedEx(this, delta);
11451
11453 {
11455 {
11457 }
11459 {
11460 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11462 }
11463 }
11464
11465 }
11466
11469 {
11470
11471 }
11472
11475 {
11477 }
11478
11480 {
11481 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11482
11484 {
11485 if (newLevel == GameConstants.STATE_RUINED)
11486 {
11488 EntityAI parent = GetHierarchyParent();
11489 if (parent && parent.IsFireplace())
11490 {
11491 CargoBase cargo = GetInventory().GetCargo();
11492 if (cargo)
11493 {
11495 {
11497 }
11498 }
11499 }
11500 }
11501
11503 {
11504
11506 return;
11507 }
11508
11509 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11510 {
11512 }
11513 }
11514 }
11515
11516
11518 {
11519 super.OnRightClick();
11520
11522 {
11524 {
11525 if (ScriptInputUserData.CanStoreInputUserData())
11526 {
11527 vector m4[4];
11529
11530 EntityAI root = GetHierarchyRoot();
11531
11532 InventoryLocation dst = new InventoryLocation;
11534 {
11535 if (root)
11536 {
11537 root.GetTransform(m4);
11539 }
11540 else
11541 GetInventory().GetCurrentInventoryLocation(dst);
11542 }
11543 else
11544 {
11546
11547
11548 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11549 {
11550 if (root)
11551 {
11552 root.GetTransform(m4);
11554 }
11555 else
11556 GetInventory().GetCurrentInventoryLocation(dst);
11557 }
11558 else
11559 {
11560 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11561 }
11562 }
11563
11564 ScriptInputUserData ctx = new ScriptInputUserData;
11572 }
11573 }
11574 else if (!
GetGame().IsMultiplayer())
11575 {
11577 }
11578 }
11579 }
11580
11581 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11582 {
11583
11584 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11585 return false;
11586
11587 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11588 return false;
11589
11590
11592 return false;
11593
11594
11595 Magazine mag = Magazine.Cast(this);
11596 if (mag)
11597 {
11598 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11599 return false;
11600
11601 if (stack_max_limit)
11602 {
11603 Magazine other_mag = Magazine.Cast(other_item);
11604 if (other_item)
11605 {
11606 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11607 return false;
11608 }
11609
11610 }
11611 }
11612 else
11613 {
11614
11616 return false;
11617
11619 return false;
11620 }
11621
11622 PlayerBase player = null;
11623 if (CastTo(player, GetHierarchyRootPlayer()))
11624 {
11625 if (player.GetInventory().HasAttachment(this))
11626 return false;
11627
11628 if (player.IsItemsToDelete())
11629 return false;
11630 }
11631
11632 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11633 return false;
11634
11635 int slotID;
11637 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11638 return false;
11639
11640 return true;
11641 }
11642
11644 {
11646 }
11647
11649 {
11650 return m_IsResultOfSplit;
11651 }
11652
11654 {
11655 m_IsResultOfSplit = value;
11656 }
11657
11659 {
11661 }
11662
11664 {
11665 float other_item_quantity = other_item.GetQuantity();
11666 float this_free_space;
11667
11669
11671
11672 if (other_item_quantity > this_free_space)
11673 {
11674 return this_free_space;
11675 }
11676 else
11677 {
11678 return other_item_quantity;
11679 }
11680 }
11681
11683 {
11685 }
11686
11688 {
11690 return;
11691
11692 if (!IsMagazine() && other_item)
11693 {
11695 if (quantity_used != 0)
11696 {
11697 float hp1 = GetHealth01("","");
11698 float hp2 = other_item.GetHealth01("","");
11699 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11700 hpResult = hpResult / (
GetQuantity() + quantity_used);
11701
11702 hpResult *= GetMaxHealth();
11703 Math.Round(hpResult);
11704 SetHealth("", "Health", hpResult);
11705
11707 other_item.AddQuantity(-quantity_used);
11708 }
11709 }
11711 }
11712
11714 {
11715 #ifdef SERVER
11716 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11717 GetHierarchyParent().IncreaseLifetimeUp();
11718 #endif
11719 };
11720
11722 {
11723 PlayerBase p = PlayerBase.Cast(player);
11724
11725 array<int> recipesIds = p.m_Recipes;
11726 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11727 if (moduleRecipesManager)
11728 {
11729 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11730 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11731 }
11732
11733 for (int i = 0;i < recipesIds.Count(); i++)
11734 {
11735 int key = recipesIds.Get(i);
11736 string recipeName = moduleRecipesManager.GetRecipeName(key);
11738 }
11739 }
11740
11741
11742 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11743 {
11744 super.GetDebugActions(outputList);
11745
11746
11751
11752
11756
11760
11761
11764
11765
11767 {
11770 }
11771
11773
11776
11780 }
11781
11782
11783
11784
11786 {
11787 super.OnAction(action_id, player, ctx);
11788 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11789 {
11790 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11791 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11792 PlayerBase p = PlayerBase.Cast(player);
11793 if (
EActions.RECIPES_RANGE_START < 1000)
11794 {
11795 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11796 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11797 }
11798 }
11799 #ifndef SERVER
11800 else if (action_id ==
EActions.WATCH_PLAYER)
11801 {
11802 PluginDeveloper.SetDeveloperItemClientEx(player);
11803 }
11804 #endif
11806 {
11807 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11808 {
11809 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11810 OnDebugButtonPressServer(id + 1);
11811 }
11812
11813 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11814 {
11815 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11817 }
11818
11819 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11820 {
11821 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11823 }
11824
11825 else if (action_id ==
EActions.ADD_QUANTITY)
11826 {
11827 if (IsMagazine())
11828 {
11829 Magazine mag = Magazine.Cast(this);
11830 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11831 }
11832 else
11833 {
11835 }
11836
11837 if (m_EM)
11838 {
11839 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11840 }
11841
11842 }
11843
11844 else if (action_id ==
EActions.REMOVE_QUANTITY)
11845 {
11846 if (IsMagazine())
11847 {
11848 Magazine mag2 = Magazine.Cast(this);
11849 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11850 }
11851 else
11852 {
11854 }
11855 if (m_EM)
11856 {
11857 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11858 }
11859
11860 }
11861
11862 else if (action_id ==
EActions.SET_QUANTITY_0)
11863 {
11865
11866 if (m_EM)
11867 {
11868 m_EM.SetEnergy(0);
11869 }
11870 }
11871
11872 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11873 {
11875
11876 if (m_EM)
11877 {
11878 m_EM.SetEnergy(m_EM.GetEnergyMax());
11879 }
11880 }
11881
11882 else if (action_id ==
EActions.ADD_HEALTH)
11883 {
11884 AddHealth("","",GetMaxHealth("","Health")/5);
11885 }
11886 else if (action_id ==
EActions.REMOVE_HEALTH)
11887 {
11888 AddHealth("","",-GetMaxHealth("","Health")/5);
11889 }
11890 else if (action_id ==
EActions.DESTROY_HEALTH)
11891 {
11892 SetHealth01("","",0);
11893 }
11894 else if (action_id ==
EActions.WATCH_ITEM)
11895 {
11897 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11898 #ifdef DEVELOPER
11899 SetDebugDeveloper_item(this);
11900 #endif
11901 }
11902
11903 else if (action_id ==
EActions.ADD_TEMPERATURE)
11904 {
11905 AddTemperature(20);
11906
11907 }
11908
11909 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11910 {
11911 AddTemperature(-20);
11912
11913 }
11914
11915 else if (action_id ==
EActions.FLIP_FROZEN)
11916 {
11917 SetFrozen(!GetIsFrozen());
11918
11919 }
11920
11921 else if (action_id ==
EActions.ADD_WETNESS)
11922 {
11924
11925 }
11926
11927 else if (action_id ==
EActions.REMOVE_WETNESS)
11928 {
11930
11931 }
11932
11933 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11934 {
11937
11938
11939 }
11940
11941 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11942 {
11945 }
11946
11947 else if (action_id ==
EActions.MAKE_SPECIAL)
11948 {
11949 auto debugParams = DebugSpawnParams.WithPlayer(player);
11950 OnDebugSpawnEx(debugParams);
11951 }
11952
11953 else if (action_id ==
EActions.DELETE)
11954 {
11955 Delete();
11956 }
11957
11958 }
11959
11960
11961 return false;
11962 }
11963
11964
11965
11966
11970
11973
11974
11975
11977 {
11978 return false;
11979 }
11980
11981
11983 {
11984 return true;
11985 }
11986
11987
11989 {
11990 return true;
11991 }
11992
11993
11994
11996 {
11997 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11999 }
12000
12003 {
12004 return null;
12005 }
12006
12008 {
12009 return false;
12010 }
12011
12013 {
12014 return false;
12015 }
12016
12020
12021
12023 {
12024 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12025 return module_repairing.CanRepair(this, item_repair_kit);
12026 }
12027
12028
12029 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12030 {
12031 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12032 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12033 }
12034
12035
12037 {
12038
12039
12040
12041
12042
12043
12044
12045
12046 return 1;
12047 }
12048
12049
12050
12052 {
12054 }
12055
12056
12057
12059 {
12061 }
12062
12063
12072 {
12073 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12074
12075 if (player)
12076 {
12077 player.MessageStatus(text);
12078 }
12079 }
12080
12081
12090 {
12091 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12092
12093 if (player)
12094 {
12095 player.MessageAction(text);
12096 }
12097 }
12098
12099
12108 {
12109 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12110
12111 if (player)
12112 {
12113 player.MessageFriendly(text);
12114 }
12115 }
12116
12117
12126 {
12127 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12128
12129 if (player)
12130 {
12131 player.MessageImportant(text);
12132 }
12133 }
12134
12136 {
12137 return true;
12138 }
12139
12140
12141 override bool KindOf(
string tag)
12142 {
12143 bool found = false;
12144 string item_name = this.
GetType();
12147
12148 int array_size = item_tag_array.Count();
12149 for (int i = 0; i < array_size; i++)
12150 {
12151 if (item_tag_array.Get(i) == tag)
12152 {
12153 found = true;
12154 break;
12155 }
12156 }
12157 return found;
12158 }
12159
12160
12162 {
12163
12164 super.OnRPC(sender, rpc_type,ctx);
12165
12166
12167 switch (rpc_type)
12168 {
12169 #ifndef SERVER
12170 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12171 Param2<bool, string> p = new Param2<bool, string>(false, "");
12172
12174 return;
12175
12176 bool play = p.param1;
12177 string soundSet = p.param2;
12178
12179 if (play)
12180 {
12182 {
12184 {
12186 }
12187 }
12188 else
12189 {
12191 }
12192 }
12193 else
12194 {
12196 }
12197
12198 break;
12199 #endif
12200
12201 }
12202
12204 {
12206 }
12207 }
12208
12209
12210
12211
12213 {
12214 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12215 return plugin.GetID(
name);
12216 }
12217
12219 {
12220 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12221 return plugin.GetName(id);
12222 }
12223
12226 {
12227
12228
12229 int varFlags;
12230 if (!ctx.
Read(varFlags))
12231 return;
12232
12233 if (varFlags & ItemVariableFlags.FLOAT)
12234 {
12236 }
12237 }
12238
12240 {
12241
12242 super.SerializeNumericalVars(floats_out);
12243
12244
12245
12247 {
12249 }
12250
12252 {
12254 }
12255
12257 {
12259 }
12260
12262 {
12267 }
12268
12270 {
12272 }
12273 }
12274
12276 {
12277
12278 super.DeSerializeNumericalVars(floats);
12279
12280
12281 int index = 0;
12282 int mask = Math.Round(floats.Get(index));
12283
12284 index++;
12285
12287 {
12289 {
12291 }
12292 else
12293 {
12294 float quantity = floats.Get(index);
12295 SetQuantity(quantity,
true,
false,
false,
false);
12296 }
12297 index++;
12298 }
12299
12301 {
12302 float wet = floats.Get(index);
12304 index++;
12305 }
12306
12308 {
12309 int liquidtype = Math.Round(floats.Get(index));
12311 index++;
12312 }
12313
12315 {
12317 index++;
12319 index++;
12321 index++;
12323 index++;
12324 }
12325
12327 {
12328 int cleanness = Math.Round(floats.Get(index));
12330 index++;
12331 }
12332 }
12333
12335 {
12336 super.WriteVarsToCTX(ctx);
12337
12338
12340 {
12342 }
12343
12345 {
12347 }
12348
12350 {
12352 }
12353
12355 {
12356 int r,g,b,a;
12362 }
12363
12365 {
12367 }
12368 }
12369
12371 {
12372 if (!super.ReadVarsFromCTX(ctx,version))
12373 return false;
12374
12375 int intValue;
12376 float value;
12377
12378 if (version < 140)
12379 {
12380 if (!ctx.
Read(intValue))
12381 return false;
12382
12383 m_VariablesMask = intValue;
12384 }
12385
12387 {
12388 if (!ctx.
Read(value))
12389 return false;
12390
12392 {
12394 }
12395 else
12396 {
12398 }
12399 }
12400
12401 if (version < 140)
12402 {
12404 {
12405 if (!ctx.
Read(value))
12406 return false;
12407 SetTemperatureDirect(value);
12408 }
12409 }
12410
12412 {
12413 if (!ctx.
Read(value))
12414 return false;
12416 }
12417
12419 {
12420 if (!ctx.
Read(intValue))
12421 return false;
12423 }
12424
12426 {
12427 int r,g,b,a;
12429 return false;
12431 return false;
12433 return false;
12435 return false;
12436
12438 }
12439
12441 {
12442 if (!ctx.
Read(intValue))
12443 return false;
12445 }
12446
12447 if (version >= 138 && version < 140)
12448 {
12450 {
12451 if (!ctx.
Read(intValue))
12452 return false;
12453 SetFrozen(intValue);
12454 }
12455 }
12456
12457 return true;
12458 }
12459
12460
12462 {
12465 {
12467 }
12468
12469 if (!super.OnStoreLoad(ctx, version))
12470 {
12472 return false;
12473 }
12474
12475 if (version >= 114)
12476 {
12477 bool hasQuickBarIndexSaved;
12478
12479 if (!ctx.
Read(hasQuickBarIndexSaved))
12480 {
12482 return false;
12483 }
12484
12485 if (hasQuickBarIndexSaved)
12486 {
12487 int itmQBIndex;
12488
12489
12490 if (!ctx.
Read(itmQBIndex))
12491 {
12493 return false;
12494 }
12495
12496 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12497 if (itmQBIndex != -1 && parentPlayer)
12498 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12499 }
12500 }
12501 else
12502 {
12503
12504 PlayerBase player;
12505 int itemQBIndex;
12506 if (version ==
int.
MAX)
12507 {
12508 if (!ctx.
Read(itemQBIndex))
12509 {
12511 return false;
12512 }
12513 }
12514 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12515 {
12516
12517 if (!ctx.
Read(itemQBIndex))
12518 {
12520 return false;
12521 }
12522 if (itemQBIndex != -1 && player)
12523 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12524 }
12525 }
12526
12527 if (version < 140)
12528 {
12529
12530 if (!LoadVariables(ctx, version))
12531 {
12533 return false;
12534 }
12535 }
12536
12537
12539 {
12541 return false;
12542 }
12543 if (version >= 132)
12544 {
12546 if (raib)
12547 {
12549 {
12551 return false;
12552 }
12553 }
12554 }
12555
12557 return true;
12558 }
12559
12560
12561
12563 {
12564 super.OnStoreSave(ctx);
12565
12566 PlayerBase player;
12567 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12568 {
12570
12571 int itemQBIndex = -1;
12572 itemQBIndex = player.FindQuickBarEntityIndex(this);
12573 ctx.
Write(itemQBIndex);
12574 }
12575 else
12576 {
12578 }
12579
12581
12583 if (raib)
12584 {
12586 }
12587 }
12588
12589
12591 {
12592 super.AfterStoreLoad();
12593
12595 {
12597 }
12598
12600 {
12603 }
12604 }
12605
12607 {
12608 super.EEOnAfterLoad();
12609
12611 {
12613 }
12614
12617 }
12618
12620 {
12621 return false;
12622 }
12623
12624
12625
12627 {
12629 {
12630 #ifdef PLATFORM_CONSOLE
12631
12633 {
12635 if (menu)
12636 {
12638 }
12639 }
12640 #endif
12641 }
12642
12644 {
12647 }
12648
12650 {
12651 SetWeightDirty();
12653 }
12655 {
12658 }
12659
12661 {
12664 }
12666 {
12669 }
12670
12671 super.OnVariablesSynchronized();
12672 }
12673
12674
12675
12677 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12678 {
12679 if (!IsServerCheck(allow_client))
12680 return false;
12681
12683 return false;
12684
12687
12688 if (value <= (min + 0.001))
12689 value = min;
12690
12691 if (value == min)
12692 {
12693 if (destroy_config)
12694 {
12695 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12696 if (dstr)
12697 {
12699 this.Delete();
12700 return true;
12701 }
12702 }
12703 else if (destroy_forced)
12704 {
12706 this.Delete();
12707 return true;
12708 }
12709
12711 }
12712
12715
12717 {
12719
12720 if (delta)
12722 }
12723
12725
12726 return false;
12727 }
12728
12729
12731 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12732 {
12734 }
12735
12737 {
12740 }
12741
12743 {
12746 }
12747
12750 {
12751 float value_clamped = Math.Clamp(value, 0, 1);
12753 SetQuantity(result, destroy_config, destroy_forced);
12754 }
12755
12756
12759 {
12761 }
12762
12764 {
12766 }
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12778 {
12779 int slot = -1;
12780 if (GetInventory())
12781 {
12782 InventoryLocation il = new InventoryLocation;
12783 GetInventory().GetCurrentInventoryLocation(il);
12785 }
12786
12788 }
12789
12791 {
12792 float quantity_max = 0;
12793
12795 {
12796 if (attSlotID != -1)
12797 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12798
12799 if (quantity_max <= 0)
12801 }
12802
12803 if (quantity_max <= 0)
12805
12806 return quantity_max;
12807 }
12808
12810 {
12812 }
12813
12815 {
12817 }
12818
12819
12821 {
12823 }
12824
12826 {
12828 }
12829
12831 {
12833 }
12834
12835
12837 {
12838
12839 float weightEx = GetWeightEx();
12840 float special = GetInventoryAndCargoWeight();
12841 return weightEx - special;
12842 }
12843
12844
12846 {
12848 }
12849
12851 {
12853 {
12854 #ifdef DEVELOPER
12855 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12856 {
12857 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12859 }
12860 #endif
12861
12862 return GetQuantity() * GetConfigWeightModified();
12863 }
12864 else if (HasEnergyManager())
12865 {
12866 #ifdef DEVELOPER
12867 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12868 {
12869 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12870 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12871 }
12872 #endif
12873 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12874 }
12875 else
12876 {
12877 #ifdef DEVELOPER
12878 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12879 {
12880 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12881 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12882 }
12883 #endif
12884 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12885 }
12886 }
12887
12890 {
12891 int item_count = 0;
12893
12894 if (GetInventory().GetCargo() != NULL)
12895 {
12896 item_count = GetInventory().GetCargo().GetItemCount();
12897 }
12898
12899 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12900 {
12901 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12902 if (item)
12903 item_count += item.GetNumberOfItems();
12904 }
12905 return item_count;
12906 }
12907
12910 {
12911 float weight = 0;
12912 float wetness = 1;
12913 if (include_wetness)
12916 {
12917 weight = wetness * m_ConfigWeight;
12918 }
12920 {
12921 weight = 1;
12922 }
12923 return weight;
12924 }
12925
12926
12927
12929 {
12930 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12931 {
12932 GameInventory inv = GetInventory();
12933 array<EntityAI> items = new array<EntityAI>;
12935 for (int i = 0; i < items.Count(); i++)
12936 {
12938 if (item)
12939 {
12941 }
12942 }
12943 }
12944 }
12945
12946
12947
12948
12950 {
12951 float energy = 0;
12952 if (HasEnergyManager())
12953 {
12954 energy = GetCompEM().GetEnergy();
12955 }
12956 return energy;
12957 }
12958
12959
12961 {
12962 super.OnEnergyConsumed();
12963
12965 }
12966
12968 {
12969 super.OnEnergyAdded();
12970
12972 }
12973
12974
12976 {
12977 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12978 {
12980 {
12981 float energy_0to1 = GetCompEM().GetEnergy0To1();
12983 }
12984 }
12985 }
12986
12987
12989 {
12990 return ConfigGetFloat("heatIsolation");
12991 }
12992
12994 {
12996 }
12997
12999 {
13000 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13001 if (
GetGame().ConfigIsExisting(paramPath))
13003
13004 return 0.0;
13005 }
13006
13008 {
13009 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13010 if (
GetGame().ConfigIsExisting(paramPath))
13012
13013 return 0.0;
13014 }
13015
13016 override void SetWet(
float value,
bool allow_client =
false)
13017 {
13018 if (!IsServerCheck(allow_client))
13019 return;
13020
13023
13025
13026 m_VarWet = Math.Clamp(value, min, max);
13027
13029 {
13032 }
13033 }
13034
13035 override void AddWet(
float value)
13036 {
13038 }
13039
13041 {
13043 }
13044
13046 {
13048 }
13049
13051 {
13053 }
13054
13056 {
13058 }
13059
13061 {
13063 }
13064
13065 override void OnWetChanged(
float newVal,
float oldVal)
13066 {
13069 if (newLevel != oldLevel)
13070 {
13072 }
13073 }
13074
13076 {
13077 SetWeightDirty();
13078 }
13079
13081 {
13082 return GetWetLevelInternal(
m_VarWet);
13083 }
13084
13085
13086
13088 {
13090 }
13091
13093 {
13095 }
13096
13098 {
13100 }
13101
13103 {
13105 }
13106
13107
13108
13110 {
13111 if (ConfigIsExisting("itemModelLength"))
13112 {
13113 return ConfigGetFloat("itemModelLength");
13114 }
13115 return 0;
13116 }
13117
13119 {
13120 if (ConfigIsExisting("itemAttachOffset"))
13121 {
13122 return ConfigGetFloat("itemAttachOffset");
13123 }
13124 return 0;
13125 }
13126
13127 override void SetCleanness(
int value,
bool allow_client =
false)
13128 {
13129 if (!IsServerCheck(allow_client))
13130 return;
13131
13133
13135
13138 }
13139
13141 {
13143 }
13144
13146 {
13147 return true;
13148 }
13149
13150
13151
13152
13154 {
13156 }
13157
13159 {
13161 }
13162
13163
13164
13165
13166 override void SetColor(
int r,
int g,
int b,
int a)
13167 {
13173 }
13175 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13176 {
13181 }
13182
13184 {
13186 }
13187
13190 {
13191 int r,g,b,a;
13193 r = r/255;
13194 g = g/255;
13195 b = b/255;
13196 a = a/255;
13197 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13198 }
13199
13200
13201
13202 override void SetLiquidType(
int value,
bool allow_client =
false)
13203 {
13204 if (!IsServerCheck(allow_client))
13205 return;
13206
13211 }
13212
13214 {
13215 return ConfigGetInt("varLiquidTypeInit");
13216 }
13217
13219 {
13221 }
13222
13224 {
13226 SetFrozen(false);
13227 }
13228
13231 {
13232 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13233 }
13234
13235
13238 {
13239 PlayerBase nplayer;
13240 if (PlayerBase.CastTo(nplayer, player))
13241 {
13243
13244 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13245 }
13246 }
13247
13248
13251 {
13252 PlayerBase nplayer;
13253 if (PlayerBase.CastTo(nplayer,player))
13254 {
13255
13256 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13257
13258 }
13259
13260
13261 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13262
13263
13264 if (HasEnergyManager())
13265 {
13266 GetCompEM().UpdatePlugState();
13267 }
13268 }
13269
13270
13272 {
13273 super.OnPlacementStarted(player);
13274
13276 }
13277
13278 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13279 {
13281 {
13282 m_AdminLog.OnPlacementComplete(player,
this);
13283 }
13284
13285 super.OnPlacementComplete(player, position, orientation);
13286 }
13287
13288
13289
13290
13291
13293 {
13295 {
13296 return true;
13297 }
13298 else
13299 {
13300 return false;
13301 }
13302 }
13303
13304
13306 {
13308 {
13310 }
13311 }
13312
13313
13315 {
13317 }
13318
13320 {
13322 }
13323
13324 override void InsertAgent(
int agent,
float count = 1)
13325 {
13326 if (count < 1)
13327 return;
13328
13330 }
13331
13334 {
13336 }
13337
13338
13340 {
13342 }
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13386 {
13388 return false;
13389 return true;
13390 }
13391
13393 {
13394
13396 }
13397
13398
13401 {
13402 super.CheckForRoofLimited(timeTresholdMS);
13403
13405 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13406 {
13407 m_PreviousRoofTestTime = time;
13408 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13409 }
13410 }
13411
13412
13414 {
13416 {
13417 return 0;
13418 }
13419
13420 if (GetInventory().GetAttachmentSlotsCount() != 0)
13421 {
13422 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13423 if (filter)
13424 return filter.GetProtectionLevel(type, false, system);
13425 else
13426 return 0;
13427 }
13428
13429 string subclassPath, entryName;
13430
13431 switch (type)
13432 {
13434 entryName = "biological";
13435 break;
13437 entryName = "chemical";
13438 break;
13439 default:
13440 entryName = "biological";
13441 break;
13442 }
13443
13444 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13445
13447 }
13448
13449
13450
13453 {
13454 if (!IsMagazine())
13456
13458 }
13459
13460
13461
13462
13463
13468 {
13469 return true;
13470 }
13471
13473 {
13475 }
13476
13477
13478
13479
13480
13482 {
13483 if (parent)
13484 {
13485 if (parent.IsInherited(DayZInfected))
13486 return true;
13487
13488 if (!parent.IsRuined())
13489 return true;
13490 }
13491
13492 return true;
13493 }
13494
13496 {
13497 if (!super.CanPutAsAttachment(parent))
13498 {
13499 return false;
13500 }
13501
13502 if (!IsRuined() && !parent.IsRuined())
13503 {
13504 return true;
13505 }
13506
13507 return false;
13508 }
13509
13511 {
13512
13513
13514
13515
13516 return super.CanReceiveItemIntoCargo(item);
13517 }
13518
13520 {
13521
13522
13523
13524
13525 GameInventory attachmentInv = attachment.GetInventory();
13527 {
13528 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13529 return false;
13530 }
13531
13532 InventoryLocation loc = new InventoryLocation();
13533 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13534 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13535 return false;
13536
13537 return super.CanReceiveAttachment(attachment, slotId);
13538 }
13539
13541 {
13542 if (!super.CanReleaseAttachment(attachment))
13543 return false;
13544
13545 return GetInventory().AreChildrenAccessible();
13546 }
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13569 {
13570 int id = muzzle_owner.GetMuzzleID();
13571 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13572
13573 if (WPOF_array)
13574 {
13575 for (int i = 0; i < WPOF_array.Count(); i++)
13576 {
13577 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13578
13579 if (WPOF)
13580 {
13581 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13582 }
13583 }
13584 }
13585 }
13586
13587
13589 {
13590 int id = muzzle_owner.GetMuzzleID();
13592
13593 if (WPOBE_array)
13594 {
13595 for (int i = 0; i < WPOBE_array.Count(); i++)
13596 {
13597 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13598
13599 if (WPOBE)
13600 {
13601 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13602 }
13603 }
13604 }
13605 }
13606
13607
13609 {
13610 int id = muzzle_owner.GetMuzzleID();
13611 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13612
13613 if (WPOOH_array)
13614 {
13615 for (int i = 0; i < WPOOH_array.Count(); i++)
13616 {
13617 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13618
13619 if (WPOOH)
13620 {
13621 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13622 }
13623 }
13624 }
13625 }
13626
13627
13629 {
13630 int id = muzzle_owner.GetMuzzleID();
13631 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13632
13633 if (WPOOH_array)
13634 {
13635 for (int i = 0; i < WPOOH_array.Count(); i++)
13636 {
13637 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13638
13639 if (WPOOH)
13640 {
13641 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13642 }
13643 }
13644 }
13645 }
13646
13647
13649 {
13650 int id = muzzle_owner.GetMuzzleID();
13651 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13652
13653 if (WPOOH_array)
13654 {
13655 for (int i = 0; i < WPOOH_array.Count(); i++)
13656 {
13657 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13658
13659 if (WPOOH)
13660 {
13661 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13662 }
13663 }
13664 }
13665 }
13666
13667
13668
13670 {
13672 {
13673 return true;
13674 }
13675
13676 return false;
13677 }
13678
13680 {
13682 {
13683 return true;
13684 }
13685
13686 return false;
13687 }
13688
13690 {
13692 {
13693 return true;
13694 }
13695
13696 return false;
13697 }
13698
13700 {
13701 return false;
13702 }
13703
13706 {
13707 return UATimeSpent.DEFAULT_DEPLOY;
13708 }
13709
13710
13711
13712
13714 {
13716 SetSynchDirty();
13717 }
13718
13720 {
13722 }
13723
13724
13726 {
13727 return false;
13728 }
13729
13732 {
13733 string att_type = "None";
13734
13735 if (ConfigIsExisting("soundAttType"))
13736 {
13737 att_type = ConfigGetString("soundAttType");
13738 }
13739
13741 }
13742
13744 {
13746 }
13747
13748
13749
13750
13751
13755
13757 {
13760
13762 }
13763
13764
13766 {
13768 return;
13769
13771
13774
13777
13778 SoundParameters params = new SoundParameters();
13782 }
13783
13784
13786 {
13788 return;
13789
13791 SetSynchDirty();
13792
13795 }
13796
13797
13799 {
13801 return;
13802
13804 SetSynchDirty();
13805
13808 }
13809
13811 {
13813 }
13814
13816 {
13818 }
13819
13822 {
13823 if (!
GetGame().IsDedicatedServer())
13824 {
13825 if (ConfigIsExisting("attachSoundSet"))
13826 {
13827 string cfg_path = "";
13828 string soundset = "";
13829 string type_name =
GetType();
13830
13833 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13834 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13835
13836 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13837 {
13838 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13839 {
13840 if (cfg_slot_array[i] == slot_type)
13841 {
13842 soundset = cfg_soundset_array[i];
13843 break;
13844 }
13845 }
13846 }
13847
13848 if (soundset != "")
13849 {
13850 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13852 }
13853 }
13854 }
13855 }
13856
13858 {
13859
13860 }
13861
13862 void OnApply(PlayerBase player);
13863
13865 {
13866 return 1.0;
13867 };
13868
13870 {
13872 }
13873
13875 {
13877 }
13878
13880
13882 {
13883 SetDynamicPhysicsLifeTime(0.01);
13885 }
13886
13888 {
13889 array<string> zone_names = new array<string>;
13890 GetDamageZones(zone_names);
13891 for (int i = 0; i < zone_names.Count(); i++)
13892 {
13893 SetHealthMax(zone_names.Get(i),"Health");
13894 }
13895 SetHealthMax("","Health");
13896 }
13897
13900 {
13901 float global_health = GetHealth01("","Health");
13902 array<string> zones = new array<string>;
13903 GetDamageZones(zones);
13904
13905 for (int i = 0; i < zones.Count(); i++)
13906 {
13907 SetHealth01(zones.Get(i),"Health",global_health);
13908 }
13909 }
13910
13913 {
13914 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13915 }
13916
13918 {
13919 if (!hasRootAsPlayer)
13920 {
13921 if (refParentIB)
13922 {
13923
13924 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13925 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13926
13927 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13928 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13929
13932 }
13933 else
13934 {
13935
13938 }
13939 }
13940 }
13941
13943 {
13945 {
13946 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13947 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13948 {
13949 float heatPermCoef = 1.0;
13951 while (ent)
13952 {
13953 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13954 ent = ent.GetHierarchyParent();
13955 }
13956
13957 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13958 }
13959 }
13960 }
13961
13963 {
13964
13965 EntityAI parent = GetHierarchyParent();
13966 if (!parent)
13967 {
13968 hasParent = false;
13969 hasRootAsPlayer = false;
13970 }
13971 else
13972 {
13973 hasParent = true;
13974 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13975 refParentIB =
ItemBase.Cast(parent);
13976 }
13977 }
13978
13979 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13980 {
13981
13982 }
13983
13985 {
13986
13987 return false;
13988 }
13989
13991 {
13992
13993
13994 return false;
13995 }
13996
13998 {
13999
14000 return false;
14001 }
14002
14005 {
14006 return !GetIsFrozen() &&
IsOpen();
14007 }
14008
14010 {
14011 bool hasParent = false, hasRootAsPlayer = false;
14013
14014 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14015 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14016
14017 if (wwtu || foodDecay)
14018 {
14022
14023 if (processWetness || processTemperature || processDecay)
14024 {
14026
14027 if (processWetness)
14028 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14029
14030 if (processTemperature)
14032
14033 if (processDecay)
14034 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14035 }
14036 }
14037 }
14038
14041 {
14043 }
14044
14046 {
14049
14050 return super.GetTemperatureFreezeThreshold();
14051 }
14052
14054 {
14057
14058 return super.GetTemperatureThawThreshold();
14059 }
14060
14062 {
14065
14066 return super.GetItemOverheatThreshold();
14067 }
14068
14070 {
14072 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14073
14074 return super.GetTemperatureFreezeTime();
14075 }
14076
14078 {
14080 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14081
14082 return super.GetTemperatureThawTime();
14083 }
14084
14089
14091 {
14092 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14093 }
14094
14096 {
14097 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14098 }
14099
14102 {
14104 }
14105
14107 {
14109 }
14110
14112 {
14114 }
14115
14118 {
14119 return null;
14120 }
14121
14124 {
14125 return false;
14126 }
14127
14129 {
14131 {
14134 if (!trg)
14135 {
14137 explosive = this;
14138 }
14139
14140 explosive.PairRemote(trg);
14142
14143 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14144 trg.SetPersistentPairID(persistentID);
14145 explosive.SetPersistentPairID(persistentID);
14146
14147 return true;
14148 }
14149 return false;
14150 }
14151
14154 {
14155 float ret = 1.0;
14158 ret *= GetHealth01();
14159
14160 return ret;
14161 }
14162
14163 #ifdef DEVELOPER
14164 override void SetDebugItem()
14165 {
14166 super.SetDebugItem();
14167 _itemBase = this;
14168 }
14169
14171 {
14172 string text = super.GetDebugText();
14173
14175 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14176
14177 return text;
14178 }
14179 #endif
14180
14182 {
14183 return true;
14184 }
14185
14187
14189
14191 {
14194 }
14195
14196
14204
14220}
14221
14223{
14225 if (entity)
14226 {
14227 bool is_item = entity.IsInherited(
ItemBase);
14228 if (is_item && full_quantity)
14229 {
14232 }
14233 }
14234 else
14235 {
14237 return NULL;
14238 }
14239 return entity;
14240}
14241
14243{
14244 if (item)
14245 {
14246 if (health > 0)
14247 item.SetHealth("", "", health);
14248
14249 if (item.CanHaveTemperature())
14250 {
14252 if (item.CanFreeze())
14253 item.SetFrozen(false);
14254 }
14255
14256 if (item.HasEnergyManager())
14257 {
14258 if (quantity >= 0)
14259 {
14260 item.GetCompEM().SetEnergy0To1(quantity);
14261 }
14262 else
14263 {
14265 }
14266 }
14267 else if (item.IsMagazine())
14268 {
14269 Magazine mag = Magazine.Cast(item);
14270 if (quantity >= 0)
14271 {
14272 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14273 }
14274 else
14275 {
14277 }
14278
14279 }
14280 else
14281 {
14282 if (quantity >= 0)
14283 {
14284 item.SetQuantityNormalized(quantity, false);
14285 }
14286 else
14287 {
14289 }
14290
14291 }
14292 }
14293}
14294
14295#ifdef DEVELOPER
14297#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.