9376{
9378 {
9379 return true;
9380 }
9381};
9382
9383
9384
9386{
9390
9392
9395
9396
9397
9398
9399
9408
9414
9419
9424
9445 protected bool m_IsResultOfSplit
9446
9448
9453
9454
9455
9457
9461
9462
9463
9465
9468
9469
9470
9476
9477
9485
9488
9489
9491
9492
9494
9495
9500
9501
9506
9507
9509
9510
9512 {
9517
9518 if (!
GetGame().IsDedicatedServer())
9519 {
9521 {
9523
9525 {
9527 }
9528 }
9529
9532 }
9533
9534 m_OldLocation = null;
9535
9537 {
9539 }
9540
9541 if (ConfigIsExisting("headSelectionsToHide"))
9542 {
9545 }
9546
9548 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9549 {
9551 }
9552
9554
9555 m_IsResultOfSplit = false;
9556
9558 }
9559
9561 {
9562 super.InitItemVariables();
9563
9569 m_Count = ConfigGetInt(
"count");
9570
9573
9578
9581
9586
9598
9602
9603
9606 if (ConfigIsExisting("canBeSplit"))
9607 {
9610 }
9611
9613 if (ConfigIsExisting("itemBehaviour"))
9615
9616
9619 RegisterNetSyncVariableInt("m_VarLiquidType");
9620 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9621
9622 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9623 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9624 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9625
9626 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9627 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9628 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9629 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9630
9631 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9632 RegisterNetSyncVariableBool("m_IsTakeable");
9633 RegisterNetSyncVariableBool("m_IsHologram");
9634
9637 {
9640 }
9641
9643
9645 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9647
9648 }
9649
9651 {
9653 }
9654
9656 {
9659 {
9664 }
9665 }
9666
9667 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9668 {
9670 {
9673 }
9674
9676 }
9677
9679 {
9685 }
9686
9688
9690 {
9692
9693 if (!action)
9694 {
9695 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9696 return;
9697 }
9698
9700 if (!ai)
9701 {
9703 return;
9704 }
9705
9707 if (!action_array)
9708 {
9709 action_array = new array<ActionBase_Basic>;
9711 }
9712 if (LogManager.IsActionLogEnable())
9713 {
9714 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9715 }
9716
9717 if (action_array.Find(action) != -1)
9718 {
9719 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9720 }
9721 else
9722 {
9723 action_array.Insert(action);
9724 }
9725 }
9726
9728 {
9730 ActionBase action = player.GetActionManager().GetAction(actionName);
9733
9734 if (action_array)
9735 {
9736 action_array.RemoveItem(action);
9737 }
9738 }
9739
9740
9741
9743 {
9744 ActionOverrideData overrideData = new ActionOverrideData();
9748
9750 if (!actionMap)
9751 {
9754 }
9755
9756 actionMap.Insert(this.
Type(), overrideData);
9757
9758 }
9759
9761
9763
9764
9766 {
9769
9772
9773 string config_to_search = "CfgVehicles";
9774 string muzzle_owner_config;
9775
9777 {
9778 if (IsInherited(Weapon))
9779 config_to_search = "CfgWeapons";
9780
9781 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9782
9783 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9784
9786
9787 if (config_OnFire_subclass_count > 0)
9788 {
9789 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9790
9791 for (int i = 0; i < config_OnFire_subclass_count; i++)
9792 {
9793 string particle_class = "";
9795 string config_OnFire_entry = config_OnFire_class + particle_class;
9796 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9797 WPOF_array.Insert(WPOF);
9798 }
9799
9800
9802 }
9803 }
9804
9806 {
9807 config_to_search = "CfgWeapons";
9808 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9809
9810 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9811
9813
9814 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9815 {
9816 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9817
9818 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9819 {
9820 string particle_class2 = "";
9822 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9823 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9824 WPOBE_array.Insert(WPOBE);
9825 }
9826
9827
9829 }
9830 }
9831 }
9832
9833
9835 {
9838
9840 {
9841 string config_to_search = "CfgVehicles";
9842
9843 if (IsInherited(Weapon))
9844 config_to_search = "CfgWeapons";
9845
9846 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9847 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9848
9849 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9850 {
9851
9853
9855 {
9857 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9859 return;
9860 }
9861
9864
9865
9866
9868 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9869
9870 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9871 {
9872 string particle_class = "";
9874 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9876
9877 if (entry_type == CT_CLASS)
9878 {
9879 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9880 WPOOH_array.Insert(WPOF);
9881 }
9882 }
9883
9884
9886 }
9887 }
9888 }
9889
9891 {
9893 }
9894
9896 {
9898 {
9900
9903
9906
9907 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9908 }
9909 }
9910
9912 {
9914 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9915
9917 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9918
9920 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9921
9923 {
9925 }
9926 }
9927
9929 {
9931 }
9932
9934 {
9937 else
9939
9941 {
9944 }
9945 else
9946 {
9949
9952 }
9953
9955 }
9956
9958 {
9960 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9961 }
9962
9964 {
9966 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9968 }
9969
9971 {
9973 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9974 }
9975
9977 {
9980
9981 OverheatingParticle OP = new OverheatingParticle();
9986
9988 }
9989
9991 {
9994
9995 return -1;
9996 }
9997
9999 {
10001 {
10004
10005 for (int i = count; i > 0; --i)
10006 {
10007 int id = i - 1;
10010
10013
10014 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10015 {
10016 if (p)
10017 {
10020 }
10021 }
10022 }
10023 }
10024 }
10025
10027 {
10029 {
10031 {
10032 int id = i - 1;
10034
10035 if (OP)
10036 {
10038
10039 if (p)
10040 {
10042 }
10043
10044 delete OP;
10045 }
10046 }
10047
10050 }
10051 }
10052
10055 {
10056 return 0.0;
10057 }
10058
10059
10061 {
10062 return 250;
10063 }
10064
10066 {
10067 return 0;
10068 }
10069
10072 {
10074 return true;
10075
10076 return false;
10077 }
10078
10081 {
10084
10086 {
10088 }
10089 else
10090 {
10091
10093 }
10094
10096 }
10097
10104 {
10105 return -1;
10106 }
10107
10108
10109
10110
10112 {
10114 {
10116 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10117
10118 if (r_index >= 0)
10119 {
10120 InventoryLocation r_il = new InventoryLocation;
10121 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10122
10123 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10126 {
10127 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10128 }
10130 {
10131 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10132 }
10133
10134 }
10135
10136 player.GetHumanInventory().ClearUserReservedLocation(this);
10137 }
10138
10141 }
10142
10143
10144
10145
10147 {
10148 return ItemBase.m_DebugActionsMask;
10149 }
10150
10152 {
10153 return ItemBase.m_DebugActionsMask & mask;
10154 }
10155
10157 {
10158 ItemBase.m_DebugActionsMask = mask;
10159 }
10160
10162 {
10163 ItemBase.m_DebugActionsMask |= mask;
10164 }
10165
10167 {
10168 ItemBase.m_DebugActionsMask &= ~mask;
10169 }
10170
10172 {
10174 {
10176 }
10177 else
10178 {
10180 }
10181 }
10182
10183
10185 {
10186 if (GetEconomyProfile())
10187 {
10188 float q_max = GetEconomyProfile().GetQuantityMax();
10189 if (q_max > 0)
10190 {
10191 float q_min = GetEconomyProfile().GetQuantityMin();
10192 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10193
10195 {
10196 ComponentEnergyManager comp = GetCompEM();
10198 {
10200 }
10201 }
10203 {
10205
10206 }
10207
10208 }
10209 }
10210 }
10211
10214 {
10215 EntityAI parent = GetHierarchyParent();
10216
10217 if (parent)
10218 {
10219 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10220 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10221 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10222 }
10223 }
10224
10227 {
10228 EntityAI parent = GetHierarchyParent();
10229
10230 if (parent)
10231 {
10232 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10233 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10234 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10235 }
10236 }
10237
10239 {
10240
10241
10242
10243
10245
10247 {
10248 if (ScriptInputUserData.CanStoreInputUserData())
10249 {
10250 ScriptInputUserData ctx = new ScriptInputUserData;
10256 ctx.
Write(use_stack_max);
10259
10261 {
10262 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10263 }
10264 }
10265 }
10266 else if (!
GetGame().IsMultiplayer())
10267 {
10269 }
10270 }
10271
10273 {
10275 }
10276
10278 {
10280 }
10281
10283 {
10285 }
10286
10288 {
10289
10290 return false;
10291 }
10292
10294 {
10295 return false;
10296 }
10297
10301 {
10302 return false;
10303 }
10304
10306 {
10307 return "";
10308 }
10309
10311
10313 {
10314 return false;
10315 }
10316
10318 {
10319 return true;
10320 }
10321
10322
10323
10325 {
10326 return true;
10327 }
10328
10330 {
10331 return true;
10332 }
10333
10335 {
10336 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10338 }
10339
10341 {
10343 }
10344
10346 {
10348 if (!is_being_placed)
10350 SetSynchDirty();
10351 }
10352
10353
10355
10357 {
10359 }
10360
10362 {
10364 }
10365
10367 {
10368 return 1;
10369 }
10370
10372 {
10373 return false;
10374 }
10375
10377 {
10379 SetSynchDirty();
10380 }
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10417 {
10418 super.OnMovedInsideCargo(container);
10419
10420 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10421 }
10422
10423 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10424 {
10425 super.EEItemLocationChanged(oldLoc,newLoc);
10426
10427 PlayerBase new_player = null;
10428 PlayerBase old_player = null;
10429
10430 if (newLoc.GetParent())
10431 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10432
10433 if (oldLoc.GetParent())
10434 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10435
10437 {
10438 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10439
10440 if (r_index >= 0)
10441 {
10442 InventoryLocation r_il = new InventoryLocation;
10443 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10444
10445 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10448 {
10449 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10450 }
10452 {
10453 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10454 }
10455
10456 }
10457 }
10458
10460 {
10461 if (new_player)
10462 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10463
10464 if (new_player == old_player)
10465 {
10466
10467 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10468 {
10470 {
10471 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10472 {
10473 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10474 }
10475 }
10476 else
10477 {
10478 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10479 }
10480 }
10481
10482 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10483 {
10484 int type = oldLoc.GetType();
10486 {
10487 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10488 }
10490 {
10491 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10492 }
10493 }
10494 if (!m_OldLocation)
10495 {
10496 m_OldLocation = new InventoryLocation;
10497 }
10498 m_OldLocation.Copy(oldLoc);
10499 }
10500 else
10501 {
10502 if (m_OldLocation)
10503 {
10504 m_OldLocation.Reset();
10505 }
10506 }
10507
10509 }
10510 else
10511 {
10512 if (new_player)
10513 {
10514 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10515 if (res_index >= 0)
10516 {
10517 InventoryLocation il = new InventoryLocation;
10518 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10520 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10523 {
10524 il.
GetParent().GetOnReleaseLock().Invoke(it);
10525 }
10527 {
10529 }
10530
10531 }
10532 }
10534 {
10535
10537 }
10538
10539 if (m_OldLocation)
10540 {
10541 m_OldLocation.Reset();
10542 }
10543 }
10544 }
10545
10546 override void EOnContact(IEntity other, Contact extra)
10547 {
10549 {
10550 int liquidType = -1;
10552 if (impactSpeed > 0.0)
10553 {
10555 #ifndef SERVER
10557 #else
10559 SetSynchDirty();
10560 #endif
10562 }
10563 }
10564
10565 #ifdef SERVER
10566 if (GetCompEM() && GetCompEM().IsPlugged())
10567 {
10568 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10569 GetCompEM().UnplugThis();
10570 }
10571 #endif
10572 }
10573
10575
10577 {
10579 }
10580
10582 {
10583
10584 }
10585
10587 {
10588 super.OnItemLocationChanged(old_owner, new_owner);
10589
10590 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10591 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10592
10593 if (!relatedPlayer && playerNew)
10594 relatedPlayer = playerNew;
10595
10596 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10597 {
10599 if (actionMgr)
10600 {
10601 ActionBase currentAction = actionMgr.GetRunningAction();
10602 if (currentAction)
10604 }
10605 }
10606
10607 Man ownerPlayerOld = null;
10608 Man ownerPlayerNew = null;
10609
10610 if (old_owner)
10611 {
10612 if (old_owner.
IsMan())
10613 {
10614 ownerPlayerOld = Man.Cast(old_owner);
10615 }
10616 else
10617 {
10618 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10619 }
10620 }
10621 else
10622 {
10624 {
10626
10627 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10628 {
10629 GetCompEM().UnplugThis();
10630 }
10631 }
10632 }
10633
10634 if (new_owner)
10635 {
10636 if (new_owner.
IsMan())
10637 {
10638 ownerPlayerNew = Man.Cast(new_owner);
10639 }
10640 else
10641 {
10642 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10643 }
10644 }
10645
10646 if (ownerPlayerOld != ownerPlayerNew)
10647 {
10648 if (ownerPlayerOld)
10649 {
10650 array<EntityAI> subItemsExit = new array<EntityAI>;
10652 for (int i = 0; i < subItemsExit.Count(); i++)
10653 {
10656 }
10657 }
10658
10659 if (ownerPlayerNew)
10660 {
10661 array<EntityAI> subItemsEnter = new array<EntityAI>;
10663 for (int j = 0; j < subItemsEnter.Count(); j++)
10664 {
10667 }
10668 }
10669 }
10670 else if (ownerPlayerNew != null)
10671 {
10672 PlayerBase nplayer;
10673 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10674 {
10675 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10677 for (int k = 0; k < subItemsUpdate.Count(); k++)
10678 {
10680 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10681 }
10682 }
10683 }
10684
10685 if (old_owner)
10686 old_owner.OnChildItemRemoved(this);
10687 if (new_owner)
10688 new_owner.OnChildItemReceived(this);
10689 }
10690
10691
10693 {
10694 super.EEDelete(parent);
10695 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10696 if (player)
10697 {
10699
10700 if (player.IsAlive())
10701 {
10702 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10703 if (r_index >= 0)
10704 {
10705 InventoryLocation r_il = new InventoryLocation;
10706 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10707
10708 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10711 {
10712 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10713 }
10715 {
10716 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10717 }
10718
10719 }
10720
10721 player.RemoveQuickBarEntityShortcut(this);
10722 }
10723 }
10724 }
10725
10727 {
10728 super.EEKilled(killer);
10729
10732 {
10733 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10734 {
10735 if (IsMagazine())
10736 {
10737 if (Magazine.Cast(this).GetAmmoCount() > 0)
10738 {
10740 }
10741 }
10742 else
10743 {
10745 }
10746 }
10747 }
10748 }
10749
10751 {
10752 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10753
10754 super.OnWasAttached(parent, slot_id);
10755
10758
10760 }
10761
10763 {
10764 super.OnWasDetached(parent, slot_id);
10765
10768 }
10769
10771 {
10772 int idx;
10775
10776 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10777 if (inventory_slots.Count() < 1)
10778 {
10779 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10780 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10781 }
10782 else
10783 {
10784 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10785 }
10786
10787 idx = inventory_slots.Find(slot);
10788 if (idx < 0)
10789 return "";
10790
10791 return attach_types.Get(idx);
10792 }
10793
10795 {
10796 int idx = -1;
10797 string slot;
10798
10801
10802 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10803 if (inventory_slots.Count() < 1)
10804 {
10805 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10806 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10807 }
10808 else
10809 {
10810 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10811 if (detach_types.Count() < 1)
10812 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10813 }
10814
10815 for (int i = 0; i < inventory_slots.Count(); i++)
10816 {
10817 slot = inventory_slots.Get(i);
10818 }
10819
10820 if (slot != "")
10821 {
10822 if (detach_types.Count() == 1)
10823 idx = 0;
10824 else
10825 idx = inventory_slots.Find(slot);
10826 }
10827 if (idx < 0)
10828 return "";
10829
10830 return detach_types.Get(idx);
10831 }
10832
10834 {
10835
10837
10838
10839 float min_time = 1;
10840 float max_time = 3;
10841 float delay = Math.RandomFloat(min_time, max_time);
10842
10843 explode_timer.Run(delay, this, "DoAmmoExplosion");
10844 }
10845
10847 {
10848 Magazine magazine = Magazine.Cast(this);
10849 int pop_sounds_count = 6;
10850 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10851
10852
10853 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10854 string sound_name = pop_sounds[ sound_idx ];
10856
10857
10858 magazine.ServerAddAmmoCount(-1);
10859
10860
10861 float min_temp_to_explode = 100;
10862
10863 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10864 {
10866 }
10867 }
10868
10869
10870 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10871 {
10872 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10873
10874 const int CHANCE_DAMAGE_CARGO = 4;
10875 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10876 const int CHANCE_DAMAGE_NOTHING = 2;
10877
10879 {
10880 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10881 int chances;
10882 int rnd;
10883
10884 if (GetInventory().GetCargo())
10885 {
10886 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10887 rnd = Math.RandomInt(0,chances);
10888
10889 if (rnd < CHANCE_DAMAGE_CARGO)
10890 {
10892 }
10893 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10894 {
10896 }
10897 }
10898 else
10899 {
10900 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10901 rnd = Math.RandomInt(0,chances);
10902
10903 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10904 {
10906 }
10907 }
10908 }
10909 }
10910
10912 {
10913 if (GetInventory().GetCargo())
10914 {
10915 int item_count = GetInventory().GetCargo().GetItemCount();
10916 if (item_count > 0)
10917 {
10918 int random_pick = Math.RandomInt(0, item_count);
10920 if (!item.IsExplosive())
10921 {
10922 item.AddHealth("","",damage);
10923 return true;
10924 }
10925 }
10926 }
10927 return false;
10928 }
10929
10931 {
10932 int attachment_count = GetInventory().AttachmentCount();
10933 if (attachment_count > 0)
10934 {
10935 int random_pick = Math.RandomInt(0, attachment_count);
10936 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10937 if (!attachment.IsExplosive())
10938 {
10939 attachment.AddHealth("","",damage);
10940 return true;
10941 }
10942 }
10943 return false;
10944 }
10945
10947 {
10949 }
10950
10952 {
10954 return GetInventory().CanRemoveEntity();
10955
10956 return false;
10957 }
10958
10960 {
10961
10963 return false;
10964
10965
10967 return false;
10968
10969
10970
10972 if (delta == 0)
10973 return false;
10974
10975
10976 return true;
10977 }
10978
10980 {
10982 {
10983 if (ScriptInputUserData.CanStoreInputUserData())
10984 {
10985 ScriptInputUserData ctx = new ScriptInputUserData;
10990 ctx.
Write(destination_entity);
10992 ctx.
Write(slot_id);
10994 }
10995 }
10996 else if (!
GetGame().IsMultiplayer())
10997 {
10999 }
11000 }
11001
11003 {
11004 float split_quantity_new;
11008 InventoryLocation loc = new InventoryLocation;
11009
11010 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11011 {
11013 split_quantity_new = stack_max;
11014 else
11016
11018 {
11019 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11020 if (new_item)
11021 {
11022 new_item.SetResultOfSplit(true);
11023 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11025 new_item.
SetQuantity(split_quantity_new,
false,
true);
11026 }
11027 }
11028 }
11029 else if (destination_entity && slot_id == -1)
11030 {
11031 if (quantity > stack_max)
11032 split_quantity_new = stack_max;
11033 else
11034 split_quantity_new = quantity;
11035
11037 {
11039 {
11042 }
11043
11044 if (new_item)
11045 {
11046 new_item.SetResultOfSplit(true);
11047 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11049 new_item.
SetQuantity(split_quantity_new,
false,
true);
11050 }
11051 }
11052 }
11053 else
11054 {
11055 if (stack_max != 0)
11056 {
11058 {
11060 }
11061
11062 if (split_quantity_new == 0)
11063 {
11064 if (!
GetGame().IsMultiplayer())
11065 player.PhysicalPredictiveDropItem(this);
11066 else
11067 player.ServerDropEntity(this);
11068 return;
11069 }
11070
11072 {
11074
11075 if (new_item)
11076 {
11077 new_item.SetResultOfSplit(true);
11078 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11081 new_item.PlaceOnSurface();
11082 }
11083 }
11084 }
11085 }
11086 }
11087
11089 {
11090 float split_quantity_new;
11094 InventoryLocation loc = new InventoryLocation;
11095
11096 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11097 {
11099 split_quantity_new = stack_max;
11100 else
11102
11104 {
11105 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11106 if (new_item)
11107 {
11108 new_item.SetResultOfSplit(true);
11109 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11111 new_item.
SetQuantity(split_quantity_new,
false,
true);
11112 }
11113 }
11114 }
11115 else if (destination_entity && slot_id == -1)
11116 {
11117 if (quantity > stack_max)
11118 split_quantity_new = stack_max;
11119 else
11120 split_quantity_new = quantity;
11121
11123 {
11125 {
11128 }
11129
11130 if (new_item)
11131 {
11132 new_item.SetResultOfSplit(true);
11133 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11135 new_item.
SetQuantity(split_quantity_new,
false,
true);
11136 }
11137 }
11138 }
11139 else
11140 {
11141 if (stack_max != 0)
11142 {
11144 {
11146 }
11147
11149 {
11151
11152 if (new_item)
11153 {
11154 new_item.SetResultOfSplit(true);
11155 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11158 new_item.PlaceOnSurface();
11159 }
11160 }
11161 }
11162 }
11163 }
11164
11166 {
11168 {
11169 if (ScriptInputUserData.CanStoreInputUserData())
11170 {
11171 ScriptInputUserData ctx = new ScriptInputUserData;
11176 dst.WriteToContext(ctx);
11178 }
11179 }
11180 else if (!
GetGame().IsMultiplayer())
11181 {
11183 }
11184 }
11185
11187 {
11189 {
11190 if (ScriptInputUserData.CanStoreInputUserData())
11191 {
11192 ScriptInputUserData ctx = new ScriptInputUserData;
11197 ctx.
Write(destination_entity);
11203 }
11204 }
11205 else if (!
GetGame().IsMultiplayer())
11206 {
11208 }
11209 }
11210
11212 {
11214 }
11215
11217 {
11219 float split_quantity_new;
11221 if (dst.IsValid())
11222 {
11223 int slot_id = dst.GetSlot();
11225
11226 if (quantity > stack_max)
11227 split_quantity_new = stack_max;
11228 else
11229 split_quantity_new = quantity;
11230
11232 {
11234
11235 if (new_item)
11236 {
11237 new_item.SetResultOfSplit(true);
11238 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11240 new_item.
SetQuantity(split_quantity_new,
false,
true);
11241 }
11242
11243 return new_item;
11244 }
11245 }
11246
11247 return null;
11248 }
11249
11251 {
11253 float split_quantity_new;
11255 if (destination_entity)
11256 {
11258 if (quantity > stackable)
11259 split_quantity_new = stackable;
11260 else
11261 split_quantity_new = quantity;
11262
11264 {
11265 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11266 if (new_item)
11267 {
11268 new_item.SetResultOfSplit(true);
11269 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11271 new_item.
SetQuantity(split_quantity_new,
false,
true);
11272 }
11273 }
11274 }
11275 }
11276
11278 {
11280 {
11281 if (ScriptInputUserData.CanStoreInputUserData())
11282 {
11283 ScriptInputUserData ctx = new ScriptInputUserData;
11288 ItemBase destination_entity =
this;
11289 ctx.
Write(destination_entity);
11293 }
11294 }
11295 else if (!
GetGame().IsMultiplayer())
11296 {
11298 }
11299 }
11300
11302 {
11304 float split_quantity_new;
11306 if (player)
11307 {
11309 if (quantity > stackable)
11310 split_quantity_new = stackable;
11311 else
11312 split_quantity_new = quantity;
11313
11315 {
11316 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11317 new_item =
ItemBase.Cast(in_hands);
11318 if (new_item)
11319 {
11320 new_item.SetResultOfSplit(true);
11321 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11323 new_item.SetQuantity(split_quantity_new, false, true);
11324 }
11325 }
11326 }
11327 }
11328
11330 {
11332 float split_quantity_new = Math.Floor(quantity * 0.5);
11333
11335 return;
11336
11338
11339 if (new_item)
11340 {
11341 if (new_item.GetQuantityMax() < split_quantity_new)
11342 {
11343 split_quantity_new = new_item.GetQuantityMax();
11344 }
11345
11346 new_item.SetResultOfSplit(true);
11347 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11348
11350 {
11353 }
11354 else
11355 {
11357 new_item.
SetQuantity(split_quantity_new,
false,
true);
11358 }
11359 }
11360 }
11361
11363 {
11365 float split_quantity_new = Math.Floor(quantity / 2);
11366
11368 return;
11369
11370 InventoryLocation invloc = new InventoryLocation;
11372
11374 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11375
11376 if (new_item)
11377 {
11378 if (new_item.GetQuantityMax() < split_quantity_new)
11379 {
11380 split_quantity_new = new_item.GetQuantityMax();
11381 }
11383 {
11386 }
11387 else if (split_quantity_new > 1)
11388 {
11390 new_item.
SetQuantity(split_quantity_new,
false,
true);
11391 }
11392 }
11393 }
11394
11397 {
11398 SetWeightDirty();
11400
11401 if (parent)
11402 parent.OnAttachmentQuantityChangedEx(this, delta);
11403
11405 {
11407 {
11409 }
11411 {
11412 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11414 }
11415 }
11416
11417 }
11418
11421 {
11422
11423 }
11424
11427 {
11429 }
11430
11432 {
11433 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11434
11436 {
11437 if (newLevel == GameConstants.STATE_RUINED)
11438 {
11440 EntityAI parent = GetHierarchyParent();
11441 if (parent && parent.IsFireplace())
11442 {
11443 CargoBase cargo = GetInventory().GetCargo();
11444 if (cargo)
11445 {
11447 {
11449 }
11450 }
11451 }
11452 }
11453
11455 {
11456
11458 return;
11459 }
11460
11461 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11462 {
11464 }
11465 }
11466 }
11467
11468
11470 {
11471 super.OnRightClick();
11472
11474 {
11476 {
11477 if (ScriptInputUserData.CanStoreInputUserData())
11478 {
11479 EntityAI root = GetHierarchyRoot();
11480 Man playerOwner = GetHierarchyRootPlayer();
11481 InventoryLocation dst = new InventoryLocation;
11482
11483
11484 if (!playerOwner && root && root == this)
11485 {
11487 }
11488 else
11489 {
11490
11491 GetInventory().GetCurrentInventoryLocation(dst);
11493 {
11496 {
11498 }
11499 else
11500 {
11502
11503
11504 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11505 {
11507 }
11508 else
11509 {
11510 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11511 }
11512 }
11513 }
11514 }
11515
11516 ScriptInputUserData ctx = new ScriptInputUserData;
11524 }
11525 }
11526 else if (!
GetGame().IsMultiplayer())
11527 {
11529 }
11530 }
11531 }
11532
11534 {
11535 if (root)
11536 {
11537 vector m4[4];
11538 root.GetTransform(m4);
11539 dst.SetGround(this, m4);
11540 }
11541 else
11542 {
11543 GetInventory().GetCurrentInventoryLocation(dst);
11544 }
11545 }
11546
11547 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11548 {
11549
11550 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11551 return false;
11552
11553 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11554 return false;
11555
11556
11558 return false;
11559
11560
11561 Magazine mag = Magazine.Cast(this);
11562 if (mag)
11563 {
11564 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11565 return false;
11566
11567 if (stack_max_limit)
11568 {
11569 Magazine other_mag = Magazine.Cast(other_item);
11570 if (other_item)
11571 {
11572 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11573 return false;
11574 }
11575
11576 }
11577 }
11578 else
11579 {
11580
11582 return false;
11583
11585 return false;
11586 }
11587
11588 PlayerBase player = null;
11589 if (CastTo(player, GetHierarchyRootPlayer()))
11590 {
11591 if (player.GetInventory().HasAttachment(this))
11592 return false;
11593
11594 if (player.IsItemsToDelete())
11595 return false;
11596 }
11597
11598 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11599 return false;
11600
11601 int slotID;
11603 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11604 return false;
11605
11606 return true;
11607 }
11608
11610 {
11612 }
11613
11615 {
11616 return m_IsResultOfSplit;
11617 }
11618
11620 {
11621 m_IsResultOfSplit = value;
11622 }
11623
11625 {
11627 }
11628
11630 {
11631 float other_item_quantity = other_item.GetQuantity();
11632 float this_free_space;
11633
11635
11637
11638 if (other_item_quantity > this_free_space)
11639 {
11640 return this_free_space;
11641 }
11642 else
11643 {
11644 return other_item_quantity;
11645 }
11646 }
11647
11649 {
11651 }
11652
11654 {
11656 return;
11657
11658 if (!IsMagazine() && other_item)
11659 {
11661 if (quantity_used != 0)
11662 {
11663 float hp1 = GetHealth01("","");
11664 float hp2 = other_item.GetHealth01("","");
11665 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11666 hpResult = hpResult / (
GetQuantity() + quantity_used);
11667
11668 hpResult *= GetMaxHealth();
11669 Math.Round(hpResult);
11670 SetHealth("", "Health", hpResult);
11671
11673 other_item.AddQuantity(-quantity_used);
11674 }
11675 }
11677 }
11678
11680 {
11681 #ifdef SERVER
11682 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11683 GetHierarchyParent().IncreaseLifetimeUp();
11684 #endif
11685 };
11686
11688 {
11689 PlayerBase p = PlayerBase.Cast(player);
11690
11691 array<int> recipesIds = p.m_Recipes;
11692 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11693 if (moduleRecipesManager)
11694 {
11695 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11696 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11697 }
11698
11699 for (int i = 0;i < recipesIds.Count(); i++)
11700 {
11701 int key = recipesIds.Get(i);
11702 string recipeName = moduleRecipesManager.GetRecipeName(key);
11704 }
11705 }
11706
11707
11708 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11709 {
11710 super.GetDebugActions(outputList);
11711
11712
11718
11719
11724
11729
11730
11734
11735
11737 {
11741 }
11742
11745
11746
11750
11752
11753 InventoryLocation loc = new InventoryLocation();
11754 GetInventory().GetCurrentInventoryLocation(loc);
11756 {
11757 if (Gizmo_IsSupported())
11760 }
11761
11763 }
11764
11765
11766
11767
11769 {
11770 super.OnAction(action_id, player, ctx);
11771
11773 {
11774 switch (action_id)
11775 {
11778 return true;
11781 return true;
11782 }
11783 }
11784
11786 {
11787 switch (action_id)
11788 {
11790 Delete();
11791 return true;
11792 }
11793 }
11794
11795 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11796 {
11797 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11798 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11799 PlayerBase p = PlayerBase.Cast(player);
11800 if (
EActions.RECIPES_RANGE_START < 1000)
11801 {
11802 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11803 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11804 }
11805 }
11806 #ifndef SERVER
11807 else if (action_id ==
EActions.WATCH_PLAYER)
11808 {
11809 PluginDeveloper.SetDeveloperItemClientEx(player);
11810 }
11811 #endif
11813 {
11814 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11815 {
11816 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11817 OnDebugButtonPressServer(id + 1);
11818 }
11819
11820 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11821 {
11822 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11824 }
11825
11826 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11827 {
11828 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11830 }
11831
11832 else if (action_id ==
EActions.ADD_QUANTITY)
11833 {
11834 if (IsMagazine())
11835 {
11836 Magazine mag = Magazine.Cast(this);
11837 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11838 }
11839 else
11840 {
11842 }
11843
11844 if (m_EM)
11845 {
11846 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11847 }
11848
11849 }
11850
11851 else if (action_id ==
EActions.REMOVE_QUANTITY)
11852 {
11853 if (IsMagazine())
11854 {
11855 Magazine mag2 = Magazine.Cast(this);
11856 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11857 }
11858 else
11859 {
11861 }
11862 if (m_EM)
11863 {
11864 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11865 }
11866
11867 }
11868
11869 else if (action_id ==
EActions.SET_QUANTITY_0)
11870 {
11872
11873 if (m_EM)
11874 {
11875 m_EM.SetEnergy(0);
11876 }
11877 }
11878
11879 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11880 {
11882
11883 if (m_EM)
11884 {
11885 m_EM.SetEnergy(m_EM.GetEnergyMax());
11886 }
11887 }
11888
11889 else if (action_id ==
EActions.ADD_HEALTH)
11890 {
11891 AddHealth("","",GetMaxHealth("","Health")/5);
11892 }
11893 else if (action_id ==
EActions.REMOVE_HEALTH)
11894 {
11895 AddHealth("","",-GetMaxHealth("","Health")/5);
11896 }
11897 else if (action_id ==
EActions.DESTROY_HEALTH)
11898 {
11899 SetHealth01("","",0);
11900 }
11901 else if (action_id ==
EActions.WATCH_ITEM)
11902 {
11904 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11905 #ifdef DEVELOPER
11906 SetDebugDeveloper_item(this);
11907 #endif
11908 }
11909
11910 else if (action_id ==
EActions.ADD_TEMPERATURE)
11911 {
11912 AddTemperature(20);
11913
11914 }
11915
11916 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11917 {
11918 AddTemperature(-20);
11919
11920 }
11921
11922 else if (action_id ==
EActions.FLIP_FROZEN)
11923 {
11924 SetFrozen(!GetIsFrozen());
11925
11926 }
11927
11928 else if (action_id ==
EActions.ADD_WETNESS)
11929 {
11931
11932 }
11933
11934 else if (action_id ==
EActions.REMOVE_WETNESS)
11935 {
11937
11938 }
11939
11940 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11941 {
11944
11945
11946 }
11947
11948 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11949 {
11952 }
11953
11954 else if (action_id ==
EActions.MAKE_SPECIAL)
11955 {
11956 auto debugParams = DebugSpawnParams.WithPlayer(player);
11957 OnDebugSpawnEx(debugParams);
11958 }
11959
11960 }
11961
11962
11963 return false;
11964 }
11965
11966
11967
11968
11972
11975
11976
11977
11979 {
11980 return false;
11981 }
11982
11983
11985 {
11986 return true;
11987 }
11988
11989
11991 {
11992 return true;
11993 }
11994
11995
11996
11998 {
11999 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12001 }
12002
12005 {
12006 return null;
12007 }
12008
12010 {
12011 return false;
12012 }
12013
12015 {
12016 return false;
12017 }
12018
12022
12023
12025 {
12026 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12027 return module_repairing.CanRepair(this, item_repair_kit);
12028 }
12029
12030
12031 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12032 {
12033 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12034 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12035 }
12036
12037
12039 {
12040
12041
12042
12043
12044
12045
12046
12047
12048 return 1;
12049 }
12050
12051
12052
12054 {
12056 }
12057
12058
12059
12061 {
12063 }
12064
12065
12074 {
12075 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12076
12077 if (player)
12078 {
12079 player.MessageStatus(text);
12080 }
12081 }
12082
12083
12092 {
12093 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12094
12095 if (player)
12096 {
12097 player.MessageAction(text);
12098 }
12099 }
12100
12101
12110 {
12111 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12112
12113 if (player)
12114 {
12115 player.MessageFriendly(text);
12116 }
12117 }
12118
12119
12128 {
12129 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12130
12131 if (player)
12132 {
12133 player.MessageImportant(text);
12134 }
12135 }
12136
12138 {
12139 return true;
12140 }
12141
12142
12143 override bool KindOf(
string tag)
12144 {
12145 bool found = false;
12146 string item_name = this.
GetType();
12149
12150 int array_size = item_tag_array.Count();
12151 for (int i = 0; i < array_size; i++)
12152 {
12153 if (item_tag_array.Get(i) == tag)
12154 {
12155 found = true;
12156 break;
12157 }
12158 }
12159 return found;
12160 }
12161
12162
12164 {
12165
12166 super.OnRPC(sender, rpc_type,ctx);
12167
12168
12169 switch (rpc_type)
12170 {
12171 #ifndef SERVER
12172 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12173 Param2<bool, string> p = new Param2<bool, string>(false, "");
12174
12176 return;
12177
12178 bool play = p.param1;
12179 string soundSet = p.param2;
12180
12181 if (play)
12182 {
12184 {
12186 {
12188 }
12189 }
12190 else
12191 {
12193 }
12194 }
12195 else
12196 {
12198 }
12199
12200 break;
12201 #endif
12202
12203 }
12204
12206 {
12208 }
12209 }
12210
12211
12212
12213
12215 {
12216 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12217 return plugin.GetID(
name);
12218 }
12219
12221 {
12222 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12223 return plugin.GetName(id);
12224 }
12225
12228 {
12229
12230
12231 int varFlags;
12232 if (!ctx.
Read(varFlags))
12233 return;
12234
12235 if (varFlags & ItemVariableFlags.FLOAT)
12236 {
12238 }
12239 }
12240
12242 {
12243
12244 super.SerializeNumericalVars(floats_out);
12245
12246
12247
12249 {
12251 }
12252
12254 {
12256 }
12257
12259 {
12261 }
12262
12264 {
12269 }
12270
12272 {
12274 }
12275 }
12276
12278 {
12279
12280 super.DeSerializeNumericalVars(floats);
12281
12282
12283 int index = 0;
12284 int mask = Math.Round(floats.Get(index));
12285
12286 index++;
12287
12289 {
12291 {
12293 }
12294 else
12295 {
12296 float quantity = floats.Get(index);
12297 SetQuantity(quantity,
true,
false,
false,
false);
12298 }
12299 index++;
12300 }
12301
12303 {
12304 float wet = floats.Get(index);
12306 index++;
12307 }
12308
12310 {
12311 int liquidtype = Math.Round(floats.Get(index));
12313 index++;
12314 }
12315
12317 {
12319 index++;
12321 index++;
12323 index++;
12325 index++;
12326 }
12327
12329 {
12330 int cleanness = Math.Round(floats.Get(index));
12332 index++;
12333 }
12334 }
12335
12337 {
12338 super.WriteVarsToCTX(ctx);
12339
12340
12342 {
12344 }
12345
12347 {
12349 }
12350
12352 {
12354 }
12355
12357 {
12358 int r,g,b,a;
12364 }
12365
12367 {
12369 }
12370 }
12371
12373 {
12374 if (!super.ReadVarsFromCTX(ctx,version))
12375 return false;
12376
12377 int intValue;
12378 float value;
12379
12380 if (version < 140)
12381 {
12382 if (!ctx.
Read(intValue))
12383 return false;
12384
12385 m_VariablesMask = intValue;
12386 }
12387
12389 {
12390 if (!ctx.
Read(value))
12391 return false;
12392
12394 {
12396 }
12397 else
12398 {
12400 }
12401 }
12402
12403 if (version < 140)
12404 {
12406 {
12407 if (!ctx.
Read(value))
12408 return false;
12409 SetTemperatureDirect(value);
12410 }
12411 }
12412
12414 {
12415 if (!ctx.
Read(value))
12416 return false;
12418 }
12419
12421 {
12422 if (!ctx.
Read(intValue))
12423 return false;
12425 }
12426
12428 {
12429 int r,g,b,a;
12431 return false;
12433 return false;
12435 return false;
12437 return false;
12438
12440 }
12441
12443 {
12444 if (!ctx.
Read(intValue))
12445 return false;
12447 }
12448
12449 if (version >= 138 && version < 140)
12450 {
12452 {
12453 if (!ctx.
Read(intValue))
12454 return false;
12455 SetFrozen(intValue);
12456 }
12457 }
12458
12459 return true;
12460 }
12461
12462
12464 {
12467 {
12469 }
12470
12471 if (!super.OnStoreLoad(ctx, version))
12472 {
12474 return false;
12475 }
12476
12477 if (version >= 114)
12478 {
12479 bool hasQuickBarIndexSaved;
12480
12481 if (!ctx.
Read(hasQuickBarIndexSaved))
12482 {
12484 return false;
12485 }
12486
12487 if (hasQuickBarIndexSaved)
12488 {
12489 int itmQBIndex;
12490
12491
12492 if (!ctx.
Read(itmQBIndex))
12493 {
12495 return false;
12496 }
12497
12498 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12499 if (itmQBIndex != -1 && parentPlayer)
12500 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12501 }
12502 }
12503 else
12504 {
12505
12506 PlayerBase player;
12507 int itemQBIndex;
12508 if (version ==
int.
MAX)
12509 {
12510 if (!ctx.
Read(itemQBIndex))
12511 {
12513 return false;
12514 }
12515 }
12516 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12517 {
12518
12519 if (!ctx.
Read(itemQBIndex))
12520 {
12522 return false;
12523 }
12524 if (itemQBIndex != -1 && player)
12525 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12526 }
12527 }
12528
12529 if (version < 140)
12530 {
12531
12532 if (!LoadVariables(ctx, version))
12533 {
12535 return false;
12536 }
12537 }
12538
12539
12541 {
12543 return false;
12544 }
12545 if (version >= 132)
12546 {
12548 if (raib)
12549 {
12551 {
12553 return false;
12554 }
12555 }
12556 }
12557
12559 return true;
12560 }
12561
12562
12563
12565 {
12566 super.OnStoreSave(ctx);
12567
12568 PlayerBase player;
12569 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12570 {
12572
12573 int itemQBIndex = -1;
12574 itemQBIndex = player.FindQuickBarEntityIndex(this);
12575 ctx.
Write(itemQBIndex);
12576 }
12577 else
12578 {
12580 }
12581
12583
12585 if (raib)
12586 {
12588 }
12589 }
12590
12591
12593 {
12594 super.AfterStoreLoad();
12595
12597 {
12599 }
12600
12602 {
12605 }
12606 }
12607
12609 {
12610 super.EEOnAfterLoad();
12611
12613 {
12615 }
12616
12619 }
12620
12622 {
12623 return false;
12624 }
12625
12626
12627
12629 {
12631 {
12632 #ifdef PLATFORM_CONSOLE
12633
12635 {
12637 if (menu)
12638 {
12640 }
12641 }
12642 #endif
12643 }
12644
12646 {
12649 }
12650
12652 {
12653 SetWeightDirty();
12655 }
12657 {
12660 }
12661
12663 {
12666 }
12668 {
12671 }
12672
12673 super.OnVariablesSynchronized();
12674 }
12675
12676
12677
12679 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12680 {
12681 if (!IsServerCheck(allow_client))
12682 return false;
12683
12685 return false;
12686
12689
12690 if (value <= (min + 0.001))
12691 value = min;
12692
12693 if (value == min)
12694 {
12695 if (destroy_config)
12696 {
12697 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12698 if (dstr)
12699 {
12701 this.Delete();
12702 return true;
12703 }
12704 }
12705 else if (destroy_forced)
12706 {
12708 this.Delete();
12709 return true;
12710 }
12711
12713 }
12714
12717
12719 {
12721
12722 if (delta)
12724 }
12725
12727
12728 return false;
12729 }
12730
12731
12733 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12734 {
12736 }
12737
12739 {
12742 }
12743
12745 {
12748 }
12749
12751 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12752 {
12753 float value_clamped = Math.Clamp(value, 0, 1);
12755 SetQuantity(result, destroy_config, destroy_forced);
12756 }
12757
12758
12761 {
12763 }
12764
12766 {
12768 }
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12780 {
12781 int slot = -1;
12782 if (GetInventory())
12783 {
12784 InventoryLocation il = new InventoryLocation;
12785 GetInventory().GetCurrentInventoryLocation(il);
12787 }
12788
12790 }
12791
12793 {
12794 float quantity_max = 0;
12795
12797 {
12798 if (attSlotID != -1)
12799 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12800
12801 if (quantity_max <= 0)
12803 }
12804
12805 if (quantity_max <= 0)
12807
12808 return quantity_max;
12809 }
12810
12812 {
12814 }
12815
12817 {
12819 }
12820
12821
12823 {
12825 }
12826
12828 {
12830 }
12831
12833 {
12835 }
12836
12837
12839 {
12840
12841 float weightEx = GetWeightEx();
12842 float special = GetInventoryAndCargoWeight();
12843 return weightEx - special;
12844 }
12845
12846
12848 {
12850 }
12851
12853 {
12855 {
12856 #ifdef DEVELOPER
12857 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12858 {
12859 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12861 }
12862 #endif
12863
12864 return GetQuantity() * GetConfigWeightModified();
12865 }
12866 else if (HasEnergyManager())
12867 {
12868 #ifdef DEVELOPER
12869 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12870 {
12871 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12872 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12873 }
12874 #endif
12875 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12876 }
12877 else
12878 {
12879 #ifdef DEVELOPER
12880 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12881 {
12882 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12883 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12884 }
12885 #endif
12886 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12887 }
12888 }
12889
12892 {
12893 int item_count = 0;
12895
12896 if (GetInventory().GetCargo() != NULL)
12897 {
12898 item_count = GetInventory().GetCargo().GetItemCount();
12899 }
12900
12901 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12902 {
12903 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12904 if (item)
12905 item_count += item.GetNumberOfItems();
12906 }
12907 return item_count;
12908 }
12909
12912 {
12913 float weight = 0;
12914 float wetness = 1;
12915 if (include_wetness)
12918 {
12919 weight = wetness * m_ConfigWeight;
12920 }
12922 {
12923 weight = 1;
12924 }
12925 return weight;
12926 }
12927
12928
12929
12931 {
12932 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12933 {
12934 GameInventory inv = GetInventory();
12935 array<EntityAI> items = new array<EntityAI>;
12937 for (int i = 0; i < items.Count(); i++)
12938 {
12940 if (item)
12941 {
12943 }
12944 }
12945 }
12946 }
12947
12948
12949
12950
12952 {
12953 float energy = 0;
12954 if (HasEnergyManager())
12955 {
12956 energy = GetCompEM().GetEnergy();
12957 }
12958 return energy;
12959 }
12960
12961
12963 {
12964 super.OnEnergyConsumed();
12965
12967 }
12968
12970 {
12971 super.OnEnergyAdded();
12972
12974 }
12975
12976
12978 {
12979 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12980 {
12982 {
12983 float energy_0to1 = GetCompEM().GetEnergy0To1();
12985 }
12986 }
12987 }
12988
12989
12991 {
12992 return ConfigGetFloat("heatIsolation");
12993 }
12994
12996 {
12998 }
12999
13001 {
13002 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13003 if (
GetGame().ConfigIsExisting(paramPath))
13005
13006 return 0.0;
13007 }
13008
13010 {
13011 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13012 if (
GetGame().ConfigIsExisting(paramPath))
13014
13015 return 0.0;
13016 }
13017
13018 override void SetWet(
float value,
bool allow_client =
false)
13019 {
13020 if (!IsServerCheck(allow_client))
13021 return;
13022
13025
13027
13028 m_VarWet = Math.Clamp(value, min, max);
13029
13031 {
13034 }
13035 }
13036
13037 override void AddWet(
float value)
13038 {
13040 }
13041
13043 {
13045 }
13046
13048 {
13050 }
13051
13053 {
13055 }
13056
13058 {
13060 }
13061
13063 {
13065 }
13066
13067 override void OnWetChanged(
float newVal,
float oldVal)
13068 {
13071 if (newLevel != oldLevel)
13072 {
13074 }
13075 }
13076
13078 {
13079 SetWeightDirty();
13080 }
13081
13083 {
13084 return GetWetLevelInternal(
m_VarWet);
13085 }
13086
13087
13088
13090 {
13092 }
13093
13095 {
13097 }
13098
13100 {
13102 }
13103
13105 {
13107 }
13108
13109
13110
13112 {
13113 if (ConfigIsExisting("itemModelLength"))
13114 {
13115 return ConfigGetFloat("itemModelLength");
13116 }
13117 return 0;
13118 }
13119
13121 {
13122 if (ConfigIsExisting("itemAttachOffset"))
13123 {
13124 return ConfigGetFloat("itemAttachOffset");
13125 }
13126 return 0;
13127 }
13128
13129 override void SetCleanness(
int value,
bool allow_client =
false)
13130 {
13131 if (!IsServerCheck(allow_client))
13132 return;
13133
13135
13137
13140 }
13141
13143 {
13145 }
13146
13148 {
13149 return true;
13150 }
13151
13152
13153
13154
13156 {
13158 }
13159
13161 {
13163 }
13164
13165
13166
13167
13168 override void SetColor(
int r,
int g,
int b,
int a)
13169 {
13175 }
13177 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13178 {
13183 }
13184
13186 {
13188 }
13189
13192 {
13193 int r,g,b,a;
13195 r = r/255;
13196 g = g/255;
13197 b = b/255;
13198 a = a/255;
13199 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13200 }
13201
13202
13203
13204 override void SetLiquidType(
int value,
bool allow_client =
false)
13205 {
13206 if (!IsServerCheck(allow_client))
13207 return;
13208
13213 }
13214
13216 {
13217 return ConfigGetInt("varLiquidTypeInit");
13218 }
13219
13221 {
13223 }
13224
13226 {
13228 SetFrozen(false);
13229 }
13230
13233 {
13234 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13235 }
13236
13237
13240 {
13241 PlayerBase nplayer;
13242 if (PlayerBase.CastTo(nplayer, player))
13243 {
13245
13246 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13247 }
13248 }
13249
13250
13253 {
13254 PlayerBase nplayer;
13255 if (PlayerBase.CastTo(nplayer,player))
13256 {
13257
13258 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13259
13260 }
13261
13262
13263 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13264
13265
13266 if (HasEnergyManager())
13267 {
13268 GetCompEM().UpdatePlugState();
13269 }
13270 }
13271
13272
13274 {
13275 super.OnPlacementStarted(player);
13276
13278 }
13279
13280 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13281 {
13283 {
13284 m_AdminLog.OnPlacementComplete(player,
this);
13285 }
13286
13287 super.OnPlacementComplete(player, position, orientation);
13288 }
13289
13290
13291
13292
13293
13295 {
13297 {
13298 return true;
13299 }
13300 else
13301 {
13302 return false;
13303 }
13304 }
13305
13306
13308 {
13310 {
13312 }
13313 }
13314
13315
13317 {
13319 }
13320
13322 {
13324 }
13325
13326 override void InsertAgent(
int agent,
float count = 1)
13327 {
13328 if (count < 1)
13329 return;
13330
13332 }
13333
13336 {
13338 }
13339
13340
13342 {
13344 }
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13388 {
13390 return false;
13391 return true;
13392 }
13393
13395 {
13396
13398 }
13399
13400
13403 {
13404 super.CheckForRoofLimited(timeTresholdMS);
13405
13407 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13408 {
13409 m_PreviousRoofTestTime = time;
13410 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13411 }
13412 }
13413
13414
13416 {
13418 {
13419 return 0;
13420 }
13421
13422 if (GetInventory().GetAttachmentSlotsCount() != 0)
13423 {
13424 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13425 if (filter)
13426 return filter.GetProtectionLevel(type, false, system);
13427 else
13428 return 0;
13429 }
13430
13431 string subclassPath, entryName;
13432
13433 switch (type)
13434 {
13436 entryName = "biological";
13437 break;
13439 entryName = "chemical";
13440 break;
13441 default:
13442 entryName = "biological";
13443 break;
13444 }
13445
13446 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13447
13449 }
13450
13451
13452
13455 {
13456 if (!IsMagazine())
13458
13460 }
13461
13462
13463
13464
13465
13470 {
13471 return true;
13472 }
13473
13475 {
13477 }
13478
13479
13480
13481
13482
13484 {
13485 if (parent)
13486 {
13487 if (parent.IsInherited(DayZInfected))
13488 return true;
13489
13490 if (!parent.IsRuined())
13491 return true;
13492 }
13493
13494 return true;
13495 }
13496
13498 {
13499 if (!super.CanPutAsAttachment(parent))
13500 {
13501 return false;
13502 }
13503
13504 if (!IsRuined() && !parent.IsRuined())
13505 {
13506 return true;
13507 }
13508
13509 return false;
13510 }
13511
13513 {
13514
13515
13516
13517
13518 return super.CanReceiveItemIntoCargo(item);
13519 }
13520
13522 {
13523
13524
13525
13526
13527 GameInventory attachmentInv = attachment.GetInventory();
13529 {
13530 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13531 return false;
13532 }
13533
13534 InventoryLocation loc = new InventoryLocation();
13535 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13536 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13537 return false;
13538
13539 return super.CanReceiveAttachment(attachment, slotId);
13540 }
13541
13543 {
13544 if (!super.CanReleaseAttachment(attachment))
13545 return false;
13546
13547 return GetInventory().AreChildrenAccessible();
13548 }
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13571 {
13572 int id = muzzle_owner.GetMuzzleID();
13573 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13574
13575 if (WPOF_array)
13576 {
13577 for (int i = 0; i < WPOF_array.Count(); i++)
13578 {
13579 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13580
13581 if (WPOF)
13582 {
13583 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13584 }
13585 }
13586 }
13587 }
13588
13589
13591 {
13592 int id = muzzle_owner.GetMuzzleID();
13594
13595 if (WPOBE_array)
13596 {
13597 for (int i = 0; i < WPOBE_array.Count(); i++)
13598 {
13599 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13600
13601 if (WPOBE)
13602 {
13603 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13604 }
13605 }
13606 }
13607 }
13608
13609
13611 {
13612 int id = muzzle_owner.GetMuzzleID();
13613 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13614
13615 if (WPOOH_array)
13616 {
13617 for (int i = 0; i < WPOOH_array.Count(); i++)
13618 {
13619 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13620
13621 if (WPOOH)
13622 {
13623 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13624 }
13625 }
13626 }
13627 }
13628
13629
13631 {
13632 int id = muzzle_owner.GetMuzzleID();
13633 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13634
13635 if (WPOOH_array)
13636 {
13637 for (int i = 0; i < WPOOH_array.Count(); i++)
13638 {
13639 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13640
13641 if (WPOOH)
13642 {
13643 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13644 }
13645 }
13646 }
13647 }
13648
13649
13651 {
13652 int id = muzzle_owner.GetMuzzleID();
13653 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13654
13655 if (WPOOH_array)
13656 {
13657 for (int i = 0; i < WPOOH_array.Count(); i++)
13658 {
13659 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13660
13661 if (WPOOH)
13662 {
13663 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13664 }
13665 }
13666 }
13667 }
13668
13669
13670
13672 {
13674 {
13675 return true;
13676 }
13677
13678 return false;
13679 }
13680
13682 {
13684 {
13685 return true;
13686 }
13687
13688 return false;
13689 }
13690
13692 {
13694 {
13695 return true;
13696 }
13697
13698 return false;
13699 }
13700
13702 {
13703 return false;
13704 }
13705
13708 {
13709 return UATimeSpent.DEFAULT_DEPLOY;
13710 }
13711
13712
13713
13714
13716 {
13718 SetSynchDirty();
13719 }
13720
13722 {
13724 }
13725
13726
13728 {
13729 return false;
13730 }
13731
13734 {
13735 string att_type = "None";
13736
13737 if (ConfigIsExisting("soundAttType"))
13738 {
13739 att_type = ConfigGetString("soundAttType");
13740 }
13741
13743 }
13744
13746 {
13748 }
13749
13750
13751
13752
13753
13759
13761 {
13764
13766 }
13767
13768
13770 {
13772 return;
13773
13775
13778
13781
13782 SoundParameters params = new SoundParameters();
13786 }
13787
13788
13790 {
13792 return;
13793
13795 SetSynchDirty();
13796
13799 }
13800
13801
13803 {
13805 return;
13806
13808 SetSynchDirty();
13809
13812 }
13813
13815 {
13817 }
13818
13820 {
13822 }
13823
13826 {
13827 if (!
GetGame().IsDedicatedServer())
13828 {
13829 if (ConfigIsExisting("attachSoundSet"))
13830 {
13831 string cfg_path = "";
13832 string soundset = "";
13833 string type_name =
GetType();
13834
13837 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13838 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13839
13840 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13841 {
13842 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13843 {
13844 if (cfg_slot_array[i] == slot_type)
13845 {
13846 soundset = cfg_soundset_array[i];
13847 break;
13848 }
13849 }
13850 }
13851
13852 if (soundset != "")
13853 {
13854 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13856 }
13857 }
13858 }
13859 }
13860
13862 {
13863
13864 }
13865
13866 void OnApply(PlayerBase player);
13867
13869 {
13870 return 1.0;
13871 };
13872
13874 {
13876 }
13877
13879 {
13881 }
13882
13884
13886 {
13887 SetDynamicPhysicsLifeTime(0.01);
13889 }
13890
13892 {
13893 array<string> zone_names = new array<string>;
13894 GetDamageZones(zone_names);
13895 for (int i = 0; i < zone_names.Count(); i++)
13896 {
13897 SetHealthMax(zone_names.Get(i),"Health");
13898 }
13899 SetHealthMax("","Health");
13900 }
13901
13904 {
13905 float global_health = GetHealth01("","Health");
13906 array<string> zones = new array<string>;
13907 GetDamageZones(zones);
13908
13909 for (int i = 0; i < zones.Count(); i++)
13910 {
13911 SetHealth01(zones.Get(i),"Health",global_health);
13912 }
13913 }
13914
13917 {
13918 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13919 }
13920
13922 {
13923 if (!hasRootAsPlayer)
13924 {
13925 if (refParentIB)
13926 {
13927
13928 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13929 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13930
13931 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13932 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13933
13936 }
13937 else
13938 {
13939
13942 }
13943 }
13944 }
13945
13947 {
13949 {
13950 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13951 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13952 {
13953 float heatPermCoef = 1.0;
13955 while (ent)
13956 {
13957 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13958 ent = ent.GetHierarchyParent();
13959 }
13960
13961 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13962 }
13963 }
13964 }
13965
13967 {
13968
13969 EntityAI parent = GetHierarchyParent();
13970 if (!parent)
13971 {
13972 hasParent = false;
13973 hasRootAsPlayer = false;
13974 }
13975 else
13976 {
13977 hasParent = true;
13978 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13979 refParentIB =
ItemBase.Cast(parent);
13980 }
13981 }
13982
13983 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13984 {
13985
13986 }
13987
13989 {
13990
13991 return false;
13992 }
13993
13995 {
13996
13997
13998 return false;
13999 }
14000
14002 {
14003
14004 return false;
14005 }
14006
14009 {
14010 return !GetIsFrozen() &&
IsOpen();
14011 }
14012
14014 {
14015 bool hasParent = false, hasRootAsPlayer = false;
14017
14018 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14019 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14020
14021 if (wwtu || foodDecay)
14022 {
14026
14027 if (processWetness || processTemperature || processDecay)
14028 {
14030
14031 if (processWetness)
14032 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14033
14034 if (processTemperature)
14036
14037 if (processDecay)
14038 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14039 }
14040 }
14041 }
14042
14045 {
14047 }
14048
14050 {
14053
14054 return super.GetTemperatureFreezeThreshold();
14055 }
14056
14058 {
14061
14062 return super.GetTemperatureThawThreshold();
14063 }
14064
14066 {
14069
14070 return super.GetItemOverheatThreshold();
14071 }
14072
14074 {
14076 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14077
14078 return super.GetTemperatureFreezeTime();
14079 }
14080
14082 {
14084 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14085
14086 return super.GetTemperatureThawTime();
14087 }
14088
14093
14095 {
14096 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14097 }
14098
14100 {
14101 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14102 }
14103
14106 {
14108 }
14109
14111 {
14113 }
14114
14116 {
14118 }
14119
14122 {
14123 return null;
14124 }
14125
14128 {
14129 return false;
14130 }
14131
14133 {
14135 {
14138 if (!trg)
14139 {
14141 explosive = this;
14142 }
14143
14144 explosive.PairRemote(trg);
14146
14147 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14148 trg.SetPersistentPairID(persistentID);
14149 explosive.SetPersistentPairID(persistentID);
14150
14151 return true;
14152 }
14153 return false;
14154 }
14155
14158 {
14159 float ret = 1.0;
14162 ret *= GetHealth01();
14163
14164 return ret;
14165 }
14166
14167 #ifdef DEVELOPER
14168 override void SetDebugItem()
14169 {
14170 super.SetDebugItem();
14171 _itemBase = this;
14172 }
14173
14175 {
14176 string text = super.GetDebugText();
14177
14179 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14180
14181 return text;
14182 }
14183 #endif
14184
14186 {
14187 return true;
14188 }
14189
14191
14193
14195 {
14198 }
14199
14200
14208
14224}
14225
14227{
14229 if (entity)
14230 {
14231 bool is_item = entity.IsInherited(
ItemBase);
14232 if (is_item && full_quantity)
14233 {
14236 }
14237 }
14238 else
14239 {
14241 return NULL;
14242 }
14243 return entity;
14244}
14245
14247{
14248 if (item)
14249 {
14250 if (health > 0)
14251 item.SetHealth("", "", health);
14252
14253 if (item.CanHaveTemperature())
14254 {
14256 if (item.CanFreeze())
14257 item.SetFrozen(false);
14258 }
14259
14260 if (item.HasEnergyManager())
14261 {
14262 if (quantity >= 0)
14263 {
14264 item.GetCompEM().SetEnergy0To1(quantity);
14265 }
14266 else
14267 {
14269 }
14270 }
14271 else if (item.IsMagazine())
14272 {
14273 Magazine mag = Magazine.Cast(item);
14274 if (quantity >= 0)
14275 {
14276 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14277 }
14278 else
14279 {
14281 }
14282
14283 }
14284 else
14285 {
14286 if (quantity >= 0)
14287 {
14288 item.SetQuantityNormalized(quantity, false);
14289 }
14290 else
14291 {
14293 }
14294
14295 }
14296 }
14297}
14298
14299#ifdef DEVELOPER
14301#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.