9346{
9348 {
9349 return true;
9350 }
9351};
9352
9353
9354
9356{
9360
9362
9365
9366
9367
9368
9369
9378
9384
9389
9394
9415 protected bool m_IsResultOfSplit
9416
9418
9423
9424
9425
9427
9431
9432
9433
9435
9438
9439
9440
9446
9447
9455
9458
9459
9461
9462
9464
9465
9470
9471
9476
9477
9479
9480
9482 {
9487
9488 if (!
GetGame().IsDedicatedServer())
9489 {
9491 {
9493
9495 {
9497 }
9498 }
9499
9502 }
9503
9504 m_OldLocation = null;
9505
9507 {
9509 }
9510
9511 if (ConfigIsExisting("headSelectionsToHide"))
9512 {
9515 }
9516
9518 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9519 {
9521 }
9522
9524
9525 m_IsResultOfSplit = false;
9526
9528 }
9529
9531 {
9532 super.InitItemVariables();
9533
9539 m_Count = ConfigGetInt(
"count");
9540
9543
9548
9551
9556
9568
9572
9573
9576 if (ConfigIsExisting("canBeSplit"))
9577 {
9580 }
9581
9583 if (ConfigIsExisting("itemBehaviour"))
9585
9586
9589 RegisterNetSyncVariableInt("m_VarLiquidType");
9590 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9591
9592 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9593 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9594 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9595
9596 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9597 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9598 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9599 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9600
9601 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9602 RegisterNetSyncVariableBool("m_IsTakeable");
9603 RegisterNetSyncVariableBool("m_IsHologram");
9604
9607 {
9610 }
9611
9613
9615 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9617
9618 }
9619
9621 {
9623 }
9624
9626 {
9629 {
9634 }
9635 }
9636
9637 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9638 {
9640 {
9643 }
9644
9646 }
9647
9649 {
9655 }
9656
9658
9660 {
9662
9663 if (!action)
9664 {
9665 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9666 return;
9667 }
9668
9670 if (!ai)
9671 {
9673 return;
9674 }
9675
9677 if (!action_array)
9678 {
9679 action_array = new array<ActionBase_Basic>;
9681 }
9682 if (LogManager.IsActionLogEnable())
9683 {
9684 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9685 }
9686
9687 if (action_array.Find(action) != -1)
9688 {
9689 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9690 }
9691 else
9692 {
9693 action_array.Insert(action);
9694 }
9695 }
9696
9698 {
9700 ActionBase action = player.GetActionManager().GetAction(actionName);
9703
9704 if (action_array)
9705 {
9706 action_array.RemoveItem(action);
9707 }
9708 }
9709
9710
9711
9713 {
9714 ActionOverrideData overrideData = new ActionOverrideData();
9718
9720 if (!actionMap)
9721 {
9724 }
9725
9726 actionMap.Insert(this.
Type(), overrideData);
9727
9728 }
9729
9731
9733
9734
9736 {
9739
9742
9743 string config_to_search = "CfgVehicles";
9744 string muzzle_owner_config;
9745
9747 {
9748 if (IsInherited(Weapon))
9749 config_to_search = "CfgWeapons";
9750
9751 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9752
9753 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9754
9756
9757 if (config_OnFire_subclass_count > 0)
9758 {
9759 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9760
9761 for (int i = 0; i < config_OnFire_subclass_count; i++)
9762 {
9763 string particle_class = "";
9765 string config_OnFire_entry = config_OnFire_class + particle_class;
9766 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9767 WPOF_array.Insert(WPOF);
9768 }
9769
9770
9772 }
9773 }
9774
9776 {
9777 config_to_search = "CfgWeapons";
9778 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9779
9780 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9781
9783
9784 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9785 {
9786 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9787
9788 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9789 {
9790 string particle_class2 = "";
9792 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9793 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9794 WPOBE_array.Insert(WPOBE);
9795 }
9796
9797
9799 }
9800 }
9801 }
9802
9803
9805 {
9808
9810 {
9811 string config_to_search = "CfgVehicles";
9812
9813 if (IsInherited(Weapon))
9814 config_to_search = "CfgWeapons";
9815
9816 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9817 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9818
9819 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9820 {
9821
9823
9825 {
9827 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9829 return;
9830 }
9831
9834
9835
9836
9838 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9839
9840 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9841 {
9842 string particle_class = "";
9844 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9846
9847 if (entry_type == CT_CLASS)
9848 {
9849 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9850 WPOOH_array.Insert(WPOF);
9851 }
9852 }
9853
9854
9856 }
9857 }
9858 }
9859
9861 {
9863 }
9864
9866 {
9868 {
9870
9873
9876
9877 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9878 }
9879 }
9880
9882 {
9884 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9885
9887 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9888
9890 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9891
9893 {
9895 }
9896 }
9897
9899 {
9901 }
9902
9904 {
9907 else
9909
9911 {
9914 }
9915 else
9916 {
9919
9922 }
9923
9925 }
9926
9928 {
9930 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9931 }
9932
9934 {
9936 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9938 }
9939
9941 {
9943 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9944 }
9945
9947 {
9950
9951 OverheatingParticle OP = new OverheatingParticle();
9956
9958 }
9959
9961 {
9964
9965 return -1;
9966 }
9967
9969 {
9971 {
9974
9975 for (int i = count; i > 0; --i)
9976 {
9977 int id = i - 1;
9980
9983
9984 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9985 {
9986 if (p)
9987 {
9990 }
9991 }
9992 }
9993 }
9994 }
9995
9997 {
9999 {
10001 {
10002 int id = i - 1;
10004
10005 if (OP)
10006 {
10008
10009 if (p)
10010 {
10012 }
10013
10014 delete OP;
10015 }
10016 }
10017
10020 }
10021 }
10022
10025 {
10026 return 0.0;
10027 }
10028
10029
10031 {
10032 return 250;
10033 }
10034
10036 {
10037 return 0;
10038 }
10039
10042 {
10044 return true;
10045
10046 return false;
10047 }
10048
10051 {
10054
10056 {
10058 }
10059 else
10060 {
10061
10063 }
10064
10066 }
10067
10074 {
10075 return -1;
10076 }
10077
10078
10079
10080
10082 {
10084 {
10086 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10087
10088 if (r_index >= 0)
10089 {
10090 InventoryLocation r_il = new InventoryLocation;
10091 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10092
10093 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10096 {
10097 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10098 }
10100 {
10101 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10102 }
10103
10104 }
10105
10106 player.GetHumanInventory().ClearUserReservedLocation(this);
10107 }
10108
10111 }
10112
10113
10114
10115
10117 {
10118 return ItemBase.m_DebugActionsMask;
10119 }
10120
10122 {
10123 return ItemBase.m_DebugActionsMask & mask;
10124 }
10125
10127 {
10128 ItemBase.m_DebugActionsMask = mask;
10129 }
10130
10132 {
10133 ItemBase.m_DebugActionsMask |= mask;
10134 }
10135
10137 {
10138 ItemBase.m_DebugActionsMask &= ~mask;
10139 }
10140
10142 {
10144 {
10146 }
10147 else
10148 {
10150 }
10151 }
10152
10153
10155 {
10156 if (GetEconomyProfile())
10157 {
10158 float q_max = GetEconomyProfile().GetQuantityMax();
10159 if (q_max > 0)
10160 {
10161 float q_min = GetEconomyProfile().GetQuantityMin();
10162 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10163
10165 {
10166 ComponentEnergyManager comp = GetCompEM();
10168 {
10170 }
10171 }
10173 {
10175
10176 }
10177
10178 }
10179 }
10180 }
10181
10184 {
10185 EntityAI parent = GetHierarchyParent();
10186
10187 if (parent)
10188 {
10189 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10190 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10191 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10192 }
10193 }
10194
10197 {
10198 EntityAI parent = GetHierarchyParent();
10199
10200 if (parent)
10201 {
10202 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10203 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10204 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10205 }
10206 }
10207
10209 {
10210
10211
10212
10213
10215
10217 {
10218 if (ScriptInputUserData.CanStoreInputUserData())
10219 {
10220 ScriptInputUserData ctx = new ScriptInputUserData;
10226 ctx.
Write(use_stack_max);
10229
10231 {
10232 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10233 }
10234 }
10235 }
10236 else if (!
GetGame().IsMultiplayer())
10237 {
10239 }
10240 }
10241
10243 {
10245 }
10246
10248 {
10250 }
10251
10253 {
10255 }
10256
10258 {
10259
10260 return false;
10261 }
10262
10264 {
10265 return false;
10266 }
10267
10271 {
10272 return false;
10273 }
10274
10276 {
10277 return "";
10278 }
10279
10281
10283 {
10284 return false;
10285 }
10286
10288 {
10289 return true;
10290 }
10291
10292
10293
10295 {
10296 return true;
10297 }
10298
10300 {
10301 return true;
10302 }
10303
10305 {
10306 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10308 }
10309
10311 {
10313 }
10314
10316 {
10318 if (!is_being_placed)
10320 SetSynchDirty();
10321 }
10322
10323
10325
10327 {
10329 }
10330
10332 {
10334 }
10335
10337 {
10338 return 1;
10339 }
10340
10342 {
10343 return false;
10344 }
10345
10347 {
10349 SetSynchDirty();
10350 }
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10387 {
10388 super.OnMovedInsideCargo(container);
10389
10390 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10391 }
10392
10393 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10394 {
10395 super.EEItemLocationChanged(oldLoc,newLoc);
10396
10397 PlayerBase new_player = null;
10398 PlayerBase old_player = null;
10399
10400 if (newLoc.GetParent())
10401 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10402
10403 if (oldLoc.GetParent())
10404 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10405
10407 {
10408 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10409
10410 if (r_index >= 0)
10411 {
10412 InventoryLocation r_il = new InventoryLocation;
10413 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10414
10415 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10418 {
10419 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10420 }
10422 {
10423 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10424 }
10425
10426 }
10427 }
10428
10430 {
10431 if (new_player)
10432 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10433
10434 if (new_player == old_player)
10435 {
10436
10437 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10438 {
10440 {
10441 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10442 {
10443 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10444 }
10445 }
10446 else
10447 {
10448 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10449 }
10450 }
10451
10452 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10453 {
10454 int type = oldLoc.GetType();
10456 {
10457 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10458 }
10460 {
10461 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10462 }
10463 }
10464 if (!m_OldLocation)
10465 {
10466 m_OldLocation = new InventoryLocation;
10467 }
10468 m_OldLocation.Copy(oldLoc);
10469 }
10470 else
10471 {
10472 if (m_OldLocation)
10473 {
10474 m_OldLocation.Reset();
10475 }
10476 }
10477
10479 }
10480 else
10481 {
10482 if (new_player)
10483 {
10484 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10485 if (res_index >= 0)
10486 {
10487 InventoryLocation il = new InventoryLocation;
10488 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10490 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10493 {
10494 il.
GetParent().GetOnReleaseLock().Invoke(it);
10495 }
10497 {
10499 }
10500
10501 }
10502 }
10504 {
10505
10507 }
10508
10509 if (m_OldLocation)
10510 {
10511 m_OldLocation.Reset();
10512 }
10513 }
10514 }
10515
10516 override void EOnContact(IEntity other, Contact extra)
10517 {
10519 {
10520 int liquidType = -1;
10522 if (impactSpeed > 0.0)
10523 {
10525 #ifndef SERVER
10527 #else
10529 SetSynchDirty();
10530 #endif
10532 }
10533 }
10534
10535 #ifdef SERVER
10536 if (GetCompEM() && GetCompEM().IsPlugged())
10537 {
10538 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10539 GetCompEM().UnplugThis();
10540 }
10541 #endif
10542 }
10543
10545
10547 {
10549 }
10550
10552 {
10553
10554 }
10555
10557 {
10558 super.OnItemLocationChanged(old_owner, new_owner);
10559
10560 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10561 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10562
10563 if (!relatedPlayer && playerNew)
10564 relatedPlayer = playerNew;
10565
10566 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10567 {
10569 if (actionMgr)
10570 {
10571 ActionBase currentAction = actionMgr.GetRunningAction();
10572 if (currentAction)
10574 }
10575 }
10576
10577 Man ownerPlayerOld = null;
10578 Man ownerPlayerNew = null;
10579
10580 if (old_owner)
10581 {
10582 if (old_owner.
IsMan())
10583 {
10584 ownerPlayerOld = Man.Cast(old_owner);
10585 }
10586 else
10587 {
10588 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10589 }
10590 }
10591 else
10592 {
10594 {
10596
10597 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10598 {
10599 GetCompEM().UnplugThis();
10600 }
10601 }
10602 }
10603
10604 if (new_owner)
10605 {
10606 if (new_owner.
IsMan())
10607 {
10608 ownerPlayerNew = Man.Cast(new_owner);
10609 }
10610 else
10611 {
10612 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10613 }
10614 }
10615
10616 if (ownerPlayerOld != ownerPlayerNew)
10617 {
10618 if (ownerPlayerOld)
10619 {
10620 array<EntityAI> subItemsExit = new array<EntityAI>;
10622 for (int i = 0; i < subItemsExit.Count(); i++)
10623 {
10626 }
10627 }
10628
10629 if (ownerPlayerNew)
10630 {
10631 array<EntityAI> subItemsEnter = new array<EntityAI>;
10633 for (int j = 0; j < subItemsEnter.Count(); j++)
10634 {
10637 }
10638 }
10639 }
10640 else if (ownerPlayerNew != null)
10641 {
10642 PlayerBase nplayer;
10643 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10644 {
10645 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10647 for (int k = 0; k < subItemsUpdate.Count(); k++)
10648 {
10650 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10651 }
10652 }
10653 }
10654
10655 if (old_owner)
10656 old_owner.OnChildItemRemoved(this);
10657 if (new_owner)
10658 new_owner.OnChildItemReceived(this);
10659 }
10660
10661
10663 {
10664 super.EEDelete(parent);
10665 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10666 if (player)
10667 {
10669
10670 if (player.IsAlive())
10671 {
10672 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10673 if (r_index >= 0)
10674 {
10675 InventoryLocation r_il = new InventoryLocation;
10676 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10677
10678 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10681 {
10682 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10683 }
10685 {
10686 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10687 }
10688
10689 }
10690
10691 player.RemoveQuickBarEntityShortcut(this);
10692 }
10693 }
10694 }
10695
10697 {
10698 super.EEKilled(killer);
10699
10702 {
10703 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10704 {
10705 if (IsMagazine())
10706 {
10707 if (Magazine.Cast(this).GetAmmoCount() > 0)
10708 {
10710 }
10711 }
10712 else
10713 {
10715 }
10716 }
10717 }
10718 }
10719
10721 {
10722 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10723
10724 super.OnWasAttached(parent, slot_id);
10725
10728
10730 }
10731
10733 {
10734 super.OnWasDetached(parent, slot_id);
10735
10738 }
10739
10741 {
10742 int idx;
10745
10746 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10747 if (inventory_slots.Count() < 1)
10748 {
10749 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10750 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10751 }
10752 else
10753 {
10754 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10755 }
10756
10757 idx = inventory_slots.Find(slot);
10758 if (idx < 0)
10759 return "";
10760
10761 return attach_types.Get(idx);
10762 }
10763
10765 {
10766 int idx = -1;
10767 string slot;
10768
10771
10772 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10773 if (inventory_slots.Count() < 1)
10774 {
10775 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10776 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10777 }
10778 else
10779 {
10780 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10781 if (detach_types.Count() < 1)
10782 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10783 }
10784
10785 for (int i = 0; i < inventory_slots.Count(); i++)
10786 {
10787 slot = inventory_slots.Get(i);
10788 }
10789
10790 if (slot != "")
10791 {
10792 if (detach_types.Count() == 1)
10793 idx = 0;
10794 else
10795 idx = inventory_slots.Find(slot);
10796 }
10797 if (idx < 0)
10798 return "";
10799
10800 return detach_types.Get(idx);
10801 }
10802
10804 {
10805
10807
10808
10809 float min_time = 1;
10810 float max_time = 3;
10811 float delay = Math.RandomFloat(min_time, max_time);
10812
10813 explode_timer.Run(delay, this, "DoAmmoExplosion");
10814 }
10815
10817 {
10818 Magazine magazine = Magazine.Cast(this);
10819 int pop_sounds_count = 6;
10820 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10821
10822
10823 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10824 string sound_name = pop_sounds[ sound_idx ];
10826
10827
10828 magazine.ServerAddAmmoCount(-1);
10829
10830
10831 float min_temp_to_explode = 100;
10832
10833 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10834 {
10836 }
10837 }
10838
10839
10840 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10841 {
10842 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10843
10844 const int CHANCE_DAMAGE_CARGO = 4;
10845 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10846 const int CHANCE_DAMAGE_NOTHING = 2;
10847
10849 {
10850 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10851 int chances;
10852 int rnd;
10853
10854 if (GetInventory().GetCargo())
10855 {
10856 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10857 rnd = Math.RandomInt(0,chances);
10858
10859 if (rnd < CHANCE_DAMAGE_CARGO)
10860 {
10862 }
10863 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10864 {
10866 }
10867 }
10868 else
10869 {
10870 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10871 rnd = Math.RandomInt(0,chances);
10872
10873 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10874 {
10876 }
10877 }
10878 }
10879 }
10880
10882 {
10883 if (GetInventory().GetCargo())
10884 {
10885 int item_count = GetInventory().GetCargo().GetItemCount();
10886 if (item_count > 0)
10887 {
10888 int random_pick = Math.RandomInt(0, item_count);
10890 if (!item.IsExplosive())
10891 {
10892 item.AddHealth("","",damage);
10893 return true;
10894 }
10895 }
10896 }
10897 return false;
10898 }
10899
10901 {
10902 int attachment_count = GetInventory().AttachmentCount();
10903 if (attachment_count > 0)
10904 {
10905 int random_pick = Math.RandomInt(0, attachment_count);
10906 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10907 if (!attachment.IsExplosive())
10908 {
10909 attachment.AddHealth("","",damage);
10910 return true;
10911 }
10912 }
10913 return false;
10914 }
10915
10917 {
10919 }
10920
10922 {
10924 return GetInventory().CanRemoveEntity();
10925
10926 return false;
10927 }
10928
10930 {
10931
10933 return false;
10934
10935
10937 return false;
10938
10939
10940
10942 if (delta == 0)
10943 return false;
10944
10945
10946 return true;
10947 }
10948
10950 {
10952 {
10953 if (ScriptInputUserData.CanStoreInputUserData())
10954 {
10955 ScriptInputUserData ctx = new ScriptInputUserData;
10960 ctx.
Write(destination_entity);
10962 ctx.
Write(slot_id);
10964 }
10965 }
10966 else if (!
GetGame().IsMultiplayer())
10967 {
10969 }
10970 }
10971
10973 {
10974 float split_quantity_new;
10978 InventoryLocation loc = new InventoryLocation;
10979
10980 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10981 {
10983 split_quantity_new = stack_max;
10984 else
10986
10988 {
10989 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10990 if (new_item)
10991 {
10992 new_item.SetResultOfSplit(true);
10993 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10995 new_item.
SetQuantity(split_quantity_new,
false,
true);
10996 }
10997 }
10998 }
10999 else if (destination_entity && slot_id == -1)
11000 {
11001 if (quantity > stack_max)
11002 split_quantity_new = stack_max;
11003 else
11004 split_quantity_new = quantity;
11005
11007 {
11009 {
11012 }
11013
11014 if (new_item)
11015 {
11016 new_item.SetResultOfSplit(true);
11017 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11019 new_item.
SetQuantity(split_quantity_new,
false,
true);
11020 }
11021 }
11022 }
11023 else
11024 {
11025 if (stack_max != 0)
11026 {
11028 {
11030 }
11031
11032 if (split_quantity_new == 0)
11033 {
11034 if (!
GetGame().IsMultiplayer())
11035 player.PhysicalPredictiveDropItem(this);
11036 else
11037 player.ServerDropEntity(this);
11038 return;
11039 }
11040
11042 {
11044
11045 if (new_item)
11046 {
11047 new_item.SetResultOfSplit(true);
11048 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11051 new_item.PlaceOnSurface();
11052 }
11053 }
11054 }
11055 }
11056 }
11057
11059 {
11060 float split_quantity_new;
11064 InventoryLocation loc = new InventoryLocation;
11065
11066 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11067 {
11069 split_quantity_new = stack_max;
11070 else
11072
11074 {
11075 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11076 if (new_item)
11077 {
11078 new_item.SetResultOfSplit(true);
11079 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11081 new_item.
SetQuantity(split_quantity_new,
false,
true);
11082 }
11083 }
11084 }
11085 else if (destination_entity && slot_id == -1)
11086 {
11087 if (quantity > stack_max)
11088 split_quantity_new = stack_max;
11089 else
11090 split_quantity_new = quantity;
11091
11093 {
11095 {
11098 }
11099
11100 if (new_item)
11101 {
11102 new_item.SetResultOfSplit(true);
11103 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11105 new_item.
SetQuantity(split_quantity_new,
false,
true);
11106 }
11107 }
11108 }
11109 else
11110 {
11111 if (stack_max != 0)
11112 {
11114 {
11116 }
11117
11119 {
11121
11122 if (new_item)
11123 {
11124 new_item.SetResultOfSplit(true);
11125 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11128 new_item.PlaceOnSurface();
11129 }
11130 }
11131 }
11132 }
11133 }
11134
11136 {
11138 {
11139 if (ScriptInputUserData.CanStoreInputUserData())
11140 {
11141 ScriptInputUserData ctx = new ScriptInputUserData;
11146 dst.WriteToContext(ctx);
11148 }
11149 }
11150 else if (!
GetGame().IsMultiplayer())
11151 {
11153 }
11154 }
11155
11157 {
11159 {
11160 if (ScriptInputUserData.CanStoreInputUserData())
11161 {
11162 ScriptInputUserData ctx = new ScriptInputUserData;
11167 ctx.
Write(destination_entity);
11173 }
11174 }
11175 else if (!
GetGame().IsMultiplayer())
11176 {
11178 }
11179 }
11180
11182 {
11184 }
11185
11187 {
11189 float split_quantity_new;
11191 if (dst.IsValid())
11192 {
11193 int slot_id = dst.GetSlot();
11195
11196 if (quantity > stack_max)
11197 split_quantity_new = stack_max;
11198 else
11199 split_quantity_new = quantity;
11200
11202 {
11204
11205 if (new_item)
11206 {
11207 new_item.SetResultOfSplit(true);
11208 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11210 new_item.
SetQuantity(split_quantity_new,
false,
true);
11211 }
11212
11213 return new_item;
11214 }
11215 }
11216
11217 return null;
11218 }
11219
11221 {
11223 float split_quantity_new;
11225 if (destination_entity)
11226 {
11228 if (quantity > stackable)
11229 split_quantity_new = stackable;
11230 else
11231 split_quantity_new = quantity;
11232
11234 {
11235 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11236 if (new_item)
11237 {
11238 new_item.SetResultOfSplit(true);
11239 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11241 new_item.
SetQuantity(split_quantity_new,
false,
true);
11242 }
11243 }
11244 }
11245 }
11246
11248 {
11250 {
11251 if (ScriptInputUserData.CanStoreInputUserData())
11252 {
11253 ScriptInputUserData ctx = new ScriptInputUserData;
11258 ItemBase destination_entity =
this;
11259 ctx.
Write(destination_entity);
11263 }
11264 }
11265 else if (!
GetGame().IsMultiplayer())
11266 {
11268 }
11269 }
11270
11272 {
11274 float split_quantity_new;
11276 if (player)
11277 {
11279 if (quantity > stackable)
11280 split_quantity_new = stackable;
11281 else
11282 split_quantity_new = quantity;
11283
11285 {
11286 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11287 new_item =
ItemBase.Cast(in_hands);
11288 if (new_item)
11289 {
11290 new_item.SetResultOfSplit(true);
11291 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11293 new_item.SetQuantity(split_quantity_new, false, true);
11294 }
11295 }
11296 }
11297 }
11298
11300 {
11302 float split_quantity_new = Math.Floor(quantity * 0.5);
11303
11305 return;
11306
11308
11309 if (new_item)
11310 {
11311 if (new_item.GetQuantityMax() < split_quantity_new)
11312 {
11313 split_quantity_new = new_item.GetQuantityMax();
11314 }
11315
11316 new_item.SetResultOfSplit(true);
11317 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11318
11320 {
11323 }
11324 else
11325 {
11327 new_item.
SetQuantity(split_quantity_new,
false,
true);
11328 }
11329 }
11330 }
11331
11333 {
11335 float split_quantity_new = Math.Floor(quantity / 2);
11336
11338 return;
11339
11340 InventoryLocation invloc = new InventoryLocation;
11342
11344 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11345
11346 if (new_item)
11347 {
11348 if (new_item.GetQuantityMax() < split_quantity_new)
11349 {
11350 split_quantity_new = new_item.GetQuantityMax();
11351 }
11353 {
11356 }
11357 else if (split_quantity_new > 1)
11358 {
11360 new_item.
SetQuantity(split_quantity_new,
false,
true);
11361 }
11362 }
11363 }
11364
11367 {
11368 SetWeightDirty();
11370
11371 if (parent)
11372 parent.OnAttachmentQuantityChangedEx(this, delta);
11373
11375 {
11377 {
11379 }
11381 {
11382 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11384 }
11385 }
11386
11387 }
11388
11391 {
11392
11393 }
11394
11397 {
11399 }
11400
11402 {
11403 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11404
11406 {
11407 if (newLevel == GameConstants.STATE_RUINED)
11408 {
11410 EntityAI parent = GetHierarchyParent();
11411 if (parent && parent.IsFireplace())
11412 {
11413 CargoBase cargo = GetInventory().GetCargo();
11414 if (cargo)
11415 {
11417 {
11419 }
11420 }
11421 }
11422 }
11423
11425 {
11426
11428 return;
11429 }
11430
11431 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11432 {
11434 }
11435 }
11436 }
11437
11438
11440 {
11441 super.OnRightClick();
11442
11444 {
11446 {
11447 if (ScriptInputUserData.CanStoreInputUserData())
11448 {
11449 EntityAI root = GetHierarchyRoot();
11450 Man playerOwner = GetHierarchyRootPlayer();
11451 InventoryLocation dst = new InventoryLocation;
11452
11453
11454 if (!playerOwner && root && root == this)
11455 {
11457 }
11458 else
11459 {
11460
11461 GetInventory().GetCurrentInventoryLocation(dst);
11463 {
11466 {
11468 }
11469 else
11470 {
11472
11473
11474 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11475 {
11477 }
11478 else
11479 {
11480 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11481 }
11482 }
11483 }
11484 }
11485
11486 ScriptInputUserData ctx = new ScriptInputUserData;
11494 }
11495 }
11496 else if (!
GetGame().IsMultiplayer())
11497 {
11499 }
11500 }
11501 }
11502
11504 {
11505 if (root)
11506 {
11507 vector m4[4];
11508 root.GetTransform(m4);
11509 dst.SetGround(this, m4);
11510 }
11511 else
11512 {
11513 GetInventory().GetCurrentInventoryLocation(dst);
11514 }
11515 }
11516
11517 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11518 {
11519
11520 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11521 return false;
11522
11523 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11524 return false;
11525
11526
11528 return false;
11529
11530
11531 Magazine mag = Magazine.Cast(this);
11532 if (mag)
11533 {
11534 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11535 return false;
11536
11537 if (stack_max_limit)
11538 {
11539 Magazine other_mag = Magazine.Cast(other_item);
11540 if (other_item)
11541 {
11542 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11543 return false;
11544 }
11545
11546 }
11547 }
11548 else
11549 {
11550
11552 return false;
11553
11555 return false;
11556 }
11557
11558 PlayerBase player = null;
11559 if (CastTo(player, GetHierarchyRootPlayer()))
11560 {
11561 if (player.GetInventory().HasAttachment(this))
11562 return false;
11563
11564 if (player.IsItemsToDelete())
11565 return false;
11566 }
11567
11568 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11569 return false;
11570
11571 int slotID;
11573 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11574 return false;
11575
11576 return true;
11577 }
11578
11580 {
11582 }
11583
11585 {
11586 return m_IsResultOfSplit;
11587 }
11588
11590 {
11591 m_IsResultOfSplit = value;
11592 }
11593
11595 {
11597 }
11598
11600 {
11601 float other_item_quantity = other_item.GetQuantity();
11602 float this_free_space;
11603
11605
11607
11608 if (other_item_quantity > this_free_space)
11609 {
11610 return this_free_space;
11611 }
11612 else
11613 {
11614 return other_item_quantity;
11615 }
11616 }
11617
11619 {
11621 }
11622
11624 {
11626 return;
11627
11628 if (!IsMagazine() && other_item)
11629 {
11631 if (quantity_used != 0)
11632 {
11633 float hp1 = GetHealth01("","");
11634 float hp2 = other_item.GetHealth01("","");
11635 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11636 hpResult = hpResult / (
GetQuantity() + quantity_used);
11637
11638 hpResult *= GetMaxHealth();
11639 Math.Round(hpResult);
11640 SetHealth("", "Health", hpResult);
11641
11643 other_item.AddQuantity(-quantity_used);
11644 }
11645 }
11647 }
11648
11650 {
11651 #ifdef SERVER
11652 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11653 GetHierarchyParent().IncreaseLifetimeUp();
11654 #endif
11655 };
11656
11658 {
11659 PlayerBase p = PlayerBase.Cast(player);
11660
11661 array<int> recipesIds = p.m_Recipes;
11662 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11663 if (moduleRecipesManager)
11664 {
11665 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11666 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11667 }
11668
11669 for (int i = 0;i < recipesIds.Count(); i++)
11670 {
11671 int key = recipesIds.Get(i);
11672 string recipeName = moduleRecipesManager.GetRecipeName(key);
11674 }
11675 }
11676
11677
11678 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11679 {
11680 super.GetDebugActions(outputList);
11681
11682
11688
11689
11694
11699
11700
11704
11705
11707 {
11711 }
11712
11715
11716
11720
11722
11723 InventoryLocation loc = new InventoryLocation();
11724 GetInventory().GetCurrentInventoryLocation(loc);
11726 {
11727 if (Gizmo_IsSupported())
11730 }
11731
11733 }
11734
11735
11736
11737
11739 {
11740 super.OnAction(action_id, player, ctx);
11741
11743 {
11744 switch (action_id)
11745 {
11748 return true;
11751 return true;
11752 }
11753 }
11754
11756 {
11757 switch (action_id)
11758 {
11760 Delete();
11761 return true;
11762 }
11763 }
11764
11765 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11766 {
11767 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11768 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11769 PlayerBase p = PlayerBase.Cast(player);
11770 if (
EActions.RECIPES_RANGE_START < 1000)
11771 {
11772 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11773 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11774 }
11775 }
11776 #ifndef SERVER
11777 else if (action_id ==
EActions.WATCH_PLAYER)
11778 {
11779 PluginDeveloper.SetDeveloperItemClientEx(player);
11780 }
11781 #endif
11783 {
11784 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11785 {
11786 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11787 OnDebugButtonPressServer(id + 1);
11788 }
11789
11790 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11791 {
11792 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11794 }
11795
11796 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11797 {
11798 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11800 }
11801
11802 else if (action_id ==
EActions.ADD_QUANTITY)
11803 {
11804 if (IsMagazine())
11805 {
11806 Magazine mag = Magazine.Cast(this);
11807 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11808 }
11809 else
11810 {
11812 }
11813
11814 if (m_EM)
11815 {
11816 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11817 }
11818
11819 }
11820
11821 else if (action_id ==
EActions.REMOVE_QUANTITY)
11822 {
11823 if (IsMagazine())
11824 {
11825 Magazine mag2 = Magazine.Cast(this);
11826 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11827 }
11828 else
11829 {
11831 }
11832 if (m_EM)
11833 {
11834 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11835 }
11836
11837 }
11838
11839 else if (action_id ==
EActions.SET_QUANTITY_0)
11840 {
11842
11843 if (m_EM)
11844 {
11845 m_EM.SetEnergy(0);
11846 }
11847 }
11848
11849 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11850 {
11852
11853 if (m_EM)
11854 {
11855 m_EM.SetEnergy(m_EM.GetEnergyMax());
11856 }
11857 }
11858
11859 else if (action_id ==
EActions.ADD_HEALTH)
11860 {
11861 AddHealth("","",GetMaxHealth("","Health")/5);
11862 }
11863 else if (action_id ==
EActions.REMOVE_HEALTH)
11864 {
11865 AddHealth("","",-GetMaxHealth("","Health")/5);
11866 }
11867 else if (action_id ==
EActions.DESTROY_HEALTH)
11868 {
11869 SetHealth01("","",0);
11870 }
11871 else if (action_id ==
EActions.WATCH_ITEM)
11872 {
11874 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11875 #ifdef DEVELOPER
11876 SetDebugDeveloper_item(this);
11877 #endif
11878 }
11879
11880 else if (action_id ==
EActions.ADD_TEMPERATURE)
11881 {
11882 AddTemperature(20);
11883
11884 }
11885
11886 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11887 {
11888 AddTemperature(-20);
11889
11890 }
11891
11892 else if (action_id ==
EActions.FLIP_FROZEN)
11893 {
11894 SetFrozen(!GetIsFrozen());
11895
11896 }
11897
11898 else if (action_id ==
EActions.ADD_WETNESS)
11899 {
11901
11902 }
11903
11904 else if (action_id ==
EActions.REMOVE_WETNESS)
11905 {
11907
11908 }
11909
11910 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11911 {
11914
11915
11916 }
11917
11918 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11919 {
11922 }
11923
11924 else if (action_id ==
EActions.MAKE_SPECIAL)
11925 {
11926 auto debugParams = DebugSpawnParams.WithPlayer(player);
11927 OnDebugSpawnEx(debugParams);
11928 }
11929
11930 }
11931
11932
11933 return false;
11934 }
11935
11936
11937
11938
11942
11945
11946
11947
11949 {
11950 return false;
11951 }
11952
11953
11955 {
11956 return true;
11957 }
11958
11959
11961 {
11962 return true;
11963 }
11964
11965
11966
11968 {
11969 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11971 }
11972
11975 {
11976 return null;
11977 }
11978
11980 {
11981 return false;
11982 }
11983
11985 {
11986 return false;
11987 }
11988
11992
11993
11995 {
11996 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11997 return module_repairing.CanRepair(this, item_repair_kit);
11998 }
11999
12000
12001 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12002 {
12003 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12004 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12005 }
12006
12007
12009 {
12010
12011
12012
12013
12014
12015
12016
12017
12018 return 1;
12019 }
12020
12021
12022
12024 {
12026 }
12027
12028
12029
12031 {
12033 }
12034
12035
12044 {
12045 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12046
12047 if (player)
12048 {
12049 player.MessageStatus(text);
12050 }
12051 }
12052
12053
12062 {
12063 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12064
12065 if (player)
12066 {
12067 player.MessageAction(text);
12068 }
12069 }
12070
12071
12080 {
12081 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12082
12083 if (player)
12084 {
12085 player.MessageFriendly(text);
12086 }
12087 }
12088
12089
12098 {
12099 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12100
12101 if (player)
12102 {
12103 player.MessageImportant(text);
12104 }
12105 }
12106
12108 {
12109 return true;
12110 }
12111
12112
12113 override bool KindOf(
string tag)
12114 {
12115 bool found = false;
12116 string item_name = this.
GetType();
12119
12120 int array_size = item_tag_array.Count();
12121 for (int i = 0; i < array_size; i++)
12122 {
12123 if (item_tag_array.Get(i) == tag)
12124 {
12125 found = true;
12126 break;
12127 }
12128 }
12129 return found;
12130 }
12131
12132
12134 {
12135
12136 super.OnRPC(sender, rpc_type,ctx);
12137
12138
12139 switch (rpc_type)
12140 {
12141 #ifndef SERVER
12142 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12143 Param2<bool, string> p = new Param2<bool, string>(false, "");
12144
12146 return;
12147
12148 bool play = p.param1;
12149 string soundSet = p.param2;
12150
12151 if (play)
12152 {
12154 {
12156 {
12158 }
12159 }
12160 else
12161 {
12163 }
12164 }
12165 else
12166 {
12168 }
12169
12170 break;
12171 #endif
12172
12173 }
12174
12176 {
12178 }
12179 }
12180
12181
12182
12183
12185 {
12186 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12187 return plugin.GetID(
name);
12188 }
12189
12191 {
12192 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12193 return plugin.GetName(id);
12194 }
12195
12198 {
12199
12200
12201 int varFlags;
12202 if (!ctx.
Read(varFlags))
12203 return;
12204
12205 if (varFlags & ItemVariableFlags.FLOAT)
12206 {
12208 }
12209 }
12210
12212 {
12213
12214 super.SerializeNumericalVars(floats_out);
12215
12216
12217
12219 {
12221 }
12222
12224 {
12226 }
12227
12229 {
12231 }
12232
12234 {
12239 }
12240
12242 {
12244 }
12245 }
12246
12248 {
12249
12250 super.DeSerializeNumericalVars(floats);
12251
12252
12253 int index = 0;
12254 int mask = Math.Round(floats.Get(index));
12255
12256 index++;
12257
12259 {
12261 {
12263 }
12264 else
12265 {
12266 float quantity = floats.Get(index);
12267 SetQuantity(quantity,
true,
false,
false,
false);
12268 }
12269 index++;
12270 }
12271
12273 {
12274 float wet = floats.Get(index);
12276 index++;
12277 }
12278
12280 {
12281 int liquidtype = Math.Round(floats.Get(index));
12283 index++;
12284 }
12285
12287 {
12289 index++;
12291 index++;
12293 index++;
12295 index++;
12296 }
12297
12299 {
12300 int cleanness = Math.Round(floats.Get(index));
12302 index++;
12303 }
12304 }
12305
12307 {
12308 super.WriteVarsToCTX(ctx);
12309
12310
12312 {
12314 }
12315
12317 {
12319 }
12320
12322 {
12324 }
12325
12327 {
12328 int r,g,b,a;
12334 }
12335
12337 {
12339 }
12340 }
12341
12343 {
12344 if (!super.ReadVarsFromCTX(ctx,version))
12345 return false;
12346
12347 int intValue;
12348 float value;
12349
12350 if (version < 140)
12351 {
12352 if (!ctx.
Read(intValue))
12353 return false;
12354
12355 m_VariablesMask = intValue;
12356 }
12357
12359 {
12360 if (!ctx.
Read(value))
12361 return false;
12362
12364 {
12366 }
12367 else
12368 {
12370 }
12371 }
12372
12373 if (version < 140)
12374 {
12376 {
12377 if (!ctx.
Read(value))
12378 return false;
12379 SetTemperatureDirect(value);
12380 }
12381 }
12382
12384 {
12385 if (!ctx.
Read(value))
12386 return false;
12388 }
12389
12391 {
12392 if (!ctx.
Read(intValue))
12393 return false;
12395 }
12396
12398 {
12399 int r,g,b,a;
12401 return false;
12403 return false;
12405 return false;
12407 return false;
12408
12410 }
12411
12413 {
12414 if (!ctx.
Read(intValue))
12415 return false;
12417 }
12418
12419 if (version >= 138 && version < 140)
12420 {
12422 {
12423 if (!ctx.
Read(intValue))
12424 return false;
12425 SetFrozen(intValue);
12426 }
12427 }
12428
12429 return true;
12430 }
12431
12432
12434 {
12437 {
12439 }
12440
12441 if (!super.OnStoreLoad(ctx, version))
12442 {
12444 return false;
12445 }
12446
12447 if (version >= 114)
12448 {
12449 bool hasQuickBarIndexSaved;
12450
12451 if (!ctx.
Read(hasQuickBarIndexSaved))
12452 {
12454 return false;
12455 }
12456
12457 if (hasQuickBarIndexSaved)
12458 {
12459 int itmQBIndex;
12460
12461
12462 if (!ctx.
Read(itmQBIndex))
12463 {
12465 return false;
12466 }
12467
12468 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12469 if (itmQBIndex != -1 && parentPlayer)
12470 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12471 }
12472 }
12473 else
12474 {
12475
12476 PlayerBase player;
12477 int itemQBIndex;
12478 if (version ==
int.
MAX)
12479 {
12480 if (!ctx.
Read(itemQBIndex))
12481 {
12483 return false;
12484 }
12485 }
12486 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12487 {
12488
12489 if (!ctx.
Read(itemQBIndex))
12490 {
12492 return false;
12493 }
12494 if (itemQBIndex != -1 && player)
12495 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12496 }
12497 }
12498
12499 if (version < 140)
12500 {
12501
12502 if (!LoadVariables(ctx, version))
12503 {
12505 return false;
12506 }
12507 }
12508
12509
12511 {
12513 return false;
12514 }
12515 if (version >= 132)
12516 {
12518 if (raib)
12519 {
12521 {
12523 return false;
12524 }
12525 }
12526 }
12527
12529 return true;
12530 }
12531
12532
12533
12535 {
12536 super.OnStoreSave(ctx);
12537
12538 PlayerBase player;
12539 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12540 {
12542
12543 int itemQBIndex = -1;
12544 itemQBIndex = player.FindQuickBarEntityIndex(this);
12545 ctx.
Write(itemQBIndex);
12546 }
12547 else
12548 {
12550 }
12551
12553
12555 if (raib)
12556 {
12558 }
12559 }
12560
12561
12563 {
12564 super.AfterStoreLoad();
12565
12567 {
12569 }
12570
12572 {
12575 }
12576 }
12577
12579 {
12580 super.EEOnAfterLoad();
12581
12583 {
12585 }
12586
12589 }
12590
12592 {
12593 return false;
12594 }
12595
12596
12597
12599 {
12601 {
12602 #ifdef PLATFORM_CONSOLE
12603
12605 {
12607 if (menu)
12608 {
12610 }
12611 }
12612 #endif
12613 }
12614
12616 {
12619 }
12620
12622 {
12623 SetWeightDirty();
12625 }
12627 {
12630 }
12631
12633 {
12636 }
12638 {
12641 }
12642
12643 super.OnVariablesSynchronized();
12644 }
12645
12646
12647
12649 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12650 {
12651 if (!IsServerCheck(allow_client))
12652 return false;
12653
12655 return false;
12656
12659
12660 if (value <= (min + 0.001))
12661 value = min;
12662
12663 if (value == min)
12664 {
12665 if (destroy_config)
12666 {
12667 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12668 if (dstr)
12669 {
12671 this.Delete();
12672 return true;
12673 }
12674 }
12675 else if (destroy_forced)
12676 {
12678 this.Delete();
12679 return true;
12680 }
12681
12683 }
12684
12687
12689 {
12691
12692 if (delta)
12694 }
12695
12697
12698 return false;
12699 }
12700
12701
12703 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12704 {
12706 }
12707
12709 {
12712 }
12713
12715 {
12718 }
12719
12721 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12722 {
12723 float value_clamped = Math.Clamp(value, 0, 1);
12725 SetQuantity(result, destroy_config, destroy_forced);
12726 }
12727
12728
12731 {
12733 }
12734
12736 {
12738 }
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12750 {
12751 int slot = -1;
12752 if (GetInventory())
12753 {
12754 InventoryLocation il = new InventoryLocation;
12755 GetInventory().GetCurrentInventoryLocation(il);
12757 }
12758
12760 }
12761
12763 {
12764 float quantity_max = 0;
12765
12767 {
12768 if (attSlotID != -1)
12769 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12770
12771 if (quantity_max <= 0)
12773 }
12774
12775 if (quantity_max <= 0)
12777
12778 return quantity_max;
12779 }
12780
12782 {
12784 }
12785
12787 {
12789 }
12790
12791
12793 {
12795 }
12796
12798 {
12800 }
12801
12803 {
12805 }
12806
12807
12809 {
12810
12811 float weightEx = GetWeightEx();
12812 float special = GetInventoryAndCargoWeight();
12813 return weightEx - special;
12814 }
12815
12816
12818 {
12820 }
12821
12823 {
12825 {
12826 #ifdef DEVELOPER
12827 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12828 {
12829 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12831 }
12832 #endif
12833
12834 return GetQuantity() * GetConfigWeightModified();
12835 }
12836 else if (HasEnergyManager())
12837 {
12838 #ifdef DEVELOPER
12839 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12840 {
12841 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12842 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12843 }
12844 #endif
12845 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12846 }
12847 else
12848 {
12849 #ifdef DEVELOPER
12850 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12851 {
12852 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12853 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12854 }
12855 #endif
12856 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12857 }
12858 }
12859
12862 {
12863 int item_count = 0;
12865
12866 if (GetInventory().GetCargo() != NULL)
12867 {
12868 item_count = GetInventory().GetCargo().GetItemCount();
12869 }
12870
12871 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12872 {
12873 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12874 if (item)
12875 item_count += item.GetNumberOfItems();
12876 }
12877 return item_count;
12878 }
12879
12882 {
12883 float weight = 0;
12884 float wetness = 1;
12885 if (include_wetness)
12888 {
12889 weight = wetness * m_ConfigWeight;
12890 }
12892 {
12893 weight = 1;
12894 }
12895 return weight;
12896 }
12897
12898
12899
12901 {
12902 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12903 {
12904 GameInventory inv = GetInventory();
12905 array<EntityAI> items = new array<EntityAI>;
12907 for (int i = 0; i < items.Count(); i++)
12908 {
12910 if (item)
12911 {
12913 }
12914 }
12915 }
12916 }
12917
12918
12919
12920
12922 {
12923 float energy = 0;
12924 if (HasEnergyManager())
12925 {
12926 energy = GetCompEM().GetEnergy();
12927 }
12928 return energy;
12929 }
12930
12931
12933 {
12934 super.OnEnergyConsumed();
12935
12937 }
12938
12940 {
12941 super.OnEnergyAdded();
12942
12944 }
12945
12946
12948 {
12949 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12950 {
12952 {
12953 float energy_0to1 = GetCompEM().GetEnergy0To1();
12955 }
12956 }
12957 }
12958
12959
12961 {
12962 return ConfigGetFloat("heatIsolation");
12963 }
12964
12966 {
12968 }
12969
12971 {
12972 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12973 if (
GetGame().ConfigIsExisting(paramPath))
12975
12976 return 0.0;
12977 }
12978
12980 {
12981 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12982 if (
GetGame().ConfigIsExisting(paramPath))
12984
12985 return 0.0;
12986 }
12987
12988 override void SetWet(
float value,
bool allow_client =
false)
12989 {
12990 if (!IsServerCheck(allow_client))
12991 return;
12992
12995
12997
12998 m_VarWet = Math.Clamp(value, min, max);
12999
13001 {
13004 }
13005 }
13006
13007 override void AddWet(
float value)
13008 {
13010 }
13011
13013 {
13015 }
13016
13018 {
13020 }
13021
13023 {
13025 }
13026
13028 {
13030 }
13031
13033 {
13035 }
13036
13037 override void OnWetChanged(
float newVal,
float oldVal)
13038 {
13041 if (newLevel != oldLevel)
13042 {
13044 }
13045 }
13046
13048 {
13049 SetWeightDirty();
13050 }
13051
13053 {
13054 return GetWetLevelInternal(
m_VarWet);
13055 }
13056
13057
13058
13060 {
13062 }
13063
13065 {
13067 }
13068
13070 {
13072 }
13073
13075 {
13077 }
13078
13079
13080
13082 {
13083 if (ConfigIsExisting("itemModelLength"))
13084 {
13085 return ConfigGetFloat("itemModelLength");
13086 }
13087 return 0;
13088 }
13089
13091 {
13092 if (ConfigIsExisting("itemAttachOffset"))
13093 {
13094 return ConfigGetFloat("itemAttachOffset");
13095 }
13096 return 0;
13097 }
13098
13099 override void SetCleanness(
int value,
bool allow_client =
false)
13100 {
13101 if (!IsServerCheck(allow_client))
13102 return;
13103
13105
13107
13110 }
13111
13113 {
13115 }
13116
13118 {
13119 return true;
13120 }
13121
13122
13123
13124
13126 {
13128 }
13129
13131 {
13133 }
13134
13135
13136
13137
13138 override void SetColor(
int r,
int g,
int b,
int a)
13139 {
13145 }
13147 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13148 {
13153 }
13154
13156 {
13158 }
13159
13162 {
13163 int r,g,b,a;
13165 r = r/255;
13166 g = g/255;
13167 b = b/255;
13168 a = a/255;
13169 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13170 }
13171
13172
13173
13174 override void SetLiquidType(
int value,
bool allow_client =
false)
13175 {
13176 if (!IsServerCheck(allow_client))
13177 return;
13178
13183 }
13184
13186 {
13187 return ConfigGetInt("varLiquidTypeInit");
13188 }
13189
13191 {
13193 }
13194
13196 {
13198 SetFrozen(false);
13199 }
13200
13203 {
13204 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13205 }
13206
13207
13210 {
13211 PlayerBase nplayer;
13212 if (PlayerBase.CastTo(nplayer, player))
13213 {
13215
13216 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13217 }
13218 }
13219
13220
13223 {
13224 PlayerBase nplayer;
13225 if (PlayerBase.CastTo(nplayer,player))
13226 {
13227
13228 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13229
13230 }
13231
13232
13233 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13234
13235
13236 if (HasEnergyManager())
13237 {
13238 GetCompEM().UpdatePlugState();
13239 }
13240 }
13241
13242
13244 {
13245 super.OnPlacementStarted(player);
13246
13248 }
13249
13250 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13251 {
13253 {
13254 m_AdminLog.OnPlacementComplete(player,
this);
13255 }
13256
13257 super.OnPlacementComplete(player, position, orientation);
13258 }
13259
13260
13261
13262
13263
13265 {
13267 {
13268 return true;
13269 }
13270 else
13271 {
13272 return false;
13273 }
13274 }
13275
13276
13278 {
13280 {
13282 }
13283 }
13284
13285
13287 {
13289 }
13290
13292 {
13294 }
13295
13296 override void InsertAgent(
int agent,
float count = 1)
13297 {
13298 if (count < 1)
13299 return;
13300
13302 }
13303
13306 {
13308 }
13309
13310
13312 {
13314 }
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13358 {
13360 return false;
13361 return true;
13362 }
13363
13365 {
13366
13368 }
13369
13370
13373 {
13374 super.CheckForRoofLimited(timeTresholdMS);
13375
13377 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13378 {
13379 m_PreviousRoofTestTime = time;
13380 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13381 }
13382 }
13383
13384
13386 {
13388 {
13389 return 0;
13390 }
13391
13392 if (GetInventory().GetAttachmentSlotsCount() != 0)
13393 {
13394 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13395 if (filter)
13396 return filter.GetProtectionLevel(type, false, system);
13397 else
13398 return 0;
13399 }
13400
13401 string subclassPath, entryName;
13402
13403 switch (type)
13404 {
13406 entryName = "biological";
13407 break;
13409 entryName = "chemical";
13410 break;
13411 default:
13412 entryName = "biological";
13413 break;
13414 }
13415
13416 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13417
13419 }
13420
13421
13422
13425 {
13426 if (!IsMagazine())
13428
13430 }
13431
13432
13433
13434
13435
13440 {
13441 return true;
13442 }
13443
13445 {
13447 }
13448
13449
13450
13451
13452
13454 {
13455 if (parent)
13456 {
13457 if (parent.IsInherited(DayZInfected))
13458 return true;
13459
13460 if (!parent.IsRuined())
13461 return true;
13462 }
13463
13464 return true;
13465 }
13466
13468 {
13469 if (!super.CanPutAsAttachment(parent))
13470 {
13471 return false;
13472 }
13473
13474 if (!IsRuined() && !parent.IsRuined())
13475 {
13476 return true;
13477 }
13478
13479 return false;
13480 }
13481
13483 {
13484
13485
13486
13487
13488 return super.CanReceiveItemIntoCargo(item);
13489 }
13490
13492 {
13493
13494
13495
13496
13497 GameInventory attachmentInv = attachment.GetInventory();
13499 {
13500 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13501 return false;
13502 }
13503
13504 InventoryLocation loc = new InventoryLocation();
13505 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13506 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13507 return false;
13508
13509 return super.CanReceiveAttachment(attachment, slotId);
13510 }
13511
13513 {
13514 if (!super.CanReleaseAttachment(attachment))
13515 return false;
13516
13517 return GetInventory().AreChildrenAccessible();
13518 }
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13541 {
13542 int id = muzzle_owner.GetMuzzleID();
13543 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13544
13545 if (WPOF_array)
13546 {
13547 for (int i = 0; i < WPOF_array.Count(); i++)
13548 {
13549 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13550
13551 if (WPOF)
13552 {
13553 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13554 }
13555 }
13556 }
13557 }
13558
13559
13561 {
13562 int id = muzzle_owner.GetMuzzleID();
13564
13565 if (WPOBE_array)
13566 {
13567 for (int i = 0; i < WPOBE_array.Count(); i++)
13568 {
13569 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13570
13571 if (WPOBE)
13572 {
13573 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13574 }
13575 }
13576 }
13577 }
13578
13579
13581 {
13582 int id = muzzle_owner.GetMuzzleID();
13583 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13584
13585 if (WPOOH_array)
13586 {
13587 for (int i = 0; i < WPOOH_array.Count(); i++)
13588 {
13589 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13590
13591 if (WPOOH)
13592 {
13593 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13594 }
13595 }
13596 }
13597 }
13598
13599
13601 {
13602 int id = muzzle_owner.GetMuzzleID();
13603 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13604
13605 if (WPOOH_array)
13606 {
13607 for (int i = 0; i < WPOOH_array.Count(); i++)
13608 {
13609 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13610
13611 if (WPOOH)
13612 {
13613 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13614 }
13615 }
13616 }
13617 }
13618
13619
13621 {
13622 int id = muzzle_owner.GetMuzzleID();
13623 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13624
13625 if (WPOOH_array)
13626 {
13627 for (int i = 0; i < WPOOH_array.Count(); i++)
13628 {
13629 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13630
13631 if (WPOOH)
13632 {
13633 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13634 }
13635 }
13636 }
13637 }
13638
13639
13640
13642 {
13644 {
13645 return true;
13646 }
13647
13648 return false;
13649 }
13650
13652 {
13654 {
13655 return true;
13656 }
13657
13658 return false;
13659 }
13660
13662 {
13664 {
13665 return true;
13666 }
13667
13668 return false;
13669 }
13670
13672 {
13673 return false;
13674 }
13675
13678 {
13679 return UATimeSpent.DEFAULT_DEPLOY;
13680 }
13681
13682
13683
13684
13686 {
13688 SetSynchDirty();
13689 }
13690
13692 {
13694 }
13695
13696
13698 {
13699 return false;
13700 }
13701
13704 {
13705 string att_type = "None";
13706
13707 if (ConfigIsExisting("soundAttType"))
13708 {
13709 att_type = ConfigGetString("soundAttType");
13710 }
13711
13713 }
13714
13716 {
13718 }
13719
13720
13721
13722
13723
13729
13731 {
13734
13736 }
13737
13738
13740 {
13742 return;
13743
13745
13748
13751
13752 SoundParameters params = new SoundParameters();
13756 }
13757
13758
13760 {
13762 return;
13763
13765 SetSynchDirty();
13766
13769 }
13770
13771
13773 {
13775 return;
13776
13778 SetSynchDirty();
13779
13782 }
13783
13785 {
13787 }
13788
13790 {
13792 }
13793
13796 {
13797 if (!
GetGame().IsDedicatedServer())
13798 {
13799 if (ConfigIsExisting("attachSoundSet"))
13800 {
13801 string cfg_path = "";
13802 string soundset = "";
13803 string type_name =
GetType();
13804
13807 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13808 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13809
13810 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13811 {
13812 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13813 {
13814 if (cfg_slot_array[i] == slot_type)
13815 {
13816 soundset = cfg_soundset_array[i];
13817 break;
13818 }
13819 }
13820 }
13821
13822 if (soundset != "")
13823 {
13824 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13826 }
13827 }
13828 }
13829 }
13830
13832 {
13833
13834 }
13835
13836 void OnApply(PlayerBase player);
13837
13839 {
13840 return 1.0;
13841 };
13842
13844 {
13846 }
13847
13849 {
13851 }
13852
13854
13856 {
13857 SetDynamicPhysicsLifeTime(0.01);
13859 }
13860
13862 {
13863 array<string> zone_names = new array<string>;
13864 GetDamageZones(zone_names);
13865 for (int i = 0; i < zone_names.Count(); i++)
13866 {
13867 SetHealthMax(zone_names.Get(i),"Health");
13868 }
13869 SetHealthMax("","Health");
13870 }
13871
13874 {
13875 float global_health = GetHealth01("","Health");
13876 array<string> zones = new array<string>;
13877 GetDamageZones(zones);
13878
13879 for (int i = 0; i < zones.Count(); i++)
13880 {
13881 SetHealth01(zones.Get(i),"Health",global_health);
13882 }
13883 }
13884
13887 {
13888 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13889 }
13890
13892 {
13893 if (!hasRootAsPlayer)
13894 {
13895 if (refParentIB)
13896 {
13897
13898 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13899 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13900
13901 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13902 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13903
13906 }
13907 else
13908 {
13909
13912 }
13913 }
13914 }
13915
13917 {
13919 {
13920 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13921 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13922 {
13923 float heatPermCoef = 1.0;
13925 while (ent)
13926 {
13927 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13928 ent = ent.GetHierarchyParent();
13929 }
13930
13931 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13932 }
13933 }
13934 }
13935
13937 {
13938
13939 EntityAI parent = GetHierarchyParent();
13940 if (!parent)
13941 {
13942 hasParent = false;
13943 hasRootAsPlayer = false;
13944 }
13945 else
13946 {
13947 hasParent = true;
13948 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13949 refParentIB =
ItemBase.Cast(parent);
13950 }
13951 }
13952
13953 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13954 {
13955
13956 }
13957
13959 {
13960
13961 return false;
13962 }
13963
13965 {
13966
13967
13968 return false;
13969 }
13970
13972 {
13973
13974 return false;
13975 }
13976
13979 {
13980 return !GetIsFrozen() &&
IsOpen();
13981 }
13982
13984 {
13985 bool hasParent = false, hasRootAsPlayer = false;
13987
13988 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13989 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13990
13991 if (wwtu || foodDecay)
13992 {
13996
13997 if (processWetness || processTemperature || processDecay)
13998 {
14000
14001 if (processWetness)
14002 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14003
14004 if (processTemperature)
14006
14007 if (processDecay)
14008 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14009 }
14010 }
14011 }
14012
14015 {
14017 }
14018
14020 {
14023
14024 return super.GetTemperatureFreezeThreshold();
14025 }
14026
14028 {
14031
14032 return super.GetTemperatureThawThreshold();
14033 }
14034
14036 {
14039
14040 return super.GetItemOverheatThreshold();
14041 }
14042
14044 {
14046 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14047
14048 return super.GetTemperatureFreezeTime();
14049 }
14050
14052 {
14054 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14055
14056 return super.GetTemperatureThawTime();
14057 }
14058
14063
14065 {
14066 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14067 }
14068
14070 {
14071 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14072 }
14073
14076 {
14078 }
14079
14081 {
14083 }
14084
14086 {
14088 }
14089
14092 {
14093 return null;
14094 }
14095
14098 {
14099 return false;
14100 }
14101
14103 {
14105 {
14108 if (!trg)
14109 {
14111 explosive = this;
14112 }
14113
14114 explosive.PairRemote(trg);
14116
14117 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14118 trg.SetPersistentPairID(persistentID);
14119 explosive.SetPersistentPairID(persistentID);
14120
14121 return true;
14122 }
14123 return false;
14124 }
14125
14128 {
14129 float ret = 1.0;
14132 ret *= GetHealth01();
14133
14134 return ret;
14135 }
14136
14137 #ifdef DEVELOPER
14138 override void SetDebugItem()
14139 {
14140 super.SetDebugItem();
14141 _itemBase = this;
14142 }
14143
14145 {
14146 string text = super.GetDebugText();
14147
14149 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14150
14151 return text;
14152 }
14153 #endif
14154
14156 {
14157 return true;
14158 }
14159
14161
14163
14165 {
14168 }
14169
14170
14178
14194}
14195
14197{
14199 if (entity)
14200 {
14201 bool is_item = entity.IsInherited(
ItemBase);
14202 if (is_item && full_quantity)
14203 {
14206 }
14207 }
14208 else
14209 {
14211 return NULL;
14212 }
14213 return entity;
14214}
14215
14217{
14218 if (item)
14219 {
14220 if (health > 0)
14221 item.SetHealth("", "", health);
14222
14223 if (item.CanHaveTemperature())
14224 {
14226 if (item.CanFreeze())
14227 item.SetFrozen(false);
14228 }
14229
14230 if (item.HasEnergyManager())
14231 {
14232 if (quantity >= 0)
14233 {
14234 item.GetCompEM().SetEnergy0To1(quantity);
14235 }
14236 else
14237 {
14239 }
14240 }
14241 else if (item.IsMagazine())
14242 {
14243 Magazine mag = Magazine.Cast(item);
14244 if (quantity >= 0)
14245 {
14246 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14247 }
14248 else
14249 {
14251 }
14252
14253 }
14254 else
14255 {
14256 if (quantity >= 0)
14257 {
14258 item.SetQuantityNormalized(quantity, false);
14259 }
14260 else
14261 {
14263 }
14264
14265 }
14266 }
14267}
14268
14269#ifdef DEVELOPER
14271#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.