DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
9389{
9391 {
9392 return true;
9393 }
9394};
9395
9396
9397
9399{
9403
9405
9408
9409
9410
9411
9412
9421
9427
9432
9437
9458 protected bool m_IsResultOfSplit
9459
9461
9466
9467
9468
9470
9474
9475
9476
9478
9481
9482
9483
9489
9490
9498
9501
9502
9504
9505
9507
9508
9513
9514
9519
9520
9522
9523
9525 {
9530
9531 if (!
GetGame().IsDedicatedServer())
9532 {
9534 {
9536
9538 {
9540 }
9541 }
9542
9545 }
9546
9547 m_OldLocation = null;
9548
9550 {
9552 }
9553
9554 if (ConfigIsExisting("headSelectionsToHide"))
9555 {
9558 }
9559
9561 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9562 {
9564 }
9565
9567
9568 m_IsResultOfSplit = false;
9569
9571 }
9572
9574 {
9575 super.InitItemVariables();
9576
9582 m_Count = ConfigGetInt(
"count");
9583
9586
9591
9594
9599
9611
9615
9616
9619 if (ConfigIsExisting("canBeSplit"))
9620 {
9623 }
9624
9626 if (ConfigIsExisting("itemBehaviour"))
9628
9629
9632 RegisterNetSyncVariableInt("m_VarLiquidType");
9633 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9634
9635 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9636 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9637 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9638
9639 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9640 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9641 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9642 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9643
9644 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9645 RegisterNetSyncVariableBool("m_IsTakeable");
9646 RegisterNetSyncVariableBool("m_IsHologram");
9647
9650 {
9653 }
9654
9656
9658 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9660
9661 }
9662
9664 {
9666 }
9667
9669 {
9672 {
9677 }
9678 }
9679
9680 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9681 {
9683 {
9686 }
9687
9689 }
9690
9692 {
9698 }
9699
9701
9703 {
9705
9706 if (!action)
9707 {
9708 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9709 return;
9710 }
9711
9713 if (!ai)
9714 {
9716 return;
9717 }
9718
9720 if (!action_array)
9721 {
9722 action_array = new array<ActionBase_Basic>;
9724 }
9725 if (LogManager.IsActionLogEnable())
9726 {
9727 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9728 }
9729
9730 if (action_array.Find(action) != -1)
9731 {
9732 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9733 }
9734 else
9735 {
9736 action_array.Insert(action);
9737 }
9738 }
9739
9741 {
9743 ActionBase action = player.GetActionManager().GetAction(actionName);
9746
9747 if (action_array)
9748 {
9749 action_array.RemoveItem(action);
9750 }
9751 }
9752
9753
9754
9756 {
9757 ActionOverrideData overrideData = new ActionOverrideData();
9761
9763 if (!actionMap)
9764 {
9767 }
9768
9769 actionMap.Insert(this.
Type(), overrideData);
9770
9771 }
9772
9774
9776
9777
9779 {
9782
9785
9786 string config_to_search = "CfgVehicles";
9787 string muzzle_owner_config;
9788
9790 {
9791 if (IsInherited(Weapon))
9792 config_to_search = "CfgWeapons";
9793
9794 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9795
9796 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9797
9799
9800 if (config_OnFire_subclass_count > 0)
9801 {
9802 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9803
9804 for (int i = 0; i < config_OnFire_subclass_count; i++)
9805 {
9806 string particle_class = "";
9808 string config_OnFire_entry = config_OnFire_class + particle_class;
9809 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9810 WPOF_array.Insert(WPOF);
9811 }
9812
9813
9815 }
9816 }
9817
9819 {
9820 config_to_search = "CfgWeapons";
9821 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9822
9823 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9824
9826
9827 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9828 {
9829 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9830
9831 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9832 {
9833 string particle_class2 = "";
9835 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9836 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9837 WPOBE_array.Insert(WPOBE);
9838 }
9839
9840
9842 }
9843 }
9844 }
9845
9846
9848 {
9851
9853 {
9854 string config_to_search = "CfgVehicles";
9855
9856 if (IsInherited(Weapon))
9857 config_to_search = "CfgWeapons";
9858
9859 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9860 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9861
9862 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9863 {
9864
9866
9868 {
9870 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9872 return;
9873 }
9874
9877
9878
9879
9881 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9882
9883 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9884 {
9885 string particle_class = "";
9887 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9889
9890 if (entry_type == CT_CLASS)
9891 {
9892 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9893 WPOOH_array.Insert(WPOF);
9894 }
9895 }
9896
9897
9899 }
9900 }
9901 }
9902
9904 {
9906 }
9907
9909 {
9911 {
9913
9916
9919
9920 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9921 }
9922 }
9923
9925 {
9927 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9928
9930 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9931
9933 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9934
9936 {
9938 }
9939 }
9940
9942 {
9944 }
9945
9947 {
9950 else
9952
9954 {
9957 }
9958 else
9959 {
9962
9965 }
9966
9968 }
9969
9971 {
9973 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9974 }
9975
9977 {
9979 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9981 }
9982
9984 {
9986 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9987 }
9988
9990 {
9993
9994 OverheatingParticle OP = new OverheatingParticle();
9999
10001 }
10002
10004 {
10007
10008 return -1;
10009 }
10010
10012 {
10014 {
10017
10018 for (int i = count; i > 0; --i)
10019 {
10020 int id = i - 1;
10023
10026
10027 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10028 {
10029 if (p)
10030 {
10033 }
10034 }
10035 }
10036 }
10037 }
10038
10040 {
10042 {
10044 {
10045 int id = i - 1;
10047
10048 if (OP)
10049 {
10051
10052 if (p)
10053 {
10055 }
10056
10057 delete OP;
10058 }
10059 }
10060
10063 }
10064 }
10065
10068 {
10069 return 0.0;
10070 }
10071
10072
10074 {
10075 return 250;
10076 }
10077
10079 {
10080 return 0;
10081 }
10082
10085 {
10087 return true;
10088
10089 return false;
10090 }
10091
10094 {
10097
10099 {
10101 }
10102 else
10103 {
10104
10106 }
10107
10109 }
10110
10117 {
10118 return -1;
10119 }
10120
10121
10122
10123
10125 {
10127 {
10129 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10130
10131 if (r_index >= 0)
10132 {
10133 InventoryLocation r_il = new InventoryLocation;
10134 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10135
10136 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10139 {
10140 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10141 }
10143 {
10144 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10145 }
10146
10147 }
10148
10149 player.GetHumanInventory().ClearUserReservedLocation(this);
10150 }
10151
10154 }
10155
10156
10157
10158
10160 {
10161 return ItemBase.m_DebugActionsMask;
10162 }
10163
10165 {
10166 return ItemBase.m_DebugActionsMask & mask;
10167 }
10168
10170 {
10171 ItemBase.m_DebugActionsMask = mask;
10172 }
10173
10175 {
10176 ItemBase.m_DebugActionsMask |= mask;
10177 }
10178
10180 {
10181 ItemBase.m_DebugActionsMask &= ~mask;
10182 }
10183
10185 {
10187 {
10189 }
10190 else
10191 {
10193 }
10194 }
10195
10196
10198 {
10199 if (GetEconomyProfile())
10200 {
10201 float q_max = GetEconomyProfile().GetQuantityMax();
10202 if (q_max > 0)
10203 {
10204 float q_min = GetEconomyProfile().GetQuantityMin();
10205 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10206
10208 {
10209 ComponentEnergyManager comp = GetCompEM();
10211 {
10213 }
10214 }
10216 {
10218
10219 }
10220
10221 }
10222 }
10223 }
10224
10227 {
10228 EntityAI parent = GetHierarchyParent();
10229
10230 if (parent)
10231 {
10232 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10233 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10234 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10235 }
10236 }
10237
10240 {
10241 EntityAI parent = GetHierarchyParent();
10242
10243 if (parent)
10244 {
10245 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10246 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10247 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10248 }
10249 }
10250
10252 {
10253
10254
10255
10256
10258
10260 {
10261 if (ScriptInputUserData.CanStoreInputUserData())
10262 {
10263 ScriptInputUserData ctx = new ScriptInputUserData;
10269 ctx.
Write(use_stack_max);
10272
10274 {
10275 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10276 }
10277 }
10278 }
10279 else if (!
GetGame().IsMultiplayer())
10280 {
10282 }
10283 }
10284
10286 {
10288 }
10289
10291 {
10293 }
10294
10296 {
10298 }
10299
10301 {
10302
10303 return false;
10304 }
10305
10307 {
10308 return false;
10309 }
10310
10314 {
10315 return false;
10316 }
10317
10319 {
10320 return "";
10321 }
10322
10324
10326 {
10327 return false;
10328 }
10329
10331 {
10332 return true;
10333 }
10334
10335
10336
10338 {
10339 return true;
10340 }
10341
10343 {
10344 return true;
10345 }
10346
10348 {
10349 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10351 }
10352
10354 {
10356 }
10357
10359 {
10361 if (!is_being_placed)
10363 SetSynchDirty();
10364 }
10365
10366
10368
10370 {
10372 }
10373
10375 {
10377 }
10378
10380 {
10381 return 1;
10382 }
10383
10385 {
10386 return false;
10387 }
10388
10390 {
10392 SetSynchDirty();
10393 }
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10430 {
10431 super.OnMovedInsideCargo(container);
10432
10433 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10434 }
10435
10436 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10437 {
10438 super.EEItemLocationChanged(oldLoc,newLoc);
10439
10440 PlayerBase new_player = null;
10441 PlayerBase old_player = null;
10442
10443 if (newLoc.GetParent())
10444 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10445
10446 if (oldLoc.GetParent())
10447 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10448
10450 {
10451 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10452
10453 if (r_index >= 0)
10454 {
10455 InventoryLocation r_il = new InventoryLocation;
10456 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10457
10458 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10461 {
10462 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10463 }
10465 {
10466 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10467 }
10468
10469 }
10470 }
10471
10473 {
10474 if (new_player)
10475 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10476
10477 if (new_player == old_player)
10478 {
10479
10480 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10481 {
10483 {
10484 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10485 {
10486 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10487 }
10488 }
10489 else
10490 {
10491 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10492 }
10493 }
10494
10495 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10496 {
10497 int type = oldLoc.GetType();
10499 {
10500 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10501 }
10503 {
10504 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10505 }
10506 }
10507 if (!m_OldLocation)
10508 {
10509 m_OldLocation = new InventoryLocation;
10510 }
10511 m_OldLocation.Copy(oldLoc);
10512 }
10513 else
10514 {
10515 if (m_OldLocation)
10516 {
10517 m_OldLocation.Reset();
10518 }
10519 }
10520
10522 }
10523 else
10524 {
10525 if (new_player)
10526 {
10527 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10528 if (res_index >= 0)
10529 {
10530 InventoryLocation il = new InventoryLocation;
10531 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10533 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10536 {
10537 il.
GetParent().GetOnReleaseLock().Invoke(it);
10538 }
10540 {
10542 }
10543
10544 }
10545 }
10547 {
10548
10550 }
10551
10552 if (m_OldLocation)
10553 {
10554 m_OldLocation.Reset();
10555 }
10556 }
10557 }
10558
10559 override void EOnContact(IEntity other, Contact extra)
10560 {
10562 {
10563 int liquidType = -1;
10565 if (impactSpeed > 0.0)
10566 {
10568 #ifndef SERVER
10570 #else
10572 SetSynchDirty();
10573 #endif
10575 }
10576 }
10577
10578 #ifdef SERVER
10579 if (GetCompEM() && GetCompEM().IsPlugged())
10580 {
10581 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10582 GetCompEM().UnplugThis();
10583 }
10584 #endif
10585 }
10586
10588
10590 {
10592 }
10593
10595 {
10596
10597 }
10598
10600 {
10601 super.OnItemLocationChanged(old_owner, new_owner);
10602
10603 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10604 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10605
10606 if (!relatedPlayer && playerNew)
10607 relatedPlayer = playerNew;
10608
10609 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10610 {
10612 if (actionMgr)
10613 {
10614 ActionBase currentAction = actionMgr.GetRunningAction();
10615 if (currentAction)
10617 }
10618 }
10619
10620 Man ownerPlayerOld = null;
10621 Man ownerPlayerNew = null;
10622
10623 if (old_owner)
10624 {
10625 if (old_owner.
IsMan())
10626 {
10627 ownerPlayerOld = Man.Cast(old_owner);
10628 }
10629 else
10630 {
10631 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10632 }
10633 }
10634 else
10635 {
10637 {
10639
10640 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10641 {
10642 GetCompEM().UnplugThis();
10643 }
10644 }
10645 }
10646
10647 if (new_owner)
10648 {
10649 if (new_owner.
IsMan())
10650 {
10651 ownerPlayerNew = Man.Cast(new_owner);
10652 }
10653 else
10654 {
10655 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10656 }
10657 }
10658
10659 if (ownerPlayerOld != ownerPlayerNew)
10660 {
10661 if (ownerPlayerOld)
10662 {
10663 array<EntityAI> subItemsExit = new array<EntityAI>;
10665 for (int i = 0; i < subItemsExit.Count(); i++)
10666 {
10669 }
10670 }
10671
10672 if (ownerPlayerNew)
10673 {
10674 array<EntityAI> subItemsEnter = new array<EntityAI>;
10676 for (int j = 0; j < subItemsEnter.Count(); j++)
10677 {
10680 }
10681 }
10682 }
10683 else if (ownerPlayerNew != null)
10684 {
10685 PlayerBase nplayer;
10686 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10687 {
10688 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10690 for (int k = 0; k < subItemsUpdate.Count(); k++)
10691 {
10693 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10694 }
10695 }
10696 }
10697
10698 if (old_owner)
10699 old_owner.OnChildItemRemoved(this);
10700 if (new_owner)
10701 new_owner.OnChildItemReceived(this);
10702 }
10703
10704
10706 {
10707 super.EEDelete(parent);
10708 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10709 if (player)
10710 {
10712
10713 if (player.IsAlive())
10714 {
10715 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10716 if (r_index >= 0)
10717 {
10718 InventoryLocation r_il = new InventoryLocation;
10719 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10720
10721 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10724 {
10725 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10726 }
10728 {
10729 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10730 }
10731
10732 }
10733
10734 player.RemoveQuickBarEntityShortcut(this);
10735 }
10736 }
10737 }
10738
10740 {
10741 super.EEKilled(killer);
10742
10745 {
10746 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10747 {
10748 if (IsMagazine())
10749 {
10750 if (Magazine.Cast(this).GetAmmoCount() > 0)
10751 {
10753 }
10754 }
10755 else
10756 {
10758 }
10759 }
10760 }
10761 }
10762
10764 {
10765 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10766
10767 super.OnWasAttached(parent, slot_id);
10768
10771
10773 }
10774
10776 {
10777 super.OnWasDetached(parent, slot_id);
10778
10781 }
10782
10784 {
10785 int idx;
10788
10789 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10790 if (inventory_slots.Count() < 1)
10791 {
10792 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10793 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10794 }
10795 else
10796 {
10797 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10798 }
10799
10800 idx = inventory_slots.Find(slot);
10801 if (idx < 0)
10802 return "";
10803
10804 return attach_types.Get(idx);
10805 }
10806
10808 {
10809 int idx = -1;
10810 string slot;
10811
10814
10815 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10816 if (inventory_slots.Count() < 1)
10817 {
10818 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10819 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10820 }
10821 else
10822 {
10823 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10824 if (detach_types.Count() < 1)
10825 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10826 }
10827
10828 for (int i = 0; i < inventory_slots.Count(); i++)
10829 {
10830 slot = inventory_slots.Get(i);
10831 }
10832
10833 if (slot != "")
10834 {
10835 if (detach_types.Count() == 1)
10836 idx = 0;
10837 else
10838 idx = inventory_slots.Find(slot);
10839 }
10840 if (idx < 0)
10841 return "";
10842
10843 return detach_types.Get(idx);
10844 }
10845
10847 {
10848
10850
10851
10852 float min_time = 1;
10853 float max_time = 3;
10854 float delay = Math.RandomFloat(min_time, max_time);
10855
10856 explode_timer.Run(delay, this, "DoAmmoExplosion");
10857 }
10858
10860 {
10861 Magazine magazine = Magazine.Cast(this);
10862 int pop_sounds_count = 6;
10863 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10864
10865
10866 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10867 string sound_name = pop_sounds[ sound_idx ];
10869
10870
10871 magazine.ServerAddAmmoCount(-1);
10872
10873
10874 float min_temp_to_explode = 100;
10875
10876 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10877 {
10879 }
10880 }
10881
10882
10883 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10884 {
10885 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10886
10887 const int CHANCE_DAMAGE_CARGO = 4;
10888 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10889 const int CHANCE_DAMAGE_NOTHING = 2;
10890
10892 {
10893 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10894 int chances;
10895 int rnd;
10896
10897 if (GetInventory().GetCargo())
10898 {
10899 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10900 rnd = Math.RandomInt(0,chances);
10901
10902 if (rnd < CHANCE_DAMAGE_CARGO)
10903 {
10905 }
10906 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10907 {
10909 }
10910 }
10911 else
10912 {
10913 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10914 rnd = Math.RandomInt(0,chances);
10915
10916 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10917 {
10919 }
10920 }
10921 }
10922 }
10923
10925 {
10926 if (GetInventory().GetCargo())
10927 {
10928 int item_count = GetInventory().GetCargo().GetItemCount();
10929 if (item_count > 0)
10930 {
10931 int random_pick = Math.RandomInt(0, item_count);
10933 if (!item.IsExplosive())
10934 {
10935 item.AddHealth("","",damage);
10936 return true;
10937 }
10938 }
10939 }
10940 return false;
10941 }
10942
10944 {
10945 int attachment_count = GetInventory().AttachmentCount();
10946 if (attachment_count > 0)
10947 {
10948 int random_pick = Math.RandomInt(0, attachment_count);
10949 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10950 if (!attachment.IsExplosive())
10951 {
10952 attachment.AddHealth("","",damage);
10953 return true;
10954 }
10955 }
10956 return false;
10957 }
10958
10960 {
10962 }
10963
10965 {
10967 return GetInventory().CanRemoveEntity();
10968
10969 return false;
10970 }
10971
10973 {
10974
10976 return false;
10977
10978
10980 return false;
10981
10982
10983
10985 if (delta == 0)
10986 return false;
10987
10988
10989 return true;
10990 }
10991
10993 {
10995 {
10996 if (ScriptInputUserData.CanStoreInputUserData())
10997 {
10998 ScriptInputUserData ctx = new ScriptInputUserData;
11003 ctx.
Write(destination_entity);
11005 ctx.
Write(slot_id);
11007 }
11008 }
11009 else if (!
GetGame().IsMultiplayer())
11010 {
11012 }
11013 }
11014
11016 {
11017 float split_quantity_new;
11021 InventoryLocation loc = new InventoryLocation;
11022
11023 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11024 {
11026 split_quantity_new = stack_max;
11027 else
11029
11031 {
11032 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11033 if (new_item)
11034 {
11035 new_item.SetResultOfSplit(true);
11036 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11038 new_item.
SetQuantity(split_quantity_new,
false,
true);
11039 }
11040 }
11041 }
11042 else if (destination_entity && slot_id == -1)
11043 {
11044 if (quantity > stack_max)
11045 split_quantity_new = stack_max;
11046 else
11047 split_quantity_new = quantity;
11048
11050 {
11052 {
11055 }
11056
11057 if (new_item)
11058 {
11059 new_item.SetResultOfSplit(true);
11060 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11062 new_item.
SetQuantity(split_quantity_new,
false,
true);
11063 }
11064 }
11065 }
11066 else
11067 {
11068 if (stack_max != 0)
11069 {
11071 {
11073 }
11074
11075 if (split_quantity_new == 0)
11076 {
11077 if (!
GetGame().IsMultiplayer())
11078 player.PhysicalPredictiveDropItem(this);
11079 else
11080 player.ServerDropEntity(this);
11081 return;
11082 }
11083
11085 {
11087
11088 if (new_item)
11089 {
11090 new_item.SetResultOfSplit(true);
11091 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11094 new_item.PlaceOnSurface();
11095 }
11096 }
11097 }
11098 }
11099 }
11100
11102 {
11103 float split_quantity_new;
11107 InventoryLocation loc = new InventoryLocation;
11108
11109 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11110 {
11112 split_quantity_new = stack_max;
11113 else
11115
11117 {
11118 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11119 if (new_item)
11120 {
11121 new_item.SetResultOfSplit(true);
11122 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11124 new_item.
SetQuantity(split_quantity_new,
false,
true);
11125 }
11126 }
11127 }
11128 else if (destination_entity && slot_id == -1)
11129 {
11130 if (quantity > stack_max)
11131 split_quantity_new = stack_max;
11132 else
11133 split_quantity_new = quantity;
11134
11136 {
11138 {
11141 }
11142
11143 if (new_item)
11144 {
11145 new_item.SetResultOfSplit(true);
11146 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11148 new_item.
SetQuantity(split_quantity_new,
false,
true);
11149 }
11150 }
11151 }
11152 else
11153 {
11154 if (stack_max != 0)
11155 {
11157 {
11159 }
11160
11162 {
11164
11165 if (new_item)
11166 {
11167 new_item.SetResultOfSplit(true);
11168 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11171 new_item.PlaceOnSurface();
11172 }
11173 }
11174 }
11175 }
11176 }
11177
11179 {
11181 {
11182 if (ScriptInputUserData.CanStoreInputUserData())
11183 {
11184 ScriptInputUserData ctx = new ScriptInputUserData;
11189 dst.WriteToContext(ctx);
11191 }
11192 }
11193 else if (!
GetGame().IsMultiplayer())
11194 {
11196 }
11197 }
11198
11200 {
11202 {
11203 if (ScriptInputUserData.CanStoreInputUserData())
11204 {
11205 ScriptInputUserData ctx = new ScriptInputUserData;
11210 ctx.
Write(destination_entity);
11216 }
11217 }
11218 else if (!
GetGame().IsMultiplayer())
11219 {
11221 }
11222 }
11223
11225 {
11227 }
11228
11230 {
11232 float split_quantity_new;
11234 if (dst.IsValid())
11235 {
11236 int slot_id = dst.GetSlot();
11238
11239 if (quantity > stack_max)
11240 split_quantity_new = stack_max;
11241 else
11242 split_quantity_new = quantity;
11243
11245 {
11247
11248 if (new_item)
11249 {
11250 new_item.SetResultOfSplit(true);
11251 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11253 new_item.
SetQuantity(split_quantity_new,
false,
true);
11254 }
11255
11256 return new_item;
11257 }
11258 }
11259
11260 return null;
11261 }
11262
11264 {
11266 float split_quantity_new;
11268 if (destination_entity)
11269 {
11271 if (quantity > stackable)
11272 split_quantity_new = stackable;
11273 else
11274 split_quantity_new = quantity;
11275
11277 {
11278 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11279 if (new_item)
11280 {
11281 new_item.SetResultOfSplit(true);
11282 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11284 new_item.
SetQuantity(split_quantity_new,
false,
true);
11285 }
11286 }
11287 }
11288 }
11289
11291 {
11293 {
11294 if (ScriptInputUserData.CanStoreInputUserData())
11295 {
11296 ScriptInputUserData ctx = new ScriptInputUserData;
11301 ItemBase destination_entity =
this;
11302 ctx.
Write(destination_entity);
11306 }
11307 }
11308 else if (!
GetGame().IsMultiplayer())
11309 {
11311 }
11312 }
11313
11315 {
11317 float split_quantity_new;
11319 if (player)
11320 {
11322 if (quantity > stackable)
11323 split_quantity_new = stackable;
11324 else
11325 split_quantity_new = quantity;
11326
11328 {
11329 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11330 new_item =
ItemBase.Cast(in_hands);
11331 if (new_item)
11332 {
11333 new_item.SetResultOfSplit(true);
11334 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11336 new_item.SetQuantity(split_quantity_new, false, true);
11337 }
11338 }
11339 }
11340 }
11341
11343 {
11345 float split_quantity_new = Math.Floor(quantity * 0.5);
11346
11348 return;
11349
11351
11352 if (new_item)
11353 {
11354 if (new_item.GetQuantityMax() < split_quantity_new)
11355 {
11356 split_quantity_new = new_item.GetQuantityMax();
11357 }
11358
11359 new_item.SetResultOfSplit(true);
11360 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11361
11363 {
11366 }
11367 else
11368 {
11370 new_item.
SetQuantity(split_quantity_new,
false,
true);
11371 }
11372 }
11373 }
11374
11376 {
11378 float split_quantity_new = Math.Floor(quantity / 2);
11379
11381 return;
11382
11383 InventoryLocation invloc = new InventoryLocation;
11385
11387 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11388
11389 if (new_item)
11390 {
11391 if (new_item.GetQuantityMax() < split_quantity_new)
11392 {
11393 split_quantity_new = new_item.GetQuantityMax();
11394 }
11396 {
11399 }
11400 else if (split_quantity_new > 1)
11401 {
11403 new_item.
SetQuantity(split_quantity_new,
false,
true);
11404 }
11405 }
11406 }
11407
11410 {
11411 SetWeightDirty();
11413
11414 if (parent)
11415 parent.OnAttachmentQuantityChangedEx(this, delta);
11416
11418 {
11420 {
11422 }
11424 {
11425 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11427 }
11428 }
11429
11430 }
11431
11434 {
11435
11436 }
11437
11440 {
11442 }
11443
11445 {
11446 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11447
11449 {
11450 if (newLevel == GameConstants.STATE_RUINED)
11451 {
11453 EntityAI parent = GetHierarchyParent();
11454 if (parent && parent.IsFireplace())
11455 {
11456 CargoBase cargo = GetInventory().GetCargo();
11457 if (cargo)
11458 {
11460 {
11462 }
11463 }
11464 }
11465 }
11466
11468 {
11469
11471 return;
11472 }
11473
11474 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11475 {
11477 }
11478 }
11479 }
11480
11481
11483 {
11484 super.OnRightClick();
11485
11487 {
11489 {
11490 if (ScriptInputUserData.CanStoreInputUserData())
11491 {
11492 EntityAI root = GetHierarchyRoot();
11493 Man playerOwner = GetHierarchyRootPlayer();
11494 InventoryLocation dst = new InventoryLocation;
11495
11496
11497 if (!playerOwner && root && root == this)
11498 {
11500 }
11501 else
11502 {
11503
11504 GetInventory().GetCurrentInventoryLocation(dst);
11506 {
11509 {
11511 }
11512 else
11513 {
11515
11516
11517 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11518 {
11520 }
11521 else
11522 {
11523 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11524 }
11525 }
11526 }
11527 }
11528
11529 ScriptInputUserData ctx = new ScriptInputUserData;
11537 }
11538 }
11539 else if (!
GetGame().IsMultiplayer())
11540 {
11542 }
11543 }
11544 }
11545
11547 {
11548 if (root)
11549 {
11550 vector m4[4];
11551 root.GetTransform(m4);
11552 dst.SetGround(this, m4);
11553 }
11554 else
11555 {
11556 GetInventory().GetCurrentInventoryLocation(dst);
11557 }
11558 }
11559
11560 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11561 {
11562
11563 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11564 return false;
11565
11566 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11567 return false;
11568
11569
11571 return false;
11572
11573
11574 Magazine mag = Magazine.Cast(this);
11575 if (mag)
11576 {
11577 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11578 return false;
11579
11580 if (stack_max_limit)
11581 {
11582 Magazine other_mag = Magazine.Cast(other_item);
11583 if (other_item)
11584 {
11585 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11586 return false;
11587 }
11588
11589 }
11590 }
11591 else
11592 {
11593
11595 return false;
11596
11598 return false;
11599 }
11600
11601 PlayerBase player = null;
11602 if (CastTo(player, GetHierarchyRootPlayer()))
11603 {
11604 if (player.GetInventory().HasAttachment(this))
11605 return false;
11606
11607 if (player.IsItemsToDelete())
11608 return false;
11609 }
11610
11611 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11612 return false;
11613
11614 int slotID;
11616 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11617 return false;
11618
11619 return true;
11620 }
11621
11623 {
11625 }
11626
11628 {
11629 return m_IsResultOfSplit;
11630 }
11631
11633 {
11634 m_IsResultOfSplit = value;
11635 }
11636
11638 {
11640 }
11641
11643 {
11644 float other_item_quantity = other_item.GetQuantity();
11645 float this_free_space;
11646
11648
11650
11651 if (other_item_quantity > this_free_space)
11652 {
11653 return this_free_space;
11654 }
11655 else
11656 {
11657 return other_item_quantity;
11658 }
11659 }
11660
11662 {
11664 }
11665
11667 {
11669 return;
11670
11671 if (!IsMagazine() && other_item)
11672 {
11674 if (quantity_used != 0)
11675 {
11676 float hp1 = GetHealth01("","");
11677 float hp2 = other_item.GetHealth01("","");
11678 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11679 hpResult = hpResult / (
GetQuantity() + quantity_used);
11680
11681 hpResult *= GetMaxHealth();
11682 Math.Round(hpResult);
11683 SetHealth("", "Health", hpResult);
11684
11686 other_item.AddQuantity(-quantity_used);
11687 }
11688 }
11690 }
11691
11693 {
11694 #ifdef SERVER
11695 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11696 GetHierarchyParent().IncreaseLifetimeUp();
11697 #endif
11698 };
11699
11701 {
11702 PlayerBase p = PlayerBase.Cast(player);
11703
11704 array<int> recipesIds = p.m_Recipes;
11705 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11706 if (moduleRecipesManager)
11707 {
11708 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11709 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11710 }
11711
11712 for (int i = 0;i < recipesIds.Count(); i++)
11713 {
11714 int key = recipesIds.Get(i);
11715 string recipeName = moduleRecipesManager.GetRecipeName(key);
11717 }
11718 }
11719
11720
11721 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11722 {
11723 super.GetDebugActions(outputList);
11724
11725
11731
11732
11737
11742
11743
11747
11748
11750 {
11754 }
11755
11758
11759
11763
11765
11766 InventoryLocation loc = new InventoryLocation();
11767 GetInventory().GetCurrentInventoryLocation(loc);
11769 {
11770 if (Gizmo_IsSupported())
11773 }
11774
11776 }
11777
11778
11779
11780
11782 {
11783 super.OnAction(action_id, player, ctx);
11784
11786 {
11787 switch (action_id)
11788 {
11791 return true;
11794 return true;
11795 }
11796 }
11797
11799 {
11800 switch (action_id)
11801 {
11803 Delete();
11804 return true;
11805 }
11806 }
11807
11808 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11809 {
11810 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11811 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11812 PlayerBase p = PlayerBase.Cast(player);
11813 if (
EActions.RECIPES_RANGE_START < 1000)
11814 {
11815 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11816 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11817 }
11818 }
11819 #ifndef SERVER
11820 else if (action_id ==
EActions.WATCH_PLAYER)
11821 {
11822 PluginDeveloper.SetDeveloperItemClientEx(player);
11823 }
11824 #endif
11826 {
11827 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11828 {
11829 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11830 OnDebugButtonPressServer(id + 1);
11831 }
11832
11833 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11834 {
11835 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11837 }
11838
11839 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11840 {
11841 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11843 }
11844
11845 else if (action_id ==
EActions.ADD_QUANTITY)
11846 {
11847 if (IsMagazine())
11848 {
11849 Magazine mag = Magazine.Cast(this);
11850 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11851 }
11852 else
11853 {
11855 }
11856
11857 if (m_EM)
11858 {
11859 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11860 }
11861
11862 }
11863
11864 else if (action_id ==
EActions.REMOVE_QUANTITY)
11865 {
11866 if (IsMagazine())
11867 {
11868 Magazine mag2 = Magazine.Cast(this);
11869 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11870 }
11871 else
11872 {
11874 }
11875 if (m_EM)
11876 {
11877 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11878 }
11879
11880 }
11881
11882 else if (action_id ==
EActions.SET_QUANTITY_0)
11883 {
11885
11886 if (m_EM)
11887 {
11888 m_EM.SetEnergy(0);
11889 }
11890 }
11891
11892 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11893 {
11895
11896 if (m_EM)
11897 {
11898 m_EM.SetEnergy(m_EM.GetEnergyMax());
11899 }
11900 }
11901
11902 else if (action_id ==
EActions.ADD_HEALTH)
11903 {
11904 AddHealth("","",GetMaxHealth("","Health")/5);
11905 }
11906 else if (action_id ==
EActions.REMOVE_HEALTH)
11907 {
11908 AddHealth("","",-GetMaxHealth("","Health")/5);
11909 }
11910 else if (action_id ==
EActions.DESTROY_HEALTH)
11911 {
11912 SetHealth01("","",0);
11913 }
11914 else if (action_id ==
EActions.WATCH_ITEM)
11915 {
11917 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11918 #ifdef DEVELOPER
11919 SetDebugDeveloper_item(this);
11920 #endif
11921 }
11922
11923 else if (action_id ==
EActions.ADD_TEMPERATURE)
11924 {
11925 AddTemperature(20);
11926
11927 }
11928
11929 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11930 {
11931 AddTemperature(-20);
11932
11933 }
11934
11935 else if (action_id ==
EActions.FLIP_FROZEN)
11936 {
11937 SetFrozen(!GetIsFrozen());
11938
11939 }
11940
11941 else if (action_id ==
EActions.ADD_WETNESS)
11942 {
11944
11945 }
11946
11947 else if (action_id ==
EActions.REMOVE_WETNESS)
11948 {
11950
11951 }
11952
11953 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11954 {
11957
11958
11959 }
11960
11961 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11962 {
11965 }
11966
11967 else if (action_id ==
EActions.MAKE_SPECIAL)
11968 {
11969 auto debugParams = DebugSpawnParams.WithPlayer(player);
11970 OnDebugSpawnEx(debugParams);
11971 }
11972
11973 }
11974
11975
11976 return false;
11977 }
11978
11979
11980
11981
11985
11988
11989
11990
11992 {
11993 return false;
11994 }
11995
11996
11998 {
11999 return true;
12000 }
12001
12002
12004 {
12005 return true;
12006 }
12007
12008
12009
12011 {
12012 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12014 }
12015
12018 {
12019 return null;
12020 }
12021
12023 {
12024 return false;
12025 }
12026
12028 {
12029 return false;
12030 }
12031
12035
12036
12038 {
12039 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12040 return module_repairing.CanRepair(this, item_repair_kit);
12041 }
12042
12043
12044 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12045 {
12046 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12047 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12048 }
12049
12050
12052 {
12053
12054
12055
12056
12057
12058
12059
12060
12061 return 1;
12062 }
12063
12064
12065
12067 {
12069 }
12070
12071
12072
12074 {
12076 }
12077
12078
12087 {
12088 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12089
12090 if (player)
12091 {
12092 player.MessageStatus(text);
12093 }
12094 }
12095
12096
12105 {
12106 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12107
12108 if (player)
12109 {
12110 player.MessageAction(text);
12111 }
12112 }
12113
12114
12123 {
12124 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12125
12126 if (player)
12127 {
12128 player.MessageFriendly(text);
12129 }
12130 }
12131
12132
12141 {
12142 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12143
12144 if (player)
12145 {
12146 player.MessageImportant(text);
12147 }
12148 }
12149
12151 {
12152 return true;
12153 }
12154
12155
12156 override bool KindOf(
string tag)
12157 {
12158 bool found = false;
12159 string item_name = this.
GetType();
12162
12163 int array_size = item_tag_array.Count();
12164 for (int i = 0; i < array_size; i++)
12165 {
12166 if (item_tag_array.Get(i) == tag)
12167 {
12168 found = true;
12169 break;
12170 }
12171 }
12172 return found;
12173 }
12174
12175
12177 {
12178
12179 super.OnRPC(sender, rpc_type,ctx);
12180
12181
12182 switch (rpc_type)
12183 {
12184 #ifndef SERVER
12185 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12186 Param2<bool, string> p = new Param2<bool, string>(false, "");
12187
12189 return;
12190
12191 bool play = p.param1;
12192 string soundSet = p.param2;
12193
12194 if (play)
12195 {
12197 {
12199 {
12201 }
12202 }
12203 else
12204 {
12206 }
12207 }
12208 else
12209 {
12211 }
12212
12213 break;
12214 #endif
12215
12216 }
12217
12219 {
12221 }
12222 }
12223
12224
12225
12226
12228 {
12229 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12230 return plugin.GetID(
name);
12231 }
12232
12234 {
12235 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12236 return plugin.GetName(id);
12237 }
12238
12241 {
12242
12243
12244 int varFlags;
12245 if (!ctx.
Read(varFlags))
12246 return;
12247
12248 if (varFlags & ItemVariableFlags.FLOAT)
12249 {
12251 }
12252 }
12253
12255 {
12256
12257 super.SerializeNumericalVars(floats_out);
12258
12259
12260
12262 {
12264 }
12265
12267 {
12269 }
12270
12272 {
12274 }
12275
12277 {
12282 }
12283
12285 {
12287 }
12288 }
12289
12291 {
12292
12293 super.DeSerializeNumericalVars(floats);
12294
12295
12296 int index = 0;
12297 int mask = Math.Round(floats.Get(index));
12298
12299 index++;
12300
12302 {
12304 {
12306 }
12307 else
12308 {
12309 float quantity = floats.Get(index);
12310 SetQuantity(quantity,
true,
false,
false,
false);
12311 }
12312 index++;
12313 }
12314
12316 {
12317 float wet = floats.Get(index);
12319 index++;
12320 }
12321
12323 {
12324 int liquidtype = Math.Round(floats.Get(index));
12326 index++;
12327 }
12328
12330 {
12332 index++;
12334 index++;
12336 index++;
12338 index++;
12339 }
12340
12342 {
12343 int cleanness = Math.Round(floats.Get(index));
12345 index++;
12346 }
12347 }
12348
12350 {
12351 super.WriteVarsToCTX(ctx);
12352
12353
12355 {
12357 }
12358
12360 {
12362 }
12363
12365 {
12367 }
12368
12370 {
12371 int r,g,b,a;
12377 }
12378
12380 {
12382 }
12383 }
12384
12386 {
12387 if (!super.ReadVarsFromCTX(ctx,version))
12388 return false;
12389
12390 int intValue;
12391 float value;
12392
12393 if (version < 140)
12394 {
12395 if (!ctx.
Read(intValue))
12396 return false;
12397
12398 m_VariablesMask = intValue;
12399 }
12400
12402 {
12403 if (!ctx.
Read(value))
12404 return false;
12405
12407 {
12409 }
12410 else
12411 {
12413 }
12414 }
12415
12416 if (version < 140)
12417 {
12419 {
12420 if (!ctx.
Read(value))
12421 return false;
12422 SetTemperatureDirect(value);
12423 }
12424 }
12425
12427 {
12428 if (!ctx.
Read(value))
12429 return false;
12431 }
12432
12434 {
12435 if (!ctx.
Read(intValue))
12436 return false;
12438 }
12439
12441 {
12442 int r,g,b,a;
12444 return false;
12446 return false;
12448 return false;
12450 return false;
12451
12453 }
12454
12456 {
12457 if (!ctx.
Read(intValue))
12458 return false;
12460 }
12461
12462 if (version >= 138 && version < 140)
12463 {
12465 {
12466 if (!ctx.
Read(intValue))
12467 return false;
12468 SetFrozen(intValue);
12469 }
12470 }
12471
12472 return true;
12473 }
12474
12475
12477 {
12480 {
12482 }
12483
12484 if (!super.OnStoreLoad(ctx, version))
12485 {
12487 return false;
12488 }
12489
12490 if (version >= 114)
12491 {
12492 bool hasQuickBarIndexSaved;
12493
12494 if (!ctx.
Read(hasQuickBarIndexSaved))
12495 {
12497 return false;
12498 }
12499
12500 if (hasQuickBarIndexSaved)
12501 {
12502 int itmQBIndex;
12503
12504
12505 if (!ctx.
Read(itmQBIndex))
12506 {
12508 return false;
12509 }
12510
12511 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12512 if (itmQBIndex != -1 && parentPlayer)
12513 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12514 }
12515 }
12516 else
12517 {
12518
12519 PlayerBase player;
12520 int itemQBIndex;
12521 if (version ==
int.
MAX)
12522 {
12523 if (!ctx.
Read(itemQBIndex))
12524 {
12526 return false;
12527 }
12528 }
12529 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12530 {
12531
12532 if (!ctx.
Read(itemQBIndex))
12533 {
12535 return false;
12536 }
12537 if (itemQBIndex != -1 && player)
12538 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12539 }
12540 }
12541
12542 if (version < 140)
12543 {
12544
12545 if (!LoadVariables(ctx, version))
12546 {
12548 return false;
12549 }
12550 }
12551
12552
12554 {
12556 return false;
12557 }
12558 if (version >= 132)
12559 {
12561 if (raib)
12562 {
12564 {
12566 return false;
12567 }
12568 }
12569 }
12570
12572 return true;
12573 }
12574
12575
12576
12578 {
12579 super.OnStoreSave(ctx);
12580
12581 PlayerBase player;
12582 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12583 {
12585
12586 int itemQBIndex = -1;
12587 itemQBIndex = player.FindQuickBarEntityIndex(this);
12588 ctx.
Write(itemQBIndex);
12589 }
12590 else
12591 {
12593 }
12594
12596
12598 if (raib)
12599 {
12601 }
12602 }
12603
12604
12606 {
12607 super.AfterStoreLoad();
12608
12610 {
12612 }
12613
12615 {
12618 }
12619 }
12620
12622 {
12623 super.EEOnAfterLoad();
12624
12626 {
12628 }
12629
12632 }
12633
12635 {
12636 return false;
12637 }
12638
12639
12640
12642 {
12644 {
12645 #ifdef PLATFORM_CONSOLE
12646
12648 {
12650 if (menu)
12651 {
12653 }
12654 }
12655 #endif
12656 }
12657
12659 {
12662 }
12663
12665 {
12666 SetWeightDirty();
12668 }
12670 {
12673 }
12674
12676 {
12679 }
12681 {
12684 }
12685
12686 super.OnVariablesSynchronized();
12687 }
12688
12689
12690
12692 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12693 {
12694 if (!IsServerCheck(allow_client))
12695 return false;
12696
12698 return false;
12699
12702
12703 if (value <= (min + 0.001))
12704 value = min;
12705
12706 if (value == min)
12707 {
12708 if (destroy_config)
12709 {
12710 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12711 if (dstr)
12712 {
12714 this.Delete();
12715 return true;
12716 }
12717 }
12718 else if (destroy_forced)
12719 {
12721 this.Delete();
12722 return true;
12723 }
12724
12726 }
12727
12730
12732 {
12734
12735 if (delta)
12737 }
12738
12740
12741 return false;
12742 }
12743
12744
12746 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12747 {
12749 }
12750
12752 {
12755 }
12756
12758 {
12761 }
12762
12764 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12765 {
12766 float value_clamped = Math.Clamp(value, 0, 1);
12768 SetQuantity(result, destroy_config, destroy_forced);
12769 }
12770
12771
12774 {
12776 }
12777
12779 {
12781 }
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12793 {
12794 int slot = -1;
12795 if (GetInventory())
12796 {
12797 InventoryLocation il = new InventoryLocation;
12798 GetInventory().GetCurrentInventoryLocation(il);
12800 }
12801
12803 }
12804
12806 {
12807 float quantity_max = 0;
12808
12810 {
12811 if (attSlotID != -1)
12812 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12813
12814 if (quantity_max <= 0)
12816 }
12817
12818 if (quantity_max <= 0)
12820
12821 return quantity_max;
12822 }
12823
12825 {
12827 }
12828
12830 {
12832 }
12833
12834
12836 {
12838 }
12839
12841 {
12843 }
12844
12846 {
12848 }
12849
12850
12852 {
12853
12854 float weightEx = GetWeightEx();
12855 float special = GetInventoryAndCargoWeight();
12856 return weightEx - special;
12857 }
12858
12859
12861 {
12863 }
12864
12866 {
12868 {
12869 #ifdef DEVELOPER
12870 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12871 {
12872 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12874 }
12875 #endif
12876
12877 return GetQuantity() * GetConfigWeightModified();
12878 }
12879 else if (HasEnergyManager())
12880 {
12881 #ifdef DEVELOPER
12882 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12883 {
12884 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12885 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12886 }
12887 #endif
12888 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12889 }
12890 else
12891 {
12892 #ifdef DEVELOPER
12893 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12894 {
12895 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12896 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12897 }
12898 #endif
12899 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12900 }
12901 }
12902
12905 {
12906 int item_count = 0;
12908
12909 if (GetInventory().GetCargo() != NULL)
12910 {
12911 item_count = GetInventory().GetCargo().GetItemCount();
12912 }
12913
12914 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12915 {
12916 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12917 if (item)
12918 item_count += item.GetNumberOfItems();
12919 }
12920 return item_count;
12921 }
12922
12925 {
12926 float weight = 0;
12927 float wetness = 1;
12928 if (include_wetness)
12931 {
12932 weight = wetness * m_ConfigWeight;
12933 }
12935 {
12936 weight = 1;
12937 }
12938 return weight;
12939 }
12940
12941
12942
12944 {
12945 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12946 {
12947 GameInventory inv = GetInventory();
12948 array<EntityAI> items = new array<EntityAI>;
12950 for (int i = 0; i < items.Count(); i++)
12951 {
12953 if (item)
12954 {
12956 }
12957 }
12958 }
12959 }
12960
12961
12962
12963
12965 {
12966 float energy = 0;
12967 if (HasEnergyManager())
12968 {
12969 energy = GetCompEM().GetEnergy();
12970 }
12971 return energy;
12972 }
12973
12974
12976 {
12977 super.OnEnergyConsumed();
12978
12980 }
12981
12983 {
12984 super.OnEnergyAdded();
12985
12987 }
12988
12989
12991 {
12992 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12993 {
12995 {
12996 float energy_0to1 = GetCompEM().GetEnergy0To1();
12998 }
12999 }
13000 }
13001
13002
13004 {
13005 return ConfigGetFloat("heatIsolation");
13006 }
13007
13009 {
13011 }
13012
13014 {
13015 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13016 if (
GetGame().ConfigIsExisting(paramPath))
13018
13019 return 0.0;
13020 }
13021
13023 {
13024 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13025 if (
GetGame().ConfigIsExisting(paramPath))
13027
13028 return 0.0;
13029 }
13030
13031 override void SetWet(
float value,
bool allow_client =
false)
13032 {
13033 if (!IsServerCheck(allow_client))
13034 return;
13035
13038
13040
13041 m_VarWet = Math.Clamp(value, min, max);
13042
13044 {
13047 }
13048 }
13049
13050 override void AddWet(
float value)
13051 {
13053 }
13054
13056 {
13058 }
13059
13061 {
13063 }
13064
13066 {
13068 }
13069
13071 {
13073 }
13074
13076 {
13078 }
13079
13080 override void OnWetChanged(
float newVal,
float oldVal)
13081 {
13084 if (newLevel != oldLevel)
13085 {
13087 }
13088 }
13089
13091 {
13092 SetWeightDirty();
13093 }
13094
13096 {
13097 return GetWetLevelInternal(
m_VarWet);
13098 }
13099
13100
13101
13103 {
13105 }
13106
13108 {
13110 }
13111
13113 {
13115 }
13116
13118 {
13120 }
13121
13122
13123
13125 {
13126 if (ConfigIsExisting("itemModelLength"))
13127 {
13128 return ConfigGetFloat("itemModelLength");
13129 }
13130 return 0;
13131 }
13132
13134 {
13135 if (ConfigIsExisting("itemAttachOffset"))
13136 {
13137 return ConfigGetFloat("itemAttachOffset");
13138 }
13139 return 0;
13140 }
13141
13142 override void SetCleanness(
int value,
bool allow_client =
false)
13143 {
13144 if (!IsServerCheck(allow_client))
13145 return;
13146
13148
13150
13153 }
13154
13156 {
13158 }
13159
13161 {
13162 return true;
13163 }
13164
13165
13166
13167
13169 {
13171 }
13172
13174 {
13176 }
13177
13178
13179
13180
13181 override void SetColor(
int r,
int g,
int b,
int a)
13182 {
13188 }
13190 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13191 {
13196 }
13197
13199 {
13201 }
13202
13205 {
13206 int r,g,b,a;
13208 r = r/255;
13209 g = g/255;
13210 b = b/255;
13211 a = a/255;
13212 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13213 }
13214
13215
13216
13217 override void SetLiquidType(
int value,
bool allow_client =
false)
13218 {
13219 if (!IsServerCheck(allow_client))
13220 return;
13221
13226 }
13227
13229 {
13230 return ConfigGetInt("varLiquidTypeInit");
13231 }
13232
13234 {
13236 }
13237
13239 {
13241 SetFrozen(false);
13242 }
13243
13246 {
13247 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13248 }
13249
13250
13253 {
13254 PlayerBase nplayer;
13255 if (PlayerBase.CastTo(nplayer, player))
13256 {
13258
13259 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13260 }
13261 }
13262
13263
13266 {
13267 PlayerBase nplayer;
13268 if (PlayerBase.CastTo(nplayer,player))
13269 {
13270
13271 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13272
13273 }
13274
13275
13276 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13277
13278
13279 if (HasEnergyManager())
13280 {
13281 GetCompEM().UpdatePlugState();
13282 }
13283 }
13284
13285
13287 {
13288 super.OnPlacementStarted(player);
13289
13291 }
13292
13293 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13294 {
13296 {
13297 m_AdminLog.OnPlacementComplete(player,
this);
13298 }
13299
13300 super.OnPlacementComplete(player, position, orientation);
13301 }
13302
13303
13304
13305
13306
13308 {
13310 {
13311 return true;
13312 }
13313 else
13314 {
13315 return false;
13316 }
13317 }
13318
13319
13321 {
13323 {
13325 }
13326 }
13327
13328
13330 {
13332 }
13333
13335 {
13337 }
13338
13339 override void InsertAgent(
int agent,
float count = 1)
13340 {
13341 if (count < 1)
13342 return;
13343
13345 }
13346
13349 {
13351 }
13352
13353
13355 {
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
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13401 {
13403 return false;
13404 return true;
13405 }
13406
13408 {
13409
13411 }
13412
13413
13416 {
13417 super.CheckForRoofLimited(timeTresholdMS);
13418
13420 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13421 {
13422 m_PreviousRoofTestTime = time;
13423 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13424 }
13425 }
13426
13427
13429 {
13431 {
13432 return 0;
13433 }
13434
13435 if (GetInventory().GetAttachmentSlotsCount() != 0)
13436 {
13437 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13438 if (filter)
13439 return filter.GetProtectionLevel(type, false, system);
13440 else
13441 return 0;
13442 }
13443
13444 string subclassPath, entryName;
13445
13446 switch (type)
13447 {
13449 entryName = "biological";
13450 break;
13452 entryName = "chemical";
13453 break;
13454 default:
13455 entryName = "biological";
13456 break;
13457 }
13458
13459 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13460
13462 }
13463
13464
13465
13468 {
13469 if (!IsMagazine())
13471
13473 }
13474
13475
13476
13477
13478
13483 {
13484 return true;
13485 }
13486
13488 {
13490 }
13491
13492
13493
13494
13495
13497 {
13498 if (parent)
13499 {
13500 if (parent.IsInherited(DayZInfected))
13501 return true;
13502
13503 if (!parent.IsRuined())
13504 return true;
13505 }
13506
13507 return true;
13508 }
13509
13511 {
13512 if (!super.CanPutAsAttachment(parent))
13513 {
13514 return false;
13515 }
13516
13517 if (!IsRuined() && !parent.IsRuined())
13518 {
13519 return true;
13520 }
13521
13522 return false;
13523 }
13524
13526 {
13527
13528
13529
13530
13531 return super.CanReceiveItemIntoCargo(item);
13532 }
13533
13535 {
13536
13537
13538
13539
13540 GameInventory attachmentInv = attachment.GetInventory();
13542 {
13543 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13544 return false;
13545 }
13546
13547 InventoryLocation loc = new InventoryLocation();
13548 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13549 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13550 return false;
13551
13552 return super.CanReceiveAttachment(attachment, slotId);
13553 }
13554
13556 {
13557 if (!super.CanReleaseAttachment(attachment))
13558 return false;
13559
13560 return GetInventory().AreChildrenAccessible();
13561 }
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13584 {
13585 int id = muzzle_owner.GetMuzzleID();
13586 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13587
13588 if (WPOF_array)
13589 {
13590 for (int i = 0; i < WPOF_array.Count(); i++)
13591 {
13592 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13593
13594 if (WPOF)
13595 {
13596 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13597 }
13598 }
13599 }
13600 }
13601
13602
13604 {
13605 int id = muzzle_owner.GetMuzzleID();
13607
13608 if (WPOBE_array)
13609 {
13610 for (int i = 0; i < WPOBE_array.Count(); i++)
13611 {
13612 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13613
13614 if (WPOBE)
13615 {
13616 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13617 }
13618 }
13619 }
13620 }
13621
13622
13624 {
13625 int id = muzzle_owner.GetMuzzleID();
13626 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13627
13628 if (WPOOH_array)
13629 {
13630 for (int i = 0; i < WPOOH_array.Count(); i++)
13631 {
13632 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13633
13634 if (WPOOH)
13635 {
13636 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13637 }
13638 }
13639 }
13640 }
13641
13642
13644 {
13645 int id = muzzle_owner.GetMuzzleID();
13646 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13647
13648 if (WPOOH_array)
13649 {
13650 for (int i = 0; i < WPOOH_array.Count(); i++)
13651 {
13652 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13653
13654 if (WPOOH)
13655 {
13656 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13657 }
13658 }
13659 }
13660 }
13661
13662
13664 {
13665 int id = muzzle_owner.GetMuzzleID();
13666 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13667
13668 if (WPOOH_array)
13669 {
13670 for (int i = 0; i < WPOOH_array.Count(); i++)
13671 {
13672 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13673
13674 if (WPOOH)
13675 {
13676 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13677 }
13678 }
13679 }
13680 }
13681
13682
13683
13685 {
13687 {
13688 return true;
13689 }
13690
13691 return false;
13692 }
13693
13695 {
13697 {
13698 return true;
13699 }
13700
13701 return false;
13702 }
13703
13705 {
13707 {
13708 return true;
13709 }
13710
13711 return false;
13712 }
13713
13715 {
13716 return false;
13717 }
13718
13721 {
13722 return UATimeSpent.DEFAULT_DEPLOY;
13723 }
13724
13725
13726
13727
13729 {
13731 SetSynchDirty();
13732 }
13733
13735 {
13737 }
13738
13739
13741 {
13742 return false;
13743 }
13744
13747 {
13748 string att_type = "None";
13749
13750 if (ConfigIsExisting("soundAttType"))
13751 {
13752 att_type = ConfigGetString("soundAttType");
13753 }
13754
13756 }
13757
13759 {
13761 }
13762
13763
13764
13765
13766
13772
13774 {
13777
13779 }
13780
13781
13783 {
13785 return;
13786
13788
13791
13794
13795 SoundParameters params = new SoundParameters();
13799 }
13800
13801
13803 {
13805 return;
13806
13808 SetSynchDirty();
13809
13812 }
13813
13814
13816 {
13818 return;
13819
13821 SetSynchDirty();
13822
13825 }
13826
13828 {
13830 }
13831
13833 {
13835 }
13836
13839 {
13840 if (!
GetGame().IsDedicatedServer())
13841 {
13842 if (ConfigIsExisting("attachSoundSet"))
13843 {
13844 string cfg_path = "";
13845 string soundset = "";
13846 string type_name =
GetType();
13847
13850 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13851 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13852
13853 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13854 {
13855 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13856 {
13857 if (cfg_slot_array[i] == slot_type)
13858 {
13859 soundset = cfg_soundset_array[i];
13860 break;
13861 }
13862 }
13863 }
13864
13865 if (soundset != "")
13866 {
13867 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13869 }
13870 }
13871 }
13872 }
13873
13875 {
13876
13877 }
13878
13879 void OnApply(PlayerBase player);
13880
13882 {
13883 return 1.0;
13884 };
13885
13887 {
13889 }
13890
13892 {
13894 }
13895
13897
13899 {
13900 SetDynamicPhysicsLifeTime(0.01);
13902 }
13903
13905 {
13906 array<string> zone_names = new array<string>;
13907 GetDamageZones(zone_names);
13908 for (int i = 0; i < zone_names.Count(); i++)
13909 {
13910 SetHealthMax(zone_names.Get(i),"Health");
13911 }
13912 SetHealthMax("","Health");
13913 }
13914
13917 {
13918 float global_health = GetHealth01("","Health");
13919 array<string> zones = new array<string>;
13920 GetDamageZones(zones);
13921
13922 for (int i = 0; i < zones.Count(); i++)
13923 {
13924 SetHealth01(zones.Get(i),"Health",global_health);
13925 }
13926 }
13927
13930 {
13931 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13932 }
13933
13935 {
13936 if (!hasRootAsPlayer)
13937 {
13938 if (refParentIB)
13939 {
13940
13941 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13942 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13943
13944 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13945 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13946
13949 }
13950 else
13951 {
13952
13955 }
13956 }
13957 }
13958
13960 {
13962 {
13963 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13964 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13965 {
13966 float heatPermCoef = 1.0;
13968 while (ent)
13969 {
13970 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13971 ent = ent.GetHierarchyParent();
13972 }
13973
13974 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13975 }
13976 }
13977 }
13978
13980 {
13981
13982 EntityAI parent = GetHierarchyParent();
13983 if (!parent)
13984 {
13985 hasParent = false;
13986 hasRootAsPlayer = false;
13987 }
13988 else
13989 {
13990 hasParent = true;
13991 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13992 refParentIB =
ItemBase.Cast(parent);
13993 }
13994 }
13995
13996 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13997 {
13998
13999 }
14000
14002 {
14003
14004 return false;
14005 }
14006
14008 {
14009
14010
14011 return false;
14012 }
14013
14015 {
14016
14017 return false;
14018 }
14019
14022 {
14023 return !GetIsFrozen() &&
IsOpen();
14024 }
14025
14027 {
14028 bool hasParent = false, hasRootAsPlayer = false;
14030
14031 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14032 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14033
14034 if (wwtu || foodDecay)
14035 {
14039
14040 if (processWetness || processTemperature || processDecay)
14041 {
14043
14044 if (processWetness)
14045 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14046
14047 if (processTemperature)
14049
14050 if (processDecay)
14051 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14052 }
14053 }
14054 }
14055
14058 {
14060 }
14061
14063 {
14066
14067 return super.GetTemperatureFreezeThreshold();
14068 }
14069
14071 {
14074
14075 return super.GetTemperatureThawThreshold();
14076 }
14077
14079 {
14082
14083 return super.GetItemOverheatThreshold();
14084 }
14085
14087 {
14089 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14090
14091 return super.GetTemperatureFreezeTime();
14092 }
14093
14095 {
14097 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14098
14099 return super.GetTemperatureThawTime();
14100 }
14101
14106
14108 {
14109 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14110 }
14111
14113 {
14114 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14115 }
14116
14119 {
14121 }
14122
14124 {
14126 }
14127
14129 {
14131 }
14132
14135 {
14136 return null;
14137 }
14138
14141 {
14142 return false;
14143 }
14144
14146 {
14148 {
14151 if (!trg)
14152 {
14154 explosive = this;
14155 }
14156
14157 explosive.PairRemote(trg);
14159
14160 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14161 trg.SetPersistentPairID(persistentID);
14162 explosive.SetPersistentPairID(persistentID);
14163
14164 return true;
14165 }
14166 return false;
14167 }
14168
14171 {
14172 float ret = 1.0;
14175 ret *= GetHealth01();
14176
14177 return ret;
14178 }
14179
14180 #ifdef DEVELOPER
14181 override void SetDebugItem()
14182 {
14183 super.SetDebugItem();
14184 _itemBase = this;
14185 }
14186
14188 {
14189 string text = super.GetDebugText();
14190
14192 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14193
14194 return text;
14195 }
14196 #endif
14197
14199 {
14200 return true;
14201 }
14202
14204
14206
14208 {
14211 }
14212
14213
14221
14237}
14238
14240{
14242 if (entity)
14243 {
14244 bool is_item = entity.IsInherited(
ItemBase);
14245 if (is_item && full_quantity)
14246 {
14249 }
14250 }
14251 else
14252 {
14254 return NULL;
14255 }
14256 return entity;
14257}
14258
14260{
14261 if (item)
14262 {
14263 if (health > 0)
14264 item.SetHealth("", "", health);
14265
14266 if (item.CanHaveTemperature())
14267 {
14269 if (item.CanFreeze())
14270 item.SetFrozen(false);
14271 }
14272
14273 if (item.HasEnergyManager())
14274 {
14275 if (quantity >= 0)
14276 {
14277 item.GetCompEM().SetEnergy0To1(quantity);
14278 }
14279 else
14280 {
14282 }
14283 }
14284 else if (item.IsMagazine())
14285 {
14286 Magazine mag = Magazine.Cast(item);
14287 if (quantity >= 0)
14288 {
14289 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14290 }
14291 else
14292 {
14294 }
14295
14296 }
14297 else
14298 {
14299 if (quantity >= 0)
14300 {
14301 item.SetQuantityNormalized(quantity, false);
14302 }
14303 else
14304 {
14306 }
14307
14308 }
14309 }
14310}
14311
14312#ifdef DEVELOPER
14314#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.