Adds a light source child.
9434{
9436 {
9437 return true;
9438 }
9439};
9440
9441
9442
9444{
9448
9450
9453
9454
9455
9456
9457
9466
9472
9477
9482
9503 protected bool m_IsResultOfSplit
9504
9506
9511
9512
9513
9515
9519
9520
9521
9523
9526
9527
9528
9534
9535
9543
9546
9547
9549
9550
9552
9553
9558
9559
9564
9565
9567
9568
9570 {
9575
9576 if (!
GetGame().IsDedicatedServer())
9577 {
9579 {
9581
9583 {
9585 }
9586 }
9587
9590 }
9591
9592 m_OldLocation = null;
9593
9595 {
9597 }
9598
9599 if (ConfigIsExisting("headSelectionsToHide"))
9600 {
9603 }
9604
9606 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9607 {
9609 }
9610
9612
9613 m_IsResultOfSplit = false;
9614
9616 }
9617
9619 {
9620 super.InitItemVariables();
9621
9627 m_Count = ConfigGetInt(
"count");
9628
9631
9636
9639
9644
9656
9660
9661
9664 if (ConfigIsExisting("canBeSplit"))
9665 {
9668 }
9669
9671 if (ConfigIsExisting("itemBehaviour"))
9673
9674
9677 RegisterNetSyncVariableInt("m_VarLiquidType");
9678 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9679
9680 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9681 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9682 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9683
9684 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9685 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9686 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9687 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9688
9689 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9690 RegisterNetSyncVariableBool("m_IsTakeable");
9691 RegisterNetSyncVariableBool("m_IsHologram");
9692
9695 {
9698 }
9699
9701
9703 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9705
9706 }
9707
9709 {
9711 }
9712
9714 {
9717 {
9722 }
9723 }
9724
9725 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9726 {
9728 {
9731 }
9732
9734 }
9735
9737 {
9743 }
9744
9746
9748 {
9750
9751 if (!action)
9752 {
9753 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9754 return;
9755 }
9756
9758 if (!ai)
9759 {
9761 return;
9762 }
9763
9765 if (!action_array)
9766 {
9767 action_array = new array<ActionBase_Basic>;
9769 }
9770 if (LogManager.IsActionLogEnable())
9771 {
9772 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9773 }
9774
9775 if (action_array.Find(action) != -1)
9776 {
9777 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9778 }
9779 else
9780 {
9781 action_array.Insert(action);
9782 }
9783 }
9784
9786 {
9788 ActionBase action = player.GetActionManager().GetAction(actionName);
9791
9792 if (action_array)
9793 {
9794 action_array.RemoveItem(action);
9795 }
9796 }
9797
9798
9799
9801 {
9802 ActionOverrideData overrideData = new ActionOverrideData();
9806
9808 if (!actionMap)
9809 {
9812 }
9813
9814 actionMap.Insert(this.
Type(), overrideData);
9815
9816 }
9817
9819
9821
9822
9824 {
9827
9830
9831 string config_to_search = "CfgVehicles";
9832 string muzzle_owner_config;
9833
9835 {
9836 if (IsInherited(Weapon))
9837 config_to_search = "CfgWeapons";
9838
9839 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9840
9841 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9842
9844
9845 if (config_OnFire_subclass_count > 0)
9846 {
9847 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9848
9849 for (int i = 0; i < config_OnFire_subclass_count; i++)
9850 {
9851 string particle_class = "";
9853 string config_OnFire_entry = config_OnFire_class + particle_class;
9854 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9855 WPOF_array.Insert(WPOF);
9856 }
9857
9858
9860 }
9861 }
9862
9864 {
9865 config_to_search = "CfgWeapons";
9866 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9867
9868 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9869
9871
9872 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9873 {
9874 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9875
9876 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9877 {
9878 string particle_class2 = "";
9880 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9881 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9882 WPOBE_array.Insert(WPOBE);
9883 }
9884
9885
9887 }
9888 }
9889 }
9890
9891
9893 {
9896
9898 {
9899 string config_to_search = "CfgVehicles";
9900
9901 if (IsInherited(Weapon))
9902 config_to_search = "CfgWeapons";
9903
9904 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9905 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9906
9907 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9908 {
9909
9911
9913 {
9915 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9917 return;
9918 }
9919
9922
9923
9924
9926 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9927
9928 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9929 {
9930 string particle_class = "";
9932 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9934
9935 if (entry_type == CT_CLASS)
9936 {
9937 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9938 WPOOH_array.Insert(WPOF);
9939 }
9940 }
9941
9942
9944 }
9945 }
9946 }
9947
9949 {
9951 }
9952
9954 {
9956 {
9958
9961
9964
9965 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9966 }
9967 }
9968
9970 {
9972 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9973
9975 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9976
9978 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9979
9981 {
9983 }
9984 }
9985
9987 {
9989 }
9990
9992 {
9995 else
9997
9999 {
10002 }
10003 else
10004 {
10007
10010 }
10011
10013 }
10014
10016 {
10018 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10019 }
10020
10022 {
10024 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10026 }
10027
10029 {
10031 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10032 }
10033
10035 {
10038
10039 OverheatingParticle OP = new OverheatingParticle();
10044
10046 }
10047
10049 {
10052
10053 return -1;
10054 }
10055
10057 {
10059 {
10062
10063 for (int i = count; i > 0; --i)
10064 {
10065 int id = i - 1;
10068
10071
10072 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10073 {
10074 if (p)
10075 {
10078 }
10079 }
10080 }
10081 }
10082 }
10083
10085 {
10087 {
10089 {
10090 int id = i - 1;
10092
10093 if (OP)
10094 {
10096
10097 if (p)
10098 {
10100 }
10101
10102 delete OP;
10103 }
10104 }
10105
10108 }
10109 }
10110
10113 {
10114 return 0.0;
10115 }
10116
10117
10119 {
10120 return 250;
10121 }
10122
10124 {
10125 return 0;
10126 }
10127
10130 {
10132 return true;
10133
10134 return false;
10135 }
10136
10139 {
10142
10144 {
10146 }
10147 else
10148 {
10149
10151 }
10152
10154 }
10155
10162 {
10163 return -1;
10164 }
10165
10166
10167
10168
10170 {
10172 {
10174 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10175
10176 if (r_index >= 0)
10177 {
10178 InventoryLocation r_il = new InventoryLocation;
10179 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10180
10181 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10184 {
10185 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10186 }
10188 {
10189 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10190 }
10191
10192 }
10193
10194 player.GetHumanInventory().ClearUserReservedLocation(this);
10195 }
10196
10199 }
10200
10201
10202
10203
10205 {
10206 return ItemBase.m_DebugActionsMask;
10207 }
10208
10210 {
10211 return ItemBase.m_DebugActionsMask & mask;
10212 }
10213
10215 {
10216 ItemBase.m_DebugActionsMask = mask;
10217 }
10218
10220 {
10221 ItemBase.m_DebugActionsMask |= mask;
10222 }
10223
10225 {
10226 ItemBase.m_DebugActionsMask &= ~mask;
10227 }
10228
10230 {
10232 {
10234 }
10235 else
10236 {
10238 }
10239 }
10240
10241
10243 {
10244 if (GetEconomyProfile())
10245 {
10246 float q_max = GetEconomyProfile().GetQuantityMax();
10247 if (q_max > 0)
10248 {
10249 float q_min = GetEconomyProfile().GetQuantityMin();
10250 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10251
10253 {
10254 ComponentEnergyManager comp = GetCompEM();
10256 {
10258 }
10259 }
10261 {
10263
10264 }
10265
10266 }
10267 }
10268 }
10269
10272 {
10273 EntityAI parent = GetHierarchyParent();
10274
10275 if (parent)
10276 {
10277 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10278 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10279 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10280 }
10281 }
10282
10285 {
10286 EntityAI parent = GetHierarchyParent();
10287
10288 if (parent)
10289 {
10290 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10291 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10292 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10293 }
10294 }
10295
10297 {
10298
10299
10300
10301
10303
10305 {
10306 if (ScriptInputUserData.CanStoreInputUserData())
10307 {
10308 ScriptInputUserData ctx = new ScriptInputUserData;
10314 ctx.
Write(use_stack_max);
10317
10319 {
10320 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10321 }
10322 }
10323 }
10324 else if (!
GetGame().IsMultiplayer())
10325 {
10327 }
10328 }
10329
10331 {
10333 }
10334
10336 {
10338 }
10339
10341 {
10343 }
10344
10346 {
10347
10348 return false;
10349 }
10350
10352 {
10353 return false;
10354 }
10355
10359 {
10360 return false;
10361 }
10362
10364 {
10365 return "";
10366 }
10367
10369
10371 {
10372 return false;
10373 }
10374
10376 {
10377 return true;
10378 }
10379
10380
10381
10383 {
10384 return true;
10385 }
10386
10388 {
10389 return true;
10390 }
10391
10393 {
10394 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10396 }
10397
10399 {
10401 }
10402
10404 {
10406 if (!is_being_placed)
10408 SetSynchDirty();
10409 }
10410
10411
10413
10415 {
10417 }
10418
10420 {
10422 }
10423
10425 {
10426 return 1;
10427 }
10428
10430 {
10431 return false;
10432 }
10433
10435 {
10437 SetSynchDirty();
10438 }
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10475 {
10476 super.OnMovedInsideCargo(container);
10477
10478 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10479 }
10480
10481 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10482 {
10483 super.EEItemLocationChanged(oldLoc,newLoc);
10484
10485 PlayerBase new_player = null;
10486 PlayerBase old_player = null;
10487
10488 if (newLoc.GetParent())
10489 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10490
10491 if (oldLoc.GetParent())
10492 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10493
10495 {
10496 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10497
10498 if (r_index >= 0)
10499 {
10500 InventoryLocation r_il = new InventoryLocation;
10501 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10502
10503 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10506 {
10507 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10508 }
10510 {
10511 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10512 }
10513
10514 }
10515 }
10516
10518 {
10519 if (new_player)
10520 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10521
10522 if (new_player == old_player)
10523 {
10524
10525 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10526 {
10528 {
10529 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10530 {
10531 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10532 }
10533 }
10534 else
10535 {
10536 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10537 }
10538 }
10539
10540 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10541 {
10542 int type = oldLoc.GetType();
10544 {
10545 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10546 }
10548 {
10549 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10550 }
10551 }
10552 if (!m_OldLocation)
10553 {
10554 m_OldLocation = new InventoryLocation;
10555 }
10556 m_OldLocation.Copy(oldLoc);
10557 }
10558 else
10559 {
10560 if (m_OldLocation)
10561 {
10562 m_OldLocation.Reset();
10563 }
10564 }
10565
10567 }
10568 else
10569 {
10570 if (new_player)
10571 {
10572 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10573 if (res_index >= 0)
10574 {
10575 InventoryLocation il = new InventoryLocation;
10576 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10578 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10581 {
10582 il.
GetParent().GetOnReleaseLock().Invoke(it);
10583 }
10585 {
10587 }
10588
10589 }
10590 }
10592 {
10593
10595 }
10596
10597 if (m_OldLocation)
10598 {
10599 m_OldLocation.Reset();
10600 }
10601 }
10602 }
10603
10604 override void EOnContact(IEntity other, Contact extra)
10605 {
10607 {
10608 int liquidType = -1;
10610 if (impactSpeed > 0.0)
10611 {
10613 #ifndef SERVER
10615 #else
10617 SetSynchDirty();
10618 #endif
10620 }
10621 }
10622
10623 #ifdef SERVER
10624 if (GetCompEM() && GetCompEM().IsPlugged())
10625 {
10626 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10627 GetCompEM().UnplugThis();
10628 }
10629 #endif
10630 }
10631
10633
10635 {
10637 }
10638
10640 {
10641
10642 }
10643
10645 {
10646 super.OnItemLocationChanged(old_owner, new_owner);
10647
10648 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10649 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10650
10651 if (!relatedPlayer && playerNew)
10652 relatedPlayer = playerNew;
10653
10654 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10655 {
10657 if (actionMgr)
10658 {
10659 ActionBase currentAction = actionMgr.GetRunningAction();
10660 if (currentAction)
10662 }
10663 }
10664
10665 Man ownerPlayerOld = null;
10666 Man ownerPlayerNew = null;
10667
10668 if (old_owner)
10669 {
10670 if (old_owner.
IsMan())
10671 {
10672 ownerPlayerOld = Man.Cast(old_owner);
10673 }
10674 else
10675 {
10676 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10677 }
10678 }
10679 else
10680 {
10682 {
10684
10685 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10686 {
10687 GetCompEM().UnplugThis();
10688 }
10689 }
10690 }
10691
10692 if (new_owner)
10693 {
10694 if (new_owner.
IsMan())
10695 {
10696 ownerPlayerNew = Man.Cast(new_owner);
10697 }
10698 else
10699 {
10700 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10701 }
10702 }
10703
10704 if (ownerPlayerOld != ownerPlayerNew)
10705 {
10706 if (ownerPlayerOld)
10707 {
10708 array<EntityAI> subItemsExit = new array<EntityAI>;
10710 for (int i = 0; i < subItemsExit.Count(); i++)
10711 {
10714 }
10715 }
10716
10717 if (ownerPlayerNew)
10718 {
10719 array<EntityAI> subItemsEnter = new array<EntityAI>;
10721 for (int j = 0; j < subItemsEnter.Count(); j++)
10722 {
10725 }
10726 }
10727 }
10728 else if (ownerPlayerNew != null)
10729 {
10730 PlayerBase nplayer;
10731 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10732 {
10733 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10735 for (int k = 0; k < subItemsUpdate.Count(); k++)
10736 {
10738 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10739 }
10740 }
10741 }
10742
10743 if (old_owner)
10744 old_owner.OnChildItemRemoved(this);
10745 if (new_owner)
10746 new_owner.OnChildItemReceived(this);
10747 }
10748
10749
10751 {
10752 super.EEDelete(parent);
10753 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10754 if (player)
10755 {
10757
10758 if (player.IsAlive())
10759 {
10760 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10761 if (r_index >= 0)
10762 {
10763 InventoryLocation r_il = new InventoryLocation;
10764 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10765
10766 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10769 {
10770 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10771 }
10773 {
10774 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10775 }
10776
10777 }
10778
10779 player.RemoveQuickBarEntityShortcut(this);
10780 }
10781 }
10782 }
10783
10785 {
10786 super.EEKilled(killer);
10787
10790 {
10791 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10792 {
10793 if (IsMagazine())
10794 {
10795 if (Magazine.Cast(this).GetAmmoCount() > 0)
10796 {
10798 }
10799 }
10800 else
10801 {
10803 }
10804 }
10805 }
10806 }
10807
10809 {
10810 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10811
10812 super.OnWasAttached(parent, slot_id);
10813
10816
10818 }
10819
10821 {
10822 super.OnWasDetached(parent, slot_id);
10823
10826 }
10827
10829 {
10830 int idx;
10833
10834 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10835 if (inventory_slots.Count() < 1)
10836 {
10837 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10838 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10839 }
10840 else
10841 {
10842 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10843 }
10844
10845 idx = inventory_slots.Find(slot);
10846 if (idx < 0)
10847 return "";
10848
10849 return attach_types.Get(idx);
10850 }
10851
10853 {
10854 int idx = -1;
10855 string slot;
10856
10859
10860 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10861 if (inventory_slots.Count() < 1)
10862 {
10863 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10864 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10865 }
10866 else
10867 {
10868 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10869 if (detach_types.Count() < 1)
10870 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10871 }
10872
10873 for (int i = 0; i < inventory_slots.Count(); i++)
10874 {
10875 slot = inventory_slots.Get(i);
10876 }
10877
10878 if (slot != "")
10879 {
10880 if (detach_types.Count() == 1)
10881 idx = 0;
10882 else
10883 idx = inventory_slots.Find(slot);
10884 }
10885 if (idx < 0)
10886 return "";
10887
10888 return detach_types.Get(idx);
10889 }
10890
10892 {
10893
10895
10896
10897 float min_time = 1;
10898 float max_time = 3;
10899 float delay = Math.RandomFloat(min_time, max_time);
10900
10901 explode_timer.Run(delay, this, "DoAmmoExplosion");
10902 }
10903
10905 {
10906 Magazine magazine = Magazine.Cast(this);
10907 int pop_sounds_count = 6;
10908 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10909
10910
10911 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10912 string sound_name = pop_sounds[ sound_idx ];
10914
10915
10916 magazine.ServerAddAmmoCount(-1);
10917
10918
10919 float min_temp_to_explode = 100;
10920
10921 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10922 {
10924 }
10925 }
10926
10927
10928 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10929 {
10930 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10931
10932 const int CHANCE_DAMAGE_CARGO = 4;
10933 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10934 const int CHANCE_DAMAGE_NOTHING = 2;
10935
10937 {
10938 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10939 int chances;
10940 int rnd;
10941
10942 if (GetInventory().GetCargo())
10943 {
10944 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10945 rnd = Math.RandomInt(0,chances);
10946
10947 if (rnd < CHANCE_DAMAGE_CARGO)
10948 {
10950 }
10951 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10952 {
10954 }
10955 }
10956 else
10957 {
10958 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10959 rnd = Math.RandomInt(0,chances);
10960
10961 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10962 {
10964 }
10965 }
10966 }
10967 }
10968
10970 {
10971 if (GetInventory().GetCargo())
10972 {
10973 int item_count = GetInventory().GetCargo().GetItemCount();
10974 if (item_count > 0)
10975 {
10976 int random_pick = Math.RandomInt(0, item_count);
10978 if (!item.IsExplosive())
10979 {
10980 item.AddHealth("","",damage);
10981 return true;
10982 }
10983 }
10984 }
10985 return false;
10986 }
10987
10989 {
10990 int attachment_count = GetInventory().AttachmentCount();
10991 if (attachment_count > 0)
10992 {
10993 int random_pick = Math.RandomInt(0, attachment_count);
10994 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10995 if (!attachment.IsExplosive())
10996 {
10997 attachment.AddHealth("","",damage);
10998 return true;
10999 }
11000 }
11001 return false;
11002 }
11003
11005 {
11007 }
11008
11010 {
11012 return GetInventory().CanRemoveEntity();
11013
11014 return false;
11015 }
11016
11018 {
11020 return;
11021
11023 {
11024 if (ScriptInputUserData.CanStoreInputUserData())
11025 {
11026 ScriptInputUserData ctx = new ScriptInputUserData;
11031 ctx.
Write(destination_entity);
11033 ctx.
Write(slot_id);
11035 }
11036 }
11037 else if (!
GetGame().IsMultiplayer())
11038 {
11040 }
11041 }
11042
11044 {
11046 return;
11047
11048 float split_quantity_new;
11052 InventoryLocation loc = new InventoryLocation;
11053
11054 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11055 {
11057 split_quantity_new = stack_max;
11058 else
11060
11061 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11062 if (new_item)
11063 {
11064 new_item.SetResultOfSplit(true);
11065 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11067 new_item.SetQuantity(split_quantity_new);
11068 }
11069 }
11070 else if (destination_entity && slot_id == -1)
11071 {
11072 if (quantity > stack_max)
11073 split_quantity_new = stack_max;
11074 else
11075 split_quantity_new = quantity;
11076
11078 {
11081 }
11082
11083 if (new_item)
11084 {
11085 new_item.SetResultOfSplit(true);
11086 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11088 new_item.SetQuantity(split_quantity_new);
11089 }
11090 }
11091 else
11092 {
11093 if (stack_max != 0)
11094 {
11096 {
11098 }
11099
11100 if (split_quantity_new == 0)
11101 {
11102 if (!
GetGame().IsMultiplayer())
11103 player.PhysicalPredictiveDropItem(this);
11104 else
11105 player.ServerDropEntity(this);
11106 return;
11107 }
11108
11110
11111 if (new_item)
11112 {
11113 new_item.SetResultOfSplit(true);
11114 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11116 new_item.SetQuantity(stack_max);
11117 new_item.PlaceOnSurface();
11118 }
11119 }
11120 }
11121 }
11122
11124 {
11126 return;
11127
11128 float split_quantity_new;
11132 InventoryLocation loc = new InventoryLocation;
11133
11134 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11135 {
11137 split_quantity_new = stack_max;
11138 else
11140
11141 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11142 if (new_item)
11143 {
11144 new_item.SetResultOfSplit(true);
11145 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11147 new_item.SetQuantity(split_quantity_new);
11148 }
11149 }
11150 else if (destination_entity && slot_id == -1)
11151 {
11152 if (quantity > stack_max)
11153 split_quantity_new = stack_max;
11154 else
11155 split_quantity_new = quantity;
11156
11158 {
11161 }
11162
11163 if (new_item)
11164 {
11165 new_item.SetResultOfSplit(true);
11166 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11168 new_item.SetQuantity(split_quantity_new);
11169 }
11170 }
11171 else
11172 {
11173 if (stack_max != 0)
11174 {
11176 {
11178 }
11179
11181
11182 if (new_item)
11183 {
11184 new_item.SetResultOfSplit(true);
11185 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11187 new_item.SetQuantity(stack_max);
11188 new_item.PlaceOnSurface();
11189 }
11190 }
11191 }
11192 }
11193
11195 {
11197 return;
11198
11200 {
11201 if (ScriptInputUserData.CanStoreInputUserData())
11202 {
11203 ScriptInputUserData ctx = new ScriptInputUserData;
11208 dst.WriteToContext(ctx);
11210 }
11211 }
11212 else if (!
GetGame().IsMultiplayer())
11213 {
11215 }
11216 }
11217
11219 {
11221 return;
11222
11224 {
11225 if (ScriptInputUserData.CanStoreInputUserData())
11226 {
11227 ScriptInputUserData ctx = new ScriptInputUserData;
11232 ctx.
Write(destination_entity);
11238 }
11239 }
11240 else if (!
GetGame().IsMultiplayer())
11241 {
11243 }
11244 }
11245
11247 {
11249 }
11250
11252 {
11254 return this;
11255
11257 float split_quantity_new;
11259 if (dst.IsValid())
11260 {
11261 int slot_id = dst.GetSlot();
11263
11264 if (quantity > stack_max)
11265 split_quantity_new = stack_max;
11266 else
11267 split_quantity_new = quantity;
11268
11270
11271 if (new_item)
11272 {
11273 new_item.SetResultOfSplit(true);
11274 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11277 }
11278
11279 return new_item;
11280 }
11281
11282 return null;
11283 }
11284
11286 {
11288 return;
11289
11291 float split_quantity_new;
11293 if (destination_entity)
11294 {
11296 if (quantity > stackable)
11297 split_quantity_new = stackable;
11298 else
11299 split_quantity_new = quantity;
11300
11301 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11302 if (new_item)
11303 {
11304 new_item.SetResultOfSplit(true);
11305 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11307 new_item.SetQuantity(split_quantity_new);
11308 }
11309 }
11310 }
11311
11313 {
11315 return;
11316
11318 {
11319 if (ScriptInputUserData.CanStoreInputUserData())
11320 {
11321 ScriptInputUserData ctx = new ScriptInputUserData;
11326 ItemBase destination_entity =
this;
11327 ctx.
Write(destination_entity);
11331 }
11332 }
11333 else if (!
GetGame().IsMultiplayer())
11334 {
11336 }
11337 }
11338
11340 {
11342 return;
11343
11345 float split_quantity_new;
11347 if (player)
11348 {
11350 if (quantity > stackable)
11351 split_quantity_new = stackable;
11352 else
11353 split_quantity_new = quantity;
11354
11355 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11356 new_item =
ItemBase.Cast(in_hands);
11357 if (new_item)
11358 {
11359 new_item.SetResultOfSplit(true);
11360 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11362 new_item.SetQuantity(split_quantity_new);
11363 }
11364 }
11365 }
11366
11368 {
11370 return;
11371
11373 float split_quantity_new = Math.Floor(quantity * 0.5);
11374
11376
11377 if (new_item)
11378 {
11379 if (new_item.GetQuantityMax() < split_quantity_new)
11380 {
11381 split_quantity_new = new_item.GetQuantityMax();
11382 }
11383
11384 new_item.SetResultOfSplit(true);
11385 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11386
11388 {
11391 }
11392 else
11393 {
11396 }
11397 }
11398 }
11399
11401 {
11403 return;
11404
11406 float split_quantity_new = Math.Floor(quantity / 2);
11407
11408 InventoryLocation invloc = new InventoryLocation;
11410
11412 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11413
11414 if (new_item)
11415 {
11416 if (new_item.GetQuantityMax() < split_quantity_new)
11417 {
11418 split_quantity_new = new_item.GetQuantityMax();
11419 }
11421 {
11424 }
11425 else
11426 {
11429 }
11430 }
11431 }
11432
11435 {
11436 SetWeightDirty();
11438
11439 if (parent)
11440 parent.OnAttachmentQuantityChangedEx(this, delta);
11441
11443 {
11445 {
11447 }
11449 {
11450 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11452 }
11453 }
11454
11455 }
11456
11459 {
11460
11461 }
11462
11465 {
11467 }
11468
11470 {
11471 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11472
11474 {
11475 if (newLevel == GameConstants.STATE_RUINED)
11476 {
11478 EntityAI parent = GetHierarchyParent();
11479 if (parent && parent.IsFireplace())
11480 {
11481 CargoBase cargo = GetInventory().GetCargo();
11482 if (cargo)
11483 {
11485 {
11487 }
11488 }
11489 }
11490 }
11491
11493 {
11494
11496 return;
11497 }
11498
11499 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11500 {
11502 }
11503 }
11504 }
11505
11506
11508 {
11509 super.OnRightClick();
11510
11512 {
11514 {
11515 if (ScriptInputUserData.CanStoreInputUserData())
11516 {
11517 vector m4[4];
11519
11520 EntityAI root = GetHierarchyRoot();
11521
11522 InventoryLocation dst = new InventoryLocation;
11524 {
11525 if (root)
11526 {
11527 root.GetTransform(m4);
11529 }
11530 else
11531 GetInventory().GetCurrentInventoryLocation(dst);
11532 }
11533 else
11534 {
11536
11537
11538 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11539 {
11540 if (root)
11541 {
11542 root.GetTransform(m4);
11544 }
11545 else
11546 GetInventory().GetCurrentInventoryLocation(dst);
11547 }
11548 else
11549 {
11550 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11551 }
11552 }
11553
11554 ScriptInputUserData ctx = new ScriptInputUserData;
11562 }
11563 }
11564 else if (!
GetGame().IsMultiplayer())
11565 {
11567 }
11568 }
11569 }
11570
11571 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11572 {
11573
11574 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11575 return false;
11576
11577 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11578 return false;
11579
11580
11582 return false;
11583
11584
11585 Magazine mag = Magazine.Cast(this);
11586 if (mag)
11587 {
11588 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11589 return false;
11590
11591 if (stack_max_limit)
11592 {
11593 Magazine other_mag = Magazine.Cast(other_item);
11594 if (other_item)
11595 {
11596 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11597 return false;
11598 }
11599
11600 }
11601 }
11602 else
11603 {
11604
11606 return false;
11607
11609 return false;
11610 }
11611
11612 PlayerBase player = null;
11613 if (CastTo(player, GetHierarchyRootPlayer()))
11614 {
11615 if (player.GetInventory().HasAttachment(this))
11616 return false;
11617
11618 if (player.IsItemsToDelete())
11619 return false;
11620 }
11621
11622 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11623 return false;
11624
11625 int slotID;
11627 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11628 return false;
11629
11630 return true;
11631 }
11632
11634 {
11636 }
11637
11639 {
11640 return m_IsResultOfSplit;
11641 }
11642
11644 {
11645 m_IsResultOfSplit = value;
11646 }
11647
11649 {
11651 }
11652
11654 {
11655 float other_item_quantity = other_item.GetQuantity();
11656 float this_free_space;
11657
11659
11661
11662 if (other_item_quantity > this_free_space)
11663 {
11664 return this_free_space;
11665 }
11666 else
11667 {
11668 return other_item_quantity;
11669 }
11670 }
11671
11673 {
11675 }
11676
11678 {
11680 return;
11681
11682 if (!IsMagazine() && other_item)
11683 {
11685 if (quantity_used != 0)
11686 {
11687 float hp1 = GetHealth01("","");
11688 float hp2 = other_item.GetHealth01("","");
11689 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11690 hpResult = hpResult / (
GetQuantity() + quantity_used);
11691
11692 hpResult *= GetMaxHealth();
11693 Math.Round(hpResult);
11694 SetHealth("", "Health", hpResult);
11695
11697 other_item.AddQuantity(-quantity_used);
11698 }
11699 }
11701 }
11702
11704 {
11705 #ifdef SERVER
11706 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11707 GetHierarchyParent().IncreaseLifetimeUp();
11708 #endif
11709 };
11710
11712 {
11713 PlayerBase p = PlayerBase.Cast(player);
11714
11715 array<int> recipesIds = p.m_Recipes;
11716 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11717 if (moduleRecipesManager)
11718 {
11719 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11720 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11721 }
11722
11723 for (int i = 0;i < recipesIds.Count(); i++)
11724 {
11725 int key = recipesIds.Get(i);
11726 string recipeName = moduleRecipesManager.GetRecipeName(key);
11728 }
11729 }
11730
11731
11732 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11733 {
11734 super.GetDebugActions(outputList);
11735
11736
11741
11742
11746
11750
11751
11754
11755
11757 {
11760 }
11761
11763
11766
11770 }
11771
11772
11773
11774
11776 {
11777 super.OnAction(action_id, player, ctx);
11778 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11779 {
11780 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11781 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11782 PlayerBase p = PlayerBase.Cast(player);
11783 if (
EActions.RECIPES_RANGE_START < 1000)
11784 {
11785 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11786 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11787 }
11788 }
11789 #ifndef SERVER
11790 else if (action_id ==
EActions.WATCH_PLAYER)
11791 {
11792 PluginDeveloper.SetDeveloperItemClientEx(player);
11793 }
11794 #endif
11796 {
11797 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11798 {
11799 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11800 OnDebugButtonPressServer(id + 1);
11801 }
11802
11803 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11804 {
11805 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11807 }
11808
11809 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11810 {
11811 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11813 }
11814
11815 else if (action_id ==
EActions.ADD_QUANTITY)
11816 {
11817 if (IsMagazine())
11818 {
11819 Magazine mag = Magazine.Cast(this);
11820 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11821 }
11822 else
11823 {
11825 }
11826
11827 if (m_EM)
11828 {
11829 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11830 }
11831
11832 }
11833
11834 else if (action_id ==
EActions.REMOVE_QUANTITY)
11835 {
11836 if (IsMagazine())
11837 {
11838 Magazine mag2 = Magazine.Cast(this);
11839 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11840 }
11841 else
11842 {
11844 }
11845 if (m_EM)
11846 {
11847 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11848 }
11849
11850 }
11851
11852 else if (action_id ==
EActions.SET_QUANTITY_0)
11853 {
11855
11856 if (m_EM)
11857 {
11858 m_EM.SetEnergy(0);
11859 }
11860 }
11861
11862 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11863 {
11865
11866 if (m_EM)
11867 {
11868 m_EM.SetEnergy(m_EM.GetEnergyMax());
11869 }
11870 }
11871
11872 else if (action_id ==
EActions.ADD_HEALTH)
11873 {
11874 AddHealth("","",GetMaxHealth("","Health")/5);
11875 }
11876 else if (action_id ==
EActions.REMOVE_HEALTH)
11877 {
11878 AddHealth("","",-GetMaxHealth("","Health")/5);
11879 }
11880 else if (action_id ==
EActions.DESTROY_HEALTH)
11881 {
11882 SetHealth01("","",0);
11883 }
11884 else if (action_id ==
EActions.WATCH_ITEM)
11885 {
11887 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11888 #ifdef DEVELOPER
11889 SetDebugDeveloper_item(this);
11890 #endif
11891 }
11892
11893 else if (action_id ==
EActions.ADD_TEMPERATURE)
11894 {
11895 AddTemperature(20);
11896
11897 }
11898
11899 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11900 {
11901 AddTemperature(-20);
11902
11903 }
11904
11905 else if (action_id ==
EActions.FLIP_FROZEN)
11906 {
11907 SetFrozen(!GetIsFrozen());
11908
11909 }
11910
11911 else if (action_id ==
EActions.ADD_WETNESS)
11912 {
11914
11915 }
11916
11917 else if (action_id ==
EActions.REMOVE_WETNESS)
11918 {
11920
11921 }
11922
11923 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11924 {
11927
11928
11929 }
11930
11931 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11932 {
11935 }
11936
11937 else if (action_id ==
EActions.MAKE_SPECIAL)
11938 {
11939 auto debugParams = DebugSpawnParams.WithPlayer(player);
11940 OnDebugSpawnEx(debugParams);
11941 }
11942
11943 else if (action_id ==
EActions.DELETE)
11944 {
11945 Delete();
11946 }
11947
11948 }
11949
11950
11951 return false;
11952 }
11953
11954
11955
11956
11960
11963
11964
11965
11967 {
11968 return false;
11969 }
11970
11971
11973 {
11974 return true;
11975 }
11976
11977
11979 {
11980 return true;
11981 }
11982
11983
11984
11986 {
11987 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11989 }
11990
11993 {
11994 return null;
11995 }
11996
11998 {
11999 return false;
12000 }
12001
12003 {
12004 return false;
12005 }
12006
12010
12011
12013 {
12014 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12015 return module_repairing.CanRepair(this, item_repair_kit);
12016 }
12017
12018
12019 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12020 {
12021 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12022 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12023 }
12024
12025
12027 {
12028
12029
12030
12031
12032
12033
12034
12035
12036 return 1;
12037 }
12038
12039
12040
12042 {
12044 }
12045
12046
12047
12049 {
12051 }
12052
12053
12062 {
12063 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12064
12065 if (player)
12066 {
12067 player.MessageStatus(text);
12068 }
12069 }
12070
12071
12080 {
12081 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12082
12083 if (player)
12084 {
12085 player.MessageAction(text);
12086 }
12087 }
12088
12089
12098 {
12099 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12100
12101 if (player)
12102 {
12103 player.MessageFriendly(text);
12104 }
12105 }
12106
12107
12116 {
12117 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12118
12119 if (player)
12120 {
12121 player.MessageImportant(text);
12122 }
12123 }
12124
12126 {
12127 return true;
12128 }
12129
12130
12131 override bool KindOf(
string tag)
12132 {
12133 bool found = false;
12134 string item_name = this.
GetType();
12137
12138 int array_size = item_tag_array.Count();
12139 for (int i = 0; i < array_size; i++)
12140 {
12141 if (item_tag_array.Get(i) == tag)
12142 {
12143 found = true;
12144 break;
12145 }
12146 }
12147 return found;
12148 }
12149
12150
12152 {
12153
12154 super.OnRPC(sender, rpc_type,ctx);
12155
12156
12157 switch (rpc_type)
12158 {
12159 #ifndef SERVER
12160 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12161 Param2<bool, string> p = new Param2<bool, string>(false, "");
12162
12164 return;
12165
12166 bool play = p.param1;
12167 string soundSet = p.param2;
12168
12169 if (play)
12170 {
12172 {
12174 {
12176 }
12177 }
12178 else
12179 {
12181 }
12182 }
12183 else
12184 {
12186 }
12187
12188 break;
12189 #endif
12190
12191 }
12192
12194 {
12196 }
12197 }
12198
12199
12200
12201
12203 {
12204 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12205 return plugin.GetID(
name);
12206 }
12207
12209 {
12210 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12211 return plugin.GetName(id);
12212 }
12213
12216 {
12217
12218
12219 int varFlags;
12220 if (!ctx.
Read(varFlags))
12221 return;
12222
12223 if (varFlags & ItemVariableFlags.FLOAT)
12224 {
12226 }
12227 }
12228
12230 {
12231
12232 super.SerializeNumericalVars(floats_out);
12233
12234
12235
12237 {
12239 }
12240
12242 {
12244 }
12245
12247 {
12249 }
12250
12252 {
12257 }
12258
12260 {
12262 }
12263 }
12264
12266 {
12267
12268 super.DeSerializeNumericalVars(floats);
12269
12270
12271 int index = 0;
12272 int mask = Math.Round(floats.Get(index));
12273
12274 index++;
12275
12277 {
12279 {
12281 }
12282 else
12283 {
12284 float quantity = floats.Get(index);
12285 SetQuantity(quantity,
true,
false,
false,
false);
12286 }
12287 index++;
12288 }
12289
12291 {
12292 float wet = floats.Get(index);
12294 index++;
12295 }
12296
12298 {
12299 int liquidtype = Math.Round(floats.Get(index));
12301 index++;
12302 }
12303
12305 {
12307 index++;
12309 index++;
12311 index++;
12313 index++;
12314 }
12315
12317 {
12318 int cleanness = Math.Round(floats.Get(index));
12320 index++;
12321 }
12322 }
12323
12325 {
12326 super.WriteVarsToCTX(ctx);
12327
12328
12330 {
12332 }
12333
12335 {
12337 }
12338
12340 {
12342 }
12343
12345 {
12346 int r,g,b,a;
12352 }
12353
12355 {
12357 }
12358 }
12359
12361 {
12362 if (!super.ReadVarsFromCTX(ctx,version))
12363 return false;
12364
12365 int intValue;
12366 float value;
12367
12368 if (version < 140)
12369 {
12370 if (!ctx.
Read(intValue))
12371 return false;
12372
12373 m_VariablesMask = intValue;
12374 }
12375
12377 {
12378 if (!ctx.
Read(value))
12379 return false;
12380
12382 {
12384 }
12385 else
12386 {
12388 }
12389 }
12390
12391 if (version < 140)
12392 {
12394 {
12395 if (!ctx.
Read(value))
12396 return false;
12397 SetTemperatureDirect(value);
12398 }
12399 }
12400
12402 {
12403 if (!ctx.
Read(value))
12404 return false;
12406 }
12407
12409 {
12410 if (!ctx.
Read(intValue))
12411 return false;
12413 }
12414
12416 {
12417 int r,g,b,a;
12419 return false;
12421 return false;
12423 return false;
12425 return false;
12426
12428 }
12429
12431 {
12432 if (!ctx.
Read(intValue))
12433 return false;
12435 }
12436
12437 if (version >= 138 && version < 140)
12438 {
12440 {
12441 if (!ctx.
Read(intValue))
12442 return false;
12443 SetFrozen(intValue);
12444 }
12445 }
12446
12447 return true;
12448 }
12449
12450
12452 {
12455 {
12457 }
12458
12459 if (!super.OnStoreLoad(ctx, version))
12460 {
12462 return false;
12463 }
12464
12465 if (version >= 114)
12466 {
12467 bool hasQuickBarIndexSaved;
12468
12469 if (!ctx.
Read(hasQuickBarIndexSaved))
12470 {
12472 return false;
12473 }
12474
12475 if (hasQuickBarIndexSaved)
12476 {
12477 int itmQBIndex;
12478
12479
12480 if (!ctx.
Read(itmQBIndex))
12481 {
12483 return false;
12484 }
12485
12486 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12487 if (itmQBIndex != -1 && parentPlayer)
12488 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12489 }
12490 }
12491 else
12492 {
12493
12494 PlayerBase player;
12495 int itemQBIndex;
12496 if (version ==
int.
MAX)
12497 {
12498 if (!ctx.
Read(itemQBIndex))
12499 {
12501 return false;
12502 }
12503 }
12504 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12505 {
12506
12507 if (!ctx.
Read(itemQBIndex))
12508 {
12510 return false;
12511 }
12512 if (itemQBIndex != -1 && player)
12513 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12514 }
12515 }
12516
12517 if (version < 140)
12518 {
12519
12520 if (!LoadVariables(ctx, version))
12521 {
12523 return false;
12524 }
12525 }
12526
12527
12529 {
12531 return false;
12532 }
12533 if (version >= 132)
12534 {
12536 if (raib)
12537 {
12539 {
12541 return false;
12542 }
12543 }
12544 }
12545
12547 return true;
12548 }
12549
12550
12551
12553 {
12554 super.OnStoreSave(ctx);
12555
12556 PlayerBase player;
12557 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12558 {
12560
12561 int itemQBIndex = -1;
12562 itemQBIndex = player.FindQuickBarEntityIndex(this);
12563 ctx.
Write(itemQBIndex);
12564 }
12565 else
12566 {
12568 }
12569
12571
12573 if (raib)
12574 {
12576 }
12577 }
12578
12579
12581 {
12582 super.AfterStoreLoad();
12583
12585 {
12587 }
12588
12590 {
12593 }
12594 }
12595
12597 {
12598 super.EEOnAfterLoad();
12599
12601 {
12603 }
12604
12607 }
12608
12610 {
12611 return false;
12612 }
12613
12614
12615
12617 {
12619 {
12620 #ifdef PLATFORM_CONSOLE
12621
12623 {
12625 if (menu)
12626 {
12628 }
12629 }
12630 #endif
12631 }
12632
12634 {
12637 }
12638
12640 {
12641 SetWeightDirty();
12643 }
12645 {
12648 }
12649
12651 {
12654 }
12656 {
12659 }
12660
12661 super.OnVariablesSynchronized();
12662 }
12663
12664
12665
12667 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12668 {
12669 if (!IsServerCheck(allow_client))
12670 return false;
12671
12673 return false;
12674
12677
12678 if (value <= (min + 0.001))
12679 value = min;
12680
12681 if (value == min)
12682 {
12683 if (destroy_config)
12684 {
12685 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12686 if (dstr)
12687 {
12689 this.Delete();
12690 return true;
12691 }
12692 }
12693 else if (destroy_forced)
12694 {
12696 this.Delete();
12697 return true;
12698 }
12699
12701 }
12702
12705
12707 {
12709
12710 if (delta)
12712 }
12713
12715
12716 return false;
12717 }
12718
12719
12721 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12722 {
12724 }
12725
12727 {
12730 }
12731
12733 {
12736 }
12737
12740 {
12741 float value_clamped = Math.Clamp(value, 0, 1);
12743 SetQuantity(result, destroy_config, destroy_forced);
12744 }
12745
12746
12749 {
12751 }
12752
12754 {
12756 }
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12768 {
12769 int slot = -1;
12770 if (GetInventory())
12771 {
12772 InventoryLocation il = new InventoryLocation;
12773 GetInventory().GetCurrentInventoryLocation(il);
12775 }
12776
12778 }
12779
12781 {
12782 float quantity_max = 0;
12783
12785 {
12786 if (attSlotID != -1)
12787 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12788
12789 if (quantity_max <= 0)
12791 }
12792
12793 if (quantity_max <= 0)
12795
12796 return quantity_max;
12797 }
12798
12800 {
12802 }
12803
12805 {
12807 }
12808
12809
12811 {
12813 }
12814
12816 {
12818 }
12819
12821 {
12823 }
12824
12825
12827 {
12828
12829 float weightEx = GetWeightEx();
12830 float special = GetInventoryAndCargoWeight();
12831 return weightEx - special;
12832 }
12833
12834
12836 {
12838 }
12839
12841 {
12843 {
12844 #ifdef DEVELOPER
12845 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12846 {
12847 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12849 }
12850 #endif
12851
12852 return GetQuantity() * GetConfigWeightModified();
12853 }
12854 else if (HasEnergyManager())
12855 {
12856 #ifdef DEVELOPER
12857 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12858 {
12859 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12860 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12861 }
12862 #endif
12863 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12864 }
12865 else
12866 {
12867 #ifdef DEVELOPER
12868 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12869 {
12870 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12871 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12872 }
12873 #endif
12874 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12875 }
12876 }
12877
12880 {
12881 int item_count = 0;
12883
12884 if (GetInventory().GetCargo() != NULL)
12885 {
12886 item_count = GetInventory().GetCargo().GetItemCount();
12887 }
12888
12889 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12890 {
12891 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12892 if (item)
12893 item_count += item.GetNumberOfItems();
12894 }
12895 return item_count;
12896 }
12897
12900 {
12901 float weight = 0;
12902 float wetness = 1;
12903 if (include_wetness)
12906 {
12907 weight = wetness * m_ConfigWeight;
12908 }
12910 {
12911 weight = 1;
12912 }
12913 return weight;
12914 }
12915
12916
12917
12919 {
12920 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12921 {
12922 GameInventory inv = GetInventory();
12923 array<EntityAI> items = new array<EntityAI>;
12925 for (int i = 0; i < items.Count(); i++)
12926 {
12928 if (item)
12929 {
12931 }
12932 }
12933 }
12934 }
12935
12936
12937
12938
12940 {
12941 float energy = 0;
12942 if (HasEnergyManager())
12943 {
12944 energy = GetCompEM().GetEnergy();
12945 }
12946 return energy;
12947 }
12948
12949
12951 {
12952 super.OnEnergyConsumed();
12953
12955 }
12956
12958 {
12959 super.OnEnergyAdded();
12960
12962 }
12963
12964
12966 {
12967 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12968 {
12970 {
12971 float energy_0to1 = GetCompEM().GetEnergy0To1();
12973 }
12974 }
12975 }
12976
12977
12979 {
12980 return ConfigGetFloat("heatIsolation");
12981 }
12982
12984 {
12986 }
12987
12989 {
12990 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12991 if (
GetGame().ConfigIsExisting(paramPath))
12993
12994 return 0.0;
12995 }
12996
12998 {
12999 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13000 if (
GetGame().ConfigIsExisting(paramPath))
13002
13003 return 0.0;
13004 }
13005
13006 override void SetWet(
float value,
bool allow_client =
false)
13007 {
13008 if (!IsServerCheck(allow_client))
13009 return;
13010
13013
13015
13016 m_VarWet = Math.Clamp(value, min, max);
13017
13019 {
13022 }
13023 }
13024
13025 override void AddWet(
float value)
13026 {
13028 }
13029
13031 {
13033 }
13034
13036 {
13038 }
13039
13041 {
13043 }
13044
13046 {
13048 }
13049
13051 {
13053 }
13054
13055 override void OnWetChanged(
float newVal,
float oldVal)
13056 {
13059 if (newLevel != oldLevel)
13060 {
13062 }
13063 }
13064
13066 {
13067 SetWeightDirty();
13068 }
13069
13071 {
13072 return GetWetLevelInternal(
m_VarWet);
13073 }
13074
13075
13076
13078 {
13080 }
13081
13083 {
13085 }
13086
13088 {
13090 }
13091
13093 {
13095 }
13096
13097
13098
13100 {
13101 if (ConfigIsExisting("itemModelLength"))
13102 {
13103 return ConfigGetFloat("itemModelLength");
13104 }
13105 return 0;
13106 }
13107
13109 {
13110 if (ConfigIsExisting("itemAttachOffset"))
13111 {
13112 return ConfigGetFloat("itemAttachOffset");
13113 }
13114 return 0;
13115 }
13116
13117 override void SetCleanness(
int value,
bool allow_client =
false)
13118 {
13119 if (!IsServerCheck(allow_client))
13120 return;
13121
13123
13125
13128 }
13129
13131 {
13133 }
13134
13136 {
13137 return true;
13138 }
13139
13140
13141
13142
13144 {
13146 }
13147
13149 {
13151 }
13152
13153
13154
13155
13156 override void SetColor(
int r,
int g,
int b,
int a)
13157 {
13163 }
13165 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13166 {
13171 }
13172
13174 {
13176 }
13177
13180 {
13181 int r,g,b,a;
13183 r = r/255;
13184 g = g/255;
13185 b = b/255;
13186 a = a/255;
13187 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13188 }
13189
13190
13191
13192 override void SetLiquidType(
int value,
bool allow_client =
false)
13193 {
13194 if (!IsServerCheck(allow_client))
13195 return;
13196
13201 }
13202
13204 {
13205 return ConfigGetInt("varLiquidTypeInit");
13206 }
13207
13209 {
13211 }
13212
13214 {
13216 SetFrozen(false);
13217 }
13218
13221 {
13222 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13223 }
13224
13225
13228 {
13229 PlayerBase nplayer;
13230 if (PlayerBase.CastTo(nplayer, player))
13231 {
13233
13234 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13235 }
13236 }
13237
13238
13241 {
13242 PlayerBase nplayer;
13243 if (PlayerBase.CastTo(nplayer,player))
13244 {
13245
13246 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13247
13248 }
13249
13250
13251 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13252
13253
13254 if (HasEnergyManager())
13255 {
13256 GetCompEM().UpdatePlugState();
13257 }
13258 }
13259
13260
13262 {
13263 super.OnPlacementStarted(player);
13264
13266 }
13267
13268 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13269 {
13271 {
13272 m_AdminLog.OnPlacementComplete(player,
this);
13273 }
13274
13275 super.OnPlacementComplete(player, position, orientation);
13276 }
13277
13278
13279
13280
13281
13283 {
13285 {
13286 return true;
13287 }
13288 else
13289 {
13290 return false;
13291 }
13292 }
13293
13294
13296 {
13298 {
13300 }
13301 }
13302
13303
13305 {
13307 }
13308
13310 {
13312 }
13313
13314 override void InsertAgent(
int agent,
float count = 1)
13315 {
13316 if (count < 1)
13317 return;
13318
13320 }
13321
13324 {
13326 }
13327
13328
13330 {
13332 }
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13376 {
13378 return false;
13379 return true;
13380 }
13381
13383 {
13384
13386 }
13387
13388
13391 {
13392 super.CheckForRoofLimited(timeTresholdMS);
13393
13395 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13396 {
13397 m_PreviousRoofTestTime = time;
13398 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13399 }
13400 }
13401
13402
13404 {
13406 {
13407 return 0;
13408 }
13409
13410 if (GetInventory().GetAttachmentSlotsCount() != 0)
13411 {
13412 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13413 if (filter)
13414 return filter.GetProtectionLevel(type, false, system);
13415 else
13416 return 0;
13417 }
13418
13419 string subclassPath, entryName;
13420
13421 switch (type)
13422 {
13424 entryName = "biological";
13425 break;
13427 entryName = "chemical";
13428 break;
13429 default:
13430 entryName = "biological";
13431 break;
13432 }
13433
13434 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13435
13437 }
13438
13439
13440
13443 {
13444 if (!IsMagazine())
13446
13448 }
13449
13450
13451
13452
13453
13458 {
13459 return true;
13460 }
13461
13463 {
13465 }
13466
13467
13468
13469
13470
13472 {
13473 if (parent)
13474 {
13475 if (parent.IsInherited(DayZInfected))
13476 return true;
13477
13478 if (!parent.IsRuined())
13479 return true;
13480 }
13481
13482 return true;
13483 }
13484
13486 {
13487 if (!super.CanPutAsAttachment(parent))
13488 {
13489 return false;
13490 }
13491
13492 if (!IsRuined() && !parent.IsRuined())
13493 {
13494 return true;
13495 }
13496
13497 return false;
13498 }
13499
13501 {
13502
13503
13504
13505
13506 return super.CanReceiveItemIntoCargo(item);
13507 }
13508
13510 {
13511
13512
13513
13514
13515 GameInventory attachmentInv = attachment.GetInventory();
13517 {
13518 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13519 return false;
13520 }
13521
13522 InventoryLocation loc = new InventoryLocation();
13523 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13524 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13525 return false;
13526
13527 return super.CanReceiveAttachment(attachment, slotId);
13528 }
13529
13531 {
13532 if (!super.CanReleaseAttachment(attachment))
13533 return false;
13534
13535 return GetInventory().AreChildrenAccessible();
13536 }
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13559 {
13560 int id = muzzle_owner.GetMuzzleID();
13561 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13562
13563 if (WPOF_array)
13564 {
13565 for (int i = 0; i < WPOF_array.Count(); i++)
13566 {
13567 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13568
13569 if (WPOF)
13570 {
13571 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13572 }
13573 }
13574 }
13575 }
13576
13577
13579 {
13580 int id = muzzle_owner.GetMuzzleID();
13582
13583 if (WPOBE_array)
13584 {
13585 for (int i = 0; i < WPOBE_array.Count(); i++)
13586 {
13587 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13588
13589 if (WPOBE)
13590 {
13591 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13592 }
13593 }
13594 }
13595 }
13596
13597
13599 {
13600 int id = muzzle_owner.GetMuzzleID();
13601 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13602
13603 if (WPOOH_array)
13604 {
13605 for (int i = 0; i < WPOOH_array.Count(); i++)
13606 {
13607 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13608
13609 if (WPOOH)
13610 {
13611 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13612 }
13613 }
13614 }
13615 }
13616
13617
13619 {
13620 int id = muzzle_owner.GetMuzzleID();
13621 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13622
13623 if (WPOOH_array)
13624 {
13625 for (int i = 0; i < WPOOH_array.Count(); i++)
13626 {
13627 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13628
13629 if (WPOOH)
13630 {
13631 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13632 }
13633 }
13634 }
13635 }
13636
13637
13639 {
13640 int id = muzzle_owner.GetMuzzleID();
13641 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13642
13643 if (WPOOH_array)
13644 {
13645 for (int i = 0; i < WPOOH_array.Count(); i++)
13646 {
13647 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13648
13649 if (WPOOH)
13650 {
13651 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13652 }
13653 }
13654 }
13655 }
13656
13657
13658
13660 {
13662 {
13663 return true;
13664 }
13665
13666 return false;
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 {
13691 return false;
13692 }
13693
13696 {
13697 return UATimeSpent.DEFAULT_DEPLOY;
13698 }
13699
13700
13701
13702
13704 {
13706 SetSynchDirty();
13707 }
13708
13710 {
13712 }
13713
13714
13716 {
13717 return false;
13718 }
13719
13722 {
13723 string att_type = "None";
13724
13725 if (ConfigIsExisting("soundAttType"))
13726 {
13727 att_type = ConfigGetString("soundAttType");
13728 }
13729
13731 }
13732
13734 {
13736 }
13737
13738
13739
13740
13741
13745
13747 {
13750
13752 }
13753
13754
13756 {
13758 return;
13759
13761
13764
13767
13768 SoundParameters params = new SoundParameters();
13772 }
13773
13774
13776 {
13778 return;
13779
13781 SetSynchDirty();
13782
13785 }
13786
13787
13789 {
13791 return;
13792
13794 SetSynchDirty();
13795
13798 }
13799
13801 {
13803 }
13804
13806 {
13808 }
13809
13812 {
13813 if (!
GetGame().IsDedicatedServer())
13814 {
13815 if (ConfigIsExisting("attachSoundSet"))
13816 {
13817 string cfg_path = "";
13818 string soundset = "";
13819 string type_name =
GetType();
13820
13823 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13824 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13825
13826 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13827 {
13828 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13829 {
13830 if (cfg_slot_array[i] == slot_type)
13831 {
13832 soundset = cfg_soundset_array[i];
13833 break;
13834 }
13835 }
13836 }
13837
13838 if (soundset != "")
13839 {
13840 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13842 }
13843 }
13844 }
13845 }
13846
13848 {
13849
13850 }
13851
13852 void OnApply(PlayerBase player);
13853
13855 {
13856 return 1.0;
13857 };
13858
13860 {
13862 }
13863
13865 {
13867 }
13868
13870
13872 {
13873 SetDynamicPhysicsLifeTime(0.01);
13875 }
13876
13878 {
13879 array<string> zone_names = new array<string>;
13880 GetDamageZones(zone_names);
13881 for (int i = 0; i < zone_names.Count(); i++)
13882 {
13883 SetHealthMax(zone_names.Get(i),"Health");
13884 }
13885 SetHealthMax("","Health");
13886 }
13887
13890 {
13891 float global_health = GetHealth01("","Health");
13892 array<string> zones = new array<string>;
13893 GetDamageZones(zones);
13894
13895 for (int i = 0; i < zones.Count(); i++)
13896 {
13897 SetHealth01(zones.Get(i),"Health",global_health);
13898 }
13899 }
13900
13903 {
13904 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13905 }
13906
13908 {
13909 if (!hasRootAsPlayer)
13910 {
13911 if (refParentIB)
13912 {
13913
13914 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13915 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13916
13917 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13918 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13919
13922 }
13923 else
13924 {
13925
13928 }
13929 }
13930 }
13931
13933 {
13935 {
13936 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13937 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13938 {
13939 float heatPermCoef = 1.0;
13941 while (ent)
13942 {
13943 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13944 ent = ent.GetHierarchyParent();
13945 }
13946
13947 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13948 }
13949 }
13950 }
13951
13953 {
13954
13955 EntityAI parent = GetHierarchyParent();
13956 if (!parent)
13957 {
13958 hasParent = false;
13959 hasRootAsPlayer = false;
13960 }
13961 else
13962 {
13963 hasParent = true;
13964 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13965 refParentIB =
ItemBase.Cast(parent);
13966 }
13967 }
13968
13969 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13970 {
13971
13972 }
13973
13975 {
13976
13977 return false;
13978 }
13979
13981 {
13982
13983
13984 return false;
13985 }
13986
13988 {
13989
13990 return false;
13991 }
13992
13995 {
13996 return !GetIsFrozen() &&
IsOpen();
13997 }
13998
14000 {
14001 bool hasParent = false, hasRootAsPlayer = false;
14003
14004 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14005 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14006
14007 if (wwtu || foodDecay)
14008 {
14012
14013 if (processWetness || processTemperature || processDecay)
14014 {
14016
14017 if (processWetness)
14018 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14019
14020 if (processTemperature)
14022
14023 if (processDecay)
14024 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14025 }
14026 }
14027 }
14028
14031 {
14033 }
14034
14036 {
14039
14040 return super.GetTemperatureFreezeThreshold();
14041 }
14042
14044 {
14047
14048 return super.GetTemperatureThawThreshold();
14049 }
14050
14052 {
14055
14056 return super.GetItemOverheatThreshold();
14057 }
14058
14060 {
14062 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14063
14064 return super.GetTemperatureFreezeTime();
14065 }
14066
14068 {
14070 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14071
14072 return super.GetTemperatureThawTime();
14073 }
14074
14079
14081 {
14082 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14083 }
14084
14086 {
14087 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14088 }
14089
14092 {
14094 }
14095
14097 {
14099 }
14100
14102 {
14104 }
14105
14108 {
14109 return null;
14110 }
14111
14114 {
14115 return false;
14116 }
14117
14119 {
14121 {
14124 if (!trg)
14125 {
14127 explosive = this;
14128 }
14129
14130 explosive.PairRemote(trg);
14132
14133 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14134 trg.SetPersistentPairID(persistentID);
14135 explosive.SetPersistentPairID(persistentID);
14136
14137 return true;
14138 }
14139 return false;
14140 }
14141
14144 {
14145 float ret = 1.0;
14148 ret *= GetHealth01();
14149
14150 return ret;
14151 }
14152
14153 #ifdef DEVELOPER
14154 override void SetDebugItem()
14155 {
14156 super.SetDebugItem();
14157 _itemBase = this;
14158 }
14159
14161 {
14162 string text = super.GetDebugText();
14163
14165 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14166
14167 return text;
14168 }
14169 #endif
14170
14172 {
14173 return true;
14174 }
14175
14177
14179
14181 {
14184 }
14185
14186
14194
14210}
14211
14213{
14215 if (entity)
14216 {
14217 bool is_item = entity.IsInherited(
ItemBase);
14218 if (is_item && full_quantity)
14219 {
14222 }
14223 }
14224 else
14225 {
14227 return NULL;
14228 }
14229 return entity;
14230}
14231
14233{
14234 if (item)
14235 {
14236 if (health > 0)
14237 item.SetHealth("", "", health);
14238
14239 if (item.CanHaveTemperature())
14240 {
14242 if (item.CanFreeze())
14243 item.SetFrozen(false);
14244 }
14245
14246 if (item.HasEnergyManager())
14247 {
14248 if (quantity >= 0)
14249 {
14250 item.GetCompEM().SetEnergy0To1(quantity);
14251 }
14252 else
14253 {
14255 }
14256 }
14257 else if (item.IsMagazine())
14258 {
14259 Magazine mag = Magazine.Cast(item);
14260 if (quantity >= 0)
14261 {
14262 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14263 }
14264 else
14265 {
14267 }
14268
14269 }
14270 else
14271 {
14272 if (quantity >= 0)
14273 {
14274 item.SetQuantityNormalized(quantity, false);
14275 }
14276 else
14277 {
14279 }
14280
14281 }
14282 }
14283}
14284
14285#ifdef DEVELOPER
14287#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.