9312{
9314 {
9315 return true;
9316 }
9317};
9318
9319
9320
9322{
9326
9328
9331
9332
9333
9334
9335
9344
9350
9355
9360
9381 protected bool m_IsResultOfSplit
9382
9384
9389
9390
9391
9393
9397
9398
9399
9401
9404
9405
9406
9412
9413
9421
9424
9425
9427
9428
9430
9431
9436
9437
9442
9443
9445
9446
9448 {
9453
9454 if (!
GetGame().IsDedicatedServer())
9455 {
9457 {
9459
9461 {
9463 }
9464 }
9465
9468 }
9469
9470 m_OldLocation = null;
9471
9473 {
9475 }
9476
9477 if (ConfigIsExisting("headSelectionsToHide"))
9478 {
9481 }
9482
9484 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9485 {
9487 }
9488
9490
9491 m_IsResultOfSplit = false;
9492
9494 }
9495
9497 {
9498 super.InitItemVariables();
9499
9505 m_Count = ConfigGetInt(
"count");
9506
9509
9514
9517
9522
9534
9538
9539
9542 if (ConfigIsExisting("canBeSplit"))
9543 {
9546 }
9547
9549 if (ConfigIsExisting("itemBehaviour"))
9551
9552
9555 RegisterNetSyncVariableInt("m_VarLiquidType");
9556 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9557
9558 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9559 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9560 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9561
9562 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9563 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9564 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9565 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9566
9567 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9568 RegisterNetSyncVariableBool("m_IsTakeable");
9569 RegisterNetSyncVariableBool("m_IsHologram");
9570
9573 {
9576 }
9577
9579
9581 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9583
9584 }
9585
9587 {
9589 }
9590
9592 {
9595 {
9600 }
9601 }
9602
9603 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9604 {
9606 {
9609 }
9610
9612 }
9613
9615 {
9621 }
9622
9624
9626 {
9628
9629 if (!action)
9630 {
9631 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9632 return;
9633 }
9634
9636 if (!ai)
9637 {
9639 return;
9640 }
9641
9643 if (!action_array)
9644 {
9645 action_array = new array<ActionBase_Basic>;
9647 }
9648 if (LogManager.IsActionLogEnable())
9649 {
9650 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9651 }
9652
9653 if (action_array.Find(action) != -1)
9654 {
9655 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9656 }
9657 else
9658 {
9659 action_array.Insert(action);
9660 }
9661 }
9662
9664 {
9666 ActionBase action = player.GetActionManager().GetAction(actionName);
9669
9670 if (action_array)
9671 {
9672 action_array.RemoveItem(action);
9673 }
9674 }
9675
9676
9677
9679 {
9680 ActionOverrideData overrideData = new ActionOverrideData();
9684
9686 if (!actionMap)
9687 {
9690 }
9691
9692 actionMap.Insert(this.
Type(), overrideData);
9693
9694 }
9695
9697
9699
9700
9702 {
9705
9708
9709 string config_to_search = "CfgVehicles";
9710 string muzzle_owner_config;
9711
9713 {
9714 if (IsInherited(Weapon))
9715 config_to_search = "CfgWeapons";
9716
9717 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9718
9719 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9720
9722
9723 if (config_OnFire_subclass_count > 0)
9724 {
9725 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9726
9727 for (int i = 0; i < config_OnFire_subclass_count; i++)
9728 {
9729 string particle_class = "";
9731 string config_OnFire_entry = config_OnFire_class + particle_class;
9732 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9733 WPOF_array.Insert(WPOF);
9734 }
9735
9736
9738 }
9739 }
9740
9742 {
9743 config_to_search = "CfgWeapons";
9744 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9745
9746 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9747
9749
9750 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9751 {
9752 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9753
9754 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9755 {
9756 string particle_class2 = "";
9758 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9759 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9760 WPOBE_array.Insert(WPOBE);
9761 }
9762
9763
9765 }
9766 }
9767 }
9768
9769
9771 {
9774
9776 {
9777 string config_to_search = "CfgVehicles";
9778
9779 if (IsInherited(Weapon))
9780 config_to_search = "CfgWeapons";
9781
9782 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9783 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9784
9785 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9786 {
9787
9789
9791 {
9793 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9795 return;
9796 }
9797
9800
9801
9802
9804 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9805
9806 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9807 {
9808 string particle_class = "";
9810 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9812
9813 if (entry_type == CT_CLASS)
9814 {
9815 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9816 WPOOH_array.Insert(WPOF);
9817 }
9818 }
9819
9820
9822 }
9823 }
9824 }
9825
9827 {
9829 }
9830
9832 {
9834 {
9836
9839
9842
9843 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9844 }
9845 }
9846
9848 {
9850 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9851
9853 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9854
9856 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9857
9859 {
9861 }
9862 }
9863
9865 {
9867 }
9868
9870 {
9873 else
9875
9877 {
9880 }
9881 else
9882 {
9885
9888 }
9889
9891 }
9892
9894 {
9896 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9897 }
9898
9900 {
9902 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9904 }
9905
9907 {
9909 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9910 }
9911
9913 {
9916
9917 OverheatingParticle OP = new OverheatingParticle();
9922
9924 }
9925
9927 {
9930
9931 return -1;
9932 }
9933
9935 {
9937 {
9940
9941 for (int i = count; i > 0; --i)
9942 {
9943 int id = i - 1;
9946
9949
9950 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9951 {
9952 if (p)
9953 {
9956 }
9957 }
9958 }
9959 }
9960 }
9961
9963 {
9965 {
9967 {
9968 int id = i - 1;
9970
9971 if (OP)
9972 {
9974
9975 if (p)
9976 {
9978 }
9979
9980 delete OP;
9981 }
9982 }
9983
9986 }
9987 }
9988
9991 {
9992 return 0.0;
9993 }
9994
9995
9997 {
9998 return 250;
9999 }
10000
10002 {
10003 return 0;
10004 }
10005
10008 {
10010 return true;
10011
10012 return false;
10013 }
10014
10017 {
10020
10022 {
10024 }
10025 else
10026 {
10027
10029 }
10030
10032 }
10033
10040 {
10041 return -1;
10042 }
10043
10044
10045
10046
10048 {
10050 {
10052 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10053
10054 if (r_index >= 0)
10055 {
10056 InventoryLocation r_il = new InventoryLocation;
10057 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10058
10059 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10062 {
10063 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10064 }
10066 {
10067 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10068 }
10069
10070 }
10071
10072 player.GetHumanInventory().ClearUserReservedLocation(this);
10073 }
10074
10077 }
10078
10079
10080
10081
10083 {
10084 return ItemBase.m_DebugActionsMask;
10085 }
10086
10088 {
10089 return ItemBase.m_DebugActionsMask & mask;
10090 }
10091
10093 {
10094 ItemBase.m_DebugActionsMask = mask;
10095 }
10096
10098 {
10099 ItemBase.m_DebugActionsMask |= mask;
10100 }
10101
10103 {
10104 ItemBase.m_DebugActionsMask &= ~mask;
10105 }
10106
10108 {
10110 {
10112 }
10113 else
10114 {
10116 }
10117 }
10118
10119
10121 {
10122 if (GetEconomyProfile())
10123 {
10124 float q_max = GetEconomyProfile().GetQuantityMax();
10125 if (q_max > 0)
10126 {
10127 float q_min = GetEconomyProfile().GetQuantityMin();
10128 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10129
10131 {
10132 ComponentEnergyManager comp = GetCompEM();
10134 {
10136 }
10137 }
10139 {
10141
10142 }
10143
10144 }
10145 }
10146 }
10147
10150 {
10151 EntityAI parent = GetHierarchyParent();
10152
10153 if (parent)
10154 {
10155 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10156 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10157 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10158 }
10159 }
10160
10163 {
10164 EntityAI parent = GetHierarchyParent();
10165
10166 if (parent)
10167 {
10168 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10169 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10170 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10171 }
10172 }
10173
10175 {
10176
10177
10178
10179
10181
10183 {
10184 if (ScriptInputUserData.CanStoreInputUserData())
10185 {
10186 ScriptInputUserData ctx = new ScriptInputUserData;
10192 ctx.
Write(use_stack_max);
10195
10197 {
10198 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10199 }
10200 }
10201 }
10202 else if (!
GetGame().IsMultiplayer())
10203 {
10205 }
10206 }
10207
10209 {
10211 }
10212
10214 {
10216 }
10217
10219 {
10221 }
10222
10224 {
10225
10226 return false;
10227 }
10228
10230 {
10231 return false;
10232 }
10233
10237 {
10238 return false;
10239 }
10240
10242 {
10243 return "";
10244 }
10245
10247
10249 {
10250 return false;
10251 }
10252
10254 {
10255 return true;
10256 }
10257
10258
10259
10261 {
10262 return true;
10263 }
10264
10266 {
10267 return true;
10268 }
10269
10271 {
10272 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10274 }
10275
10277 {
10279 }
10280
10282 {
10284 if (!is_being_placed)
10286 SetSynchDirty();
10287 }
10288
10289
10291
10293 {
10295 }
10296
10298 {
10300 }
10301
10303 {
10304 return 1;
10305 }
10306
10308 {
10309 return false;
10310 }
10311
10313 {
10315 SetSynchDirty();
10316 }
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10353 {
10354 super.OnMovedInsideCargo(container);
10355
10356 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10357 }
10358
10359 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10360 {
10361 super.EEItemLocationChanged(oldLoc,newLoc);
10362
10363 PlayerBase new_player = null;
10364 PlayerBase old_player = null;
10365
10366 if (newLoc.GetParent())
10367 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10368
10369 if (oldLoc.GetParent())
10370 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10371
10373 {
10374 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10375
10376 if (r_index >= 0)
10377 {
10378 InventoryLocation r_il = new InventoryLocation;
10379 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10380
10381 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10384 {
10385 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10386 }
10388 {
10389 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10390 }
10391
10392 }
10393 }
10394
10396 {
10397 if (new_player)
10398 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10399
10400 if (new_player == old_player)
10401 {
10402
10403 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10404 {
10406 {
10407 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10408 {
10409 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10410 }
10411 }
10412 else
10413 {
10414 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10415 }
10416 }
10417
10418 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10419 {
10420 int type = oldLoc.GetType();
10422 {
10423 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10424 }
10426 {
10427 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10428 }
10429 }
10430 if (!m_OldLocation)
10431 {
10432 m_OldLocation = new InventoryLocation;
10433 }
10434 m_OldLocation.Copy(oldLoc);
10435 }
10436 else
10437 {
10438 if (m_OldLocation)
10439 {
10440 m_OldLocation.Reset();
10441 }
10442 }
10443
10445 }
10446 else
10447 {
10448 if (new_player)
10449 {
10450 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10451 if (res_index >= 0)
10452 {
10453 InventoryLocation il = new InventoryLocation;
10454 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10456 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10459 {
10460 il.
GetParent().GetOnReleaseLock().Invoke(it);
10461 }
10463 {
10465 }
10466
10467 }
10468 }
10470 {
10471
10473 }
10474
10475 if (m_OldLocation)
10476 {
10477 m_OldLocation.Reset();
10478 }
10479 }
10480 }
10481
10482 override void EOnContact(IEntity other, Contact extra)
10483 {
10485 {
10486 int liquidType = -1;
10488 if (impactSpeed > 0.0)
10489 {
10491 #ifndef SERVER
10493 #else
10495 SetSynchDirty();
10496 #endif
10498 }
10499 }
10500
10501 #ifdef SERVER
10502 if (GetCompEM() && GetCompEM().IsPlugged())
10503 {
10504 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10505 GetCompEM().UnplugThis();
10506 }
10507 #endif
10508 }
10509
10511
10513 {
10515 }
10516
10518 {
10519
10520 }
10521
10523 {
10524 super.OnItemLocationChanged(old_owner, new_owner);
10525
10526 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10527 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10528
10529 if (!relatedPlayer && playerNew)
10530 relatedPlayer = playerNew;
10531
10532 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10533 {
10535 if (actionMgr)
10536 {
10537 ActionBase currentAction = actionMgr.GetRunningAction();
10538 if (currentAction)
10540 }
10541 }
10542
10543 Man ownerPlayerOld = null;
10544 Man ownerPlayerNew = null;
10545
10546 if (old_owner)
10547 {
10548 if (old_owner.
IsMan())
10549 {
10550 ownerPlayerOld = Man.Cast(old_owner);
10551 }
10552 else
10553 {
10554 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10555 }
10556 }
10557 else
10558 {
10560 {
10562
10563 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10564 {
10565 GetCompEM().UnplugThis();
10566 }
10567 }
10568 }
10569
10570 if (new_owner)
10571 {
10572 if (new_owner.
IsMan())
10573 {
10574 ownerPlayerNew = Man.Cast(new_owner);
10575 }
10576 else
10577 {
10578 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10579 }
10580 }
10581
10582 if (ownerPlayerOld != ownerPlayerNew)
10583 {
10584 if (ownerPlayerOld)
10585 {
10586 array<EntityAI> subItemsExit = new array<EntityAI>;
10588 for (int i = 0; i < subItemsExit.Count(); i++)
10589 {
10592 }
10593 }
10594
10595 if (ownerPlayerNew)
10596 {
10597 array<EntityAI> subItemsEnter = new array<EntityAI>;
10599 for (int j = 0; j < subItemsEnter.Count(); j++)
10600 {
10603 }
10604 }
10605 }
10606 else if (ownerPlayerNew != null)
10607 {
10608 PlayerBase nplayer;
10609 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10610 {
10611 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10613 for (int k = 0; k < subItemsUpdate.Count(); k++)
10614 {
10616 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10617 }
10618 }
10619 }
10620
10621 if (old_owner)
10622 old_owner.OnChildItemRemoved(this);
10623 if (new_owner)
10624 new_owner.OnChildItemReceived(this);
10625 }
10626
10627
10629 {
10630 super.EEDelete(parent);
10631 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10632 if (player)
10633 {
10635
10636 if (player.IsAlive())
10637 {
10638 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10639 if (r_index >= 0)
10640 {
10641 InventoryLocation r_il = new InventoryLocation;
10642 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10643
10644 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10647 {
10648 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10649 }
10651 {
10652 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10653 }
10654
10655 }
10656
10657 player.RemoveQuickBarEntityShortcut(this);
10658 }
10659 }
10660 }
10661
10663 {
10664 super.EEKilled(killer);
10665
10668 {
10669 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10670 {
10671 if (IsMagazine())
10672 {
10673 if (Magazine.Cast(this).GetAmmoCount() > 0)
10674 {
10676 }
10677 }
10678 else
10679 {
10681 }
10682 }
10683 }
10684 }
10685
10687 {
10688 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10689
10690 super.OnWasAttached(parent, slot_id);
10691
10694
10696 }
10697
10699 {
10700 super.OnWasDetached(parent, slot_id);
10701
10704 }
10705
10707 {
10708 int idx;
10711
10712 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10713 if (inventory_slots.Count() < 1)
10714 {
10715 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10716 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10717 }
10718 else
10719 {
10720 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10721 }
10722
10723 idx = inventory_slots.Find(slot);
10724 if (idx < 0)
10725 return "";
10726
10727 return attach_types.Get(idx);
10728 }
10729
10731 {
10732 int idx = -1;
10733 string slot;
10734
10737
10738 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10739 if (inventory_slots.Count() < 1)
10740 {
10741 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10742 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10743 }
10744 else
10745 {
10746 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10747 if (detach_types.Count() < 1)
10748 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10749 }
10750
10751 for (int i = 0; i < inventory_slots.Count(); i++)
10752 {
10753 slot = inventory_slots.Get(i);
10754 }
10755
10756 if (slot != "")
10757 {
10758 if (detach_types.Count() == 1)
10759 idx = 0;
10760 else
10761 idx = inventory_slots.Find(slot);
10762 }
10763 if (idx < 0)
10764 return "";
10765
10766 return detach_types.Get(idx);
10767 }
10768
10770 {
10771
10773
10774
10775 float min_time = 1;
10776 float max_time = 3;
10777 float delay = Math.RandomFloat(min_time, max_time);
10778
10779 explode_timer.Run(delay, this, "DoAmmoExplosion");
10780 }
10781
10783 {
10784 Magazine magazine = Magazine.Cast(this);
10785 int pop_sounds_count = 6;
10786 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10787
10788
10789 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10790 string sound_name = pop_sounds[ sound_idx ];
10792
10793
10794 magazine.ServerAddAmmoCount(-1);
10795
10796
10797 float min_temp_to_explode = 100;
10798
10799 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10800 {
10802 }
10803 }
10804
10805
10806 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10807 {
10808 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10809
10810 const int CHANCE_DAMAGE_CARGO = 4;
10811 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10812 const int CHANCE_DAMAGE_NOTHING = 2;
10813
10815 {
10816 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10817 int chances;
10818 int rnd;
10819
10820 if (GetInventory().GetCargo())
10821 {
10822 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10823 rnd = Math.RandomInt(0,chances);
10824
10825 if (rnd < CHANCE_DAMAGE_CARGO)
10826 {
10828 }
10829 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10830 {
10832 }
10833 }
10834 else
10835 {
10836 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10837 rnd = Math.RandomInt(0,chances);
10838
10839 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10840 {
10842 }
10843 }
10844 }
10845 }
10846
10848 {
10849 if (GetInventory().GetCargo())
10850 {
10851 int item_count = GetInventory().GetCargo().GetItemCount();
10852 if (item_count > 0)
10853 {
10854 int random_pick = Math.RandomInt(0, item_count);
10856 if (!item.IsExplosive())
10857 {
10858 item.AddHealth("","",damage);
10859 return true;
10860 }
10861 }
10862 }
10863 return false;
10864 }
10865
10867 {
10868 int attachment_count = GetInventory().AttachmentCount();
10869 if (attachment_count > 0)
10870 {
10871 int random_pick = Math.RandomInt(0, attachment_count);
10872 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10873 if (!attachment.IsExplosive())
10874 {
10875 attachment.AddHealth("","",damage);
10876 return true;
10877 }
10878 }
10879 return false;
10880 }
10881
10883 {
10885 }
10886
10888 {
10890 return GetInventory().CanRemoveEntity();
10891
10892 return false;
10893 }
10894
10896 {
10898 return;
10899
10901 {
10902 if (ScriptInputUserData.CanStoreInputUserData())
10903 {
10904 ScriptInputUserData ctx = new ScriptInputUserData;
10909 ctx.
Write(destination_entity);
10911 ctx.
Write(slot_id);
10913 }
10914 }
10915 else if (!
GetGame().IsMultiplayer())
10916 {
10918 }
10919 }
10920
10922 {
10924 return;
10925
10926 float split_quantity_new;
10930 InventoryLocation loc = new InventoryLocation;
10931
10932 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10933 {
10935 split_quantity_new = stack_max;
10936 else
10938
10939 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10940 if (new_item)
10941 {
10942 new_item.SetResultOfSplit(true);
10943 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10945 new_item.SetQuantity(split_quantity_new);
10946 }
10947 }
10948 else if (destination_entity && slot_id == -1)
10949 {
10950 if (quantity > stack_max)
10951 split_quantity_new = stack_max;
10952 else
10953 split_quantity_new = quantity;
10954
10956 {
10959 }
10960
10961 if (new_item)
10962 {
10963 new_item.SetResultOfSplit(true);
10964 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10966 new_item.SetQuantity(split_quantity_new);
10967 }
10968 }
10969 else
10970 {
10971 if (stack_max != 0)
10972 {
10974 {
10976 }
10977
10978 if (split_quantity_new == 0)
10979 {
10980 if (!
GetGame().IsMultiplayer())
10981 player.PhysicalPredictiveDropItem(this);
10982 else
10983 player.ServerDropEntity(this);
10984 return;
10985 }
10986
10988
10989 if (new_item)
10990 {
10991 new_item.SetResultOfSplit(true);
10992 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10994 new_item.SetQuantity(stack_max);
10995 new_item.PlaceOnSurface();
10996 }
10997 }
10998 }
10999 }
11000
11002 {
11004 return;
11005
11006 float split_quantity_new;
11010 InventoryLocation loc = new InventoryLocation;
11011
11012 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11013 {
11015 split_quantity_new = stack_max;
11016 else
11018
11019 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11020 if (new_item)
11021 {
11022 new_item.SetResultOfSplit(true);
11023 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11025 new_item.SetQuantity(split_quantity_new);
11026 }
11027 }
11028 else if (destination_entity && slot_id == -1)
11029 {
11030 if (quantity > stack_max)
11031 split_quantity_new = stack_max;
11032 else
11033 split_quantity_new = quantity;
11034
11036 {
11039 }
11040
11041 if (new_item)
11042 {
11043 new_item.SetResultOfSplit(true);
11044 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11046 new_item.SetQuantity(split_quantity_new);
11047 }
11048 }
11049 else
11050 {
11051 if (stack_max != 0)
11052 {
11054 {
11056 }
11057
11059
11060 if (new_item)
11061 {
11062 new_item.SetResultOfSplit(true);
11063 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11065 new_item.SetQuantity(stack_max);
11066 new_item.PlaceOnSurface();
11067 }
11068 }
11069 }
11070 }
11071
11073 {
11075 return;
11076
11078 {
11079 if (ScriptInputUserData.CanStoreInputUserData())
11080 {
11081 ScriptInputUserData ctx = new ScriptInputUserData;
11086 dst.WriteToContext(ctx);
11088 }
11089 }
11090 else if (!
GetGame().IsMultiplayer())
11091 {
11093 }
11094 }
11095
11097 {
11099 return;
11100
11102 {
11103 if (ScriptInputUserData.CanStoreInputUserData())
11104 {
11105 ScriptInputUserData ctx = new ScriptInputUserData;
11110 ctx.
Write(destination_entity);
11116 }
11117 }
11118 else if (!
GetGame().IsMultiplayer())
11119 {
11121 }
11122 }
11123
11125 {
11127 }
11128
11130 {
11132 return this;
11133
11135 float split_quantity_new;
11137 if (dst.IsValid())
11138 {
11139 int slot_id = dst.GetSlot();
11141
11142 if (quantity > stack_max)
11143 split_quantity_new = stack_max;
11144 else
11145 split_quantity_new = quantity;
11146
11148
11149 if (new_item)
11150 {
11151 new_item.SetResultOfSplit(true);
11152 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11155 }
11156
11157 return new_item;
11158 }
11159
11160 return null;
11161 }
11162
11164 {
11166 return;
11167
11169 float split_quantity_new;
11171 if (destination_entity)
11172 {
11174 if (quantity > stackable)
11175 split_quantity_new = stackable;
11176 else
11177 split_quantity_new = quantity;
11178
11179 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11180 if (new_item)
11181 {
11182 new_item.SetResultOfSplit(true);
11183 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11185 new_item.SetQuantity(split_quantity_new);
11186 }
11187 }
11188 }
11189
11191 {
11193 return;
11194
11196 {
11197 if (ScriptInputUserData.CanStoreInputUserData())
11198 {
11199 ScriptInputUserData ctx = new ScriptInputUserData;
11204 ItemBase destination_entity =
this;
11205 ctx.
Write(destination_entity);
11209 }
11210 }
11211 else if (!
GetGame().IsMultiplayer())
11212 {
11214 }
11215 }
11216
11218 {
11220 return;
11221
11223 float split_quantity_new;
11225 if (player)
11226 {
11228 if (quantity > stackable)
11229 split_quantity_new = stackable;
11230 else
11231 split_quantity_new = quantity;
11232
11233 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11234 new_item =
ItemBase.Cast(in_hands);
11235 if (new_item)
11236 {
11237 new_item.SetResultOfSplit(true);
11238 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11240 new_item.SetQuantity(split_quantity_new);
11241 }
11242 }
11243 }
11244
11246 {
11248 return;
11249
11251 float split_quantity_new = Math.Floor(quantity * 0.5);
11252
11254
11255 if (new_item)
11256 {
11257 if (new_item.GetQuantityMax() < split_quantity_new)
11258 {
11259 split_quantity_new = new_item.GetQuantityMax();
11260 }
11261
11262 new_item.SetResultOfSplit(true);
11263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11264
11266 {
11269 }
11270 else
11271 {
11274 }
11275 }
11276 }
11277
11279 {
11281 return;
11282
11284 float split_quantity_new = Math.Floor(quantity / 2);
11285
11286 InventoryLocation invloc = new InventoryLocation;
11288
11290 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11291
11292 if (new_item)
11293 {
11294 if (new_item.GetQuantityMax() < split_quantity_new)
11295 {
11296 split_quantity_new = new_item.GetQuantityMax();
11297 }
11299 {
11302 }
11303 else
11304 {
11307 }
11308 }
11309 }
11310
11313 {
11314 SetWeightDirty();
11316
11317 if (parent)
11318 parent.OnAttachmentQuantityChangedEx(this, delta);
11319
11321 {
11323 {
11325 }
11327 {
11328 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11330 }
11331 }
11332
11333 }
11334
11337 {
11338
11339 }
11340
11343 {
11345 }
11346
11348 {
11349 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11350
11352 {
11353 if (newLevel == GameConstants.STATE_RUINED)
11354 {
11356 EntityAI parent = GetHierarchyParent();
11357 if (parent && parent.IsFireplace())
11358 {
11359 CargoBase cargo = GetInventory().GetCargo();
11360 if (cargo)
11361 {
11363 {
11365 }
11366 }
11367 }
11368 }
11369
11371 {
11372
11374 return;
11375 }
11376
11377 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11378 {
11380 }
11381 }
11382 }
11383
11384
11386 {
11387 super.OnRightClick();
11388
11390 {
11392 {
11393 if (ScriptInputUserData.CanStoreInputUserData())
11394 {
11395 vector m4[4];
11397
11398 EntityAI root = GetHierarchyRoot();
11399
11400 InventoryLocation dst = new InventoryLocation;
11402 {
11403 if (root)
11404 {
11405 root.GetTransform(m4);
11407 }
11408 else
11409 GetInventory().GetCurrentInventoryLocation(dst);
11410 }
11411 else
11412 {
11414
11415
11416 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11417 {
11418 if (root)
11419 {
11420 root.GetTransform(m4);
11422 }
11423 else
11424 GetInventory().GetCurrentInventoryLocation(dst);
11425 }
11426 else
11427 {
11428 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11429 }
11430 }
11431
11432 ScriptInputUserData ctx = new ScriptInputUserData;
11440 }
11441 }
11442 else if (!
GetGame().IsMultiplayer())
11443 {
11445 }
11446 }
11447 }
11448
11449 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11450 {
11451
11452 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11453 return false;
11454
11455 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11456 return false;
11457
11458
11460 return false;
11461
11462
11463 Magazine mag = Magazine.Cast(this);
11464 if (mag)
11465 {
11466 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11467 return false;
11468
11469 if (stack_max_limit)
11470 {
11471 Magazine other_mag = Magazine.Cast(other_item);
11472 if (other_item)
11473 {
11474 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11475 return false;
11476 }
11477
11478 }
11479 }
11480 else
11481 {
11482
11484 return false;
11485
11487 return false;
11488 }
11489
11490 PlayerBase player = null;
11491 if (CastTo(player, GetHierarchyRootPlayer()))
11492 {
11493 if (player.GetInventory().HasAttachment(this))
11494 return false;
11495
11496 if (player.IsItemsToDelete())
11497 return false;
11498 }
11499
11500 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11501 return false;
11502
11503 int slotID;
11505 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11506 return false;
11507
11508 return true;
11509 }
11510
11512 {
11514 }
11515
11517 {
11518 return m_IsResultOfSplit;
11519 }
11520
11522 {
11523 m_IsResultOfSplit = value;
11524 }
11525
11527 {
11529 }
11530
11532 {
11533 float other_item_quantity = other_item.GetQuantity();
11534 float this_free_space;
11535
11537
11539
11540 if (other_item_quantity > this_free_space)
11541 {
11542 return this_free_space;
11543 }
11544 else
11545 {
11546 return other_item_quantity;
11547 }
11548 }
11549
11551 {
11553 }
11554
11556 {
11558 return;
11559
11560 if (!IsMagazine() && other_item)
11561 {
11563 if (quantity_used != 0)
11564 {
11565 float hp1 = GetHealth01("","");
11566 float hp2 = other_item.GetHealth01("","");
11567 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11568 hpResult = hpResult / (
GetQuantity() + quantity_used);
11569
11570 hpResult *= GetMaxHealth();
11571 Math.Round(hpResult);
11572 SetHealth("", "Health", hpResult);
11573
11575 other_item.AddQuantity(-quantity_used);
11576 }
11577 }
11579 }
11580
11582 {
11583 #ifdef SERVER
11584 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11585 GetHierarchyParent().IncreaseLifetimeUp();
11586 #endif
11587 };
11588
11590 {
11591 PlayerBase p = PlayerBase.Cast(player);
11592
11593 array<int> recipesIds = p.m_Recipes;
11594 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11595 if (moduleRecipesManager)
11596 {
11597 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11598 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11599 }
11600
11601 for (int i = 0;i < recipesIds.Count(); i++)
11602 {
11603 int key = recipesIds.Get(i);
11604 string recipeName = moduleRecipesManager.GetRecipeName(key);
11606 }
11607 }
11608
11609
11610 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11611 {
11612 super.GetDebugActions(outputList);
11613
11614
11619
11620
11624
11628
11629
11632
11633
11635 {
11638 }
11639
11641
11644
11648 }
11649
11650
11651
11652
11654 {
11655 super.OnAction(action_id, player, ctx);
11656 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11657 {
11658 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11659 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11660 PlayerBase p = PlayerBase.Cast(player);
11661 if (
EActions.RECIPES_RANGE_START < 1000)
11662 {
11663 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11664 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11665 }
11666 }
11667 #ifndef SERVER
11668 else if (action_id ==
EActions.WATCH_PLAYER)
11669 {
11670 PluginDeveloper.SetDeveloperItemClientEx(player);
11671 }
11672 #endif
11674 {
11675 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11676 {
11677 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11678 OnDebugButtonPressServer(id + 1);
11679 }
11680
11681 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11682 {
11683 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11685 }
11686
11687 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11688 {
11689 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11691 }
11692
11693 else if (action_id ==
EActions.ADD_QUANTITY)
11694 {
11695 if (IsMagazine())
11696 {
11697 Magazine mag = Magazine.Cast(this);
11698 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11699 }
11700 else
11701 {
11703 }
11704
11705 if (m_EM)
11706 {
11707 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11708 }
11709
11710 }
11711
11712 else if (action_id ==
EActions.REMOVE_QUANTITY)
11713 {
11714 if (IsMagazine())
11715 {
11716 Magazine mag2 = Magazine.Cast(this);
11717 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11718 }
11719 else
11720 {
11722 }
11723 if (m_EM)
11724 {
11725 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11726 }
11727
11728 }
11729
11730 else if (action_id ==
EActions.SET_QUANTITY_0)
11731 {
11733
11734 if (m_EM)
11735 {
11736 m_EM.SetEnergy(0);
11737 }
11738 }
11739
11740 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11741 {
11743
11744 if (m_EM)
11745 {
11746 m_EM.SetEnergy(m_EM.GetEnergyMax());
11747 }
11748 }
11749
11750 else if (action_id ==
EActions.ADD_HEALTH)
11751 {
11752 AddHealth("","",GetMaxHealth("","Health")/5);
11753 }
11754 else if (action_id ==
EActions.REMOVE_HEALTH)
11755 {
11756 AddHealth("","",-GetMaxHealth("","Health")/5);
11757 }
11758 else if (action_id ==
EActions.DESTROY_HEALTH)
11759 {
11760 SetHealth01("","",0);
11761 }
11762 else if (action_id ==
EActions.WATCH_ITEM)
11763 {
11765 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11766 #ifdef DEVELOPER
11767 SetDebugDeveloper_item(this);
11768 #endif
11769 }
11770
11771 else if (action_id ==
EActions.ADD_TEMPERATURE)
11772 {
11773 AddTemperature(20);
11774
11775 }
11776
11777 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11778 {
11779 AddTemperature(-20);
11780
11781 }
11782
11783 else if (action_id ==
EActions.FLIP_FROZEN)
11784 {
11785 SetFrozen(!GetIsFrozen());
11786
11787 }
11788
11789 else if (action_id ==
EActions.ADD_WETNESS)
11790 {
11792
11793 }
11794
11795 else if (action_id ==
EActions.REMOVE_WETNESS)
11796 {
11798
11799 }
11800
11801 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11802 {
11805
11806
11807 }
11808
11809 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11810 {
11813 }
11814
11815 else if (action_id ==
EActions.MAKE_SPECIAL)
11816 {
11817 auto debugParams = DebugSpawnParams.WithPlayer(player);
11818 OnDebugSpawnEx(debugParams);
11819 }
11820
11821 else if (action_id ==
EActions.DELETE)
11822 {
11823 Delete();
11824 }
11825
11826 }
11827
11828
11829 return false;
11830 }
11831
11832
11833
11834
11838
11841
11842
11843
11845 {
11846 return false;
11847 }
11848
11849
11851 {
11852 return true;
11853 }
11854
11855
11857 {
11858 return true;
11859 }
11860
11861
11862
11864 {
11865 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11867 }
11868
11871 {
11872 return null;
11873 }
11874
11876 {
11877 return false;
11878 }
11879
11881 {
11882 return false;
11883 }
11884
11888
11889
11891 {
11892 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11893 return module_repairing.CanRepair(this, item_repair_kit);
11894 }
11895
11896
11897 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11898 {
11899 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11900 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11901 }
11902
11903
11905 {
11906
11907
11908
11909
11910
11911
11912
11913
11914 return 1;
11915 }
11916
11917
11918
11920 {
11922 }
11923
11924
11925
11927 {
11929 }
11930
11931
11940 {
11941 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11942
11943 if (player)
11944 {
11945 player.MessageStatus(text);
11946 }
11947 }
11948
11949
11958 {
11959 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11960
11961 if (player)
11962 {
11963 player.MessageAction(text);
11964 }
11965 }
11966
11967
11976 {
11977 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11978
11979 if (player)
11980 {
11981 player.MessageFriendly(text);
11982 }
11983 }
11984
11985
11994 {
11995 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11996
11997 if (player)
11998 {
11999 player.MessageImportant(text);
12000 }
12001 }
12002
12004 {
12005 return true;
12006 }
12007
12008
12009 override bool KindOf(
string tag)
12010 {
12011 bool found = false;
12012 string item_name = this.
GetType();
12015
12016 int array_size = item_tag_array.Count();
12017 for (int i = 0; i < array_size; i++)
12018 {
12019 if (item_tag_array.Get(i) == tag)
12020 {
12021 found = true;
12022 break;
12023 }
12024 }
12025 return found;
12026 }
12027
12028
12030 {
12031
12032 super.OnRPC(sender, rpc_type,ctx);
12033
12034
12035 switch (rpc_type)
12036 {
12037 #ifndef SERVER
12038 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12039 Param2<bool, string> p = new Param2<bool, string>(false, "");
12040
12042 return;
12043
12044 bool play = p.param1;
12045 string soundSet = p.param2;
12046
12047 if (play)
12048 {
12050 {
12052 {
12054 }
12055 }
12056 else
12057 {
12059 }
12060 }
12061 else
12062 {
12064 }
12065
12066 break;
12067 #endif
12068
12069 }
12070
12072 {
12074 }
12075 }
12076
12077
12078
12079
12081 {
12082 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12083 return plugin.GetID(
name);
12084 }
12085
12087 {
12088 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12089 return plugin.GetName(id);
12090 }
12091
12094 {
12095
12096
12097 int varFlags;
12098 if (!ctx.
Read(varFlags))
12099 return;
12100
12101 if (varFlags & ItemVariableFlags.FLOAT)
12102 {
12104 }
12105 }
12106
12108 {
12109
12110 super.SerializeNumericalVars(floats_out);
12111
12112
12113
12115 {
12117 }
12118
12120 {
12122 }
12123
12125 {
12127 }
12128
12130 {
12135 }
12136
12138 {
12140 }
12141 }
12142
12144 {
12145
12146 super.DeSerializeNumericalVars(floats);
12147
12148
12149 int index = 0;
12150 int mask = Math.Round(floats.Get(index));
12151
12152 index++;
12153
12155 {
12157 {
12159 }
12160 else
12161 {
12162 float quantity = floats.Get(index);
12163 SetQuantity(quantity,
true,
false,
false,
false);
12164 }
12165 index++;
12166 }
12167
12169 {
12170 float wet = floats.Get(index);
12172 index++;
12173 }
12174
12176 {
12177 int liquidtype = Math.Round(floats.Get(index));
12179 index++;
12180 }
12181
12183 {
12185 index++;
12187 index++;
12189 index++;
12191 index++;
12192 }
12193
12195 {
12196 int cleanness = Math.Round(floats.Get(index));
12198 index++;
12199 }
12200 }
12201
12203 {
12204 super.WriteVarsToCTX(ctx);
12205
12206
12208 {
12210 }
12211
12213 {
12215 }
12216
12218 {
12220 }
12221
12223 {
12224 int r,g,b,a;
12230 }
12231
12233 {
12235 }
12236 }
12237
12239 {
12240 if (!super.ReadVarsFromCTX(ctx,version))
12241 return false;
12242
12243 int intValue;
12244 float value;
12245
12246 if (version < 140)
12247 {
12248 if (!ctx.
Read(intValue))
12249 return false;
12250
12251 m_VariablesMask = intValue;
12252 }
12253
12255 {
12256 if (!ctx.
Read(value))
12257 return false;
12258
12260 {
12262 }
12263 else
12264 {
12266 }
12267 }
12268
12269 if (version < 140)
12270 {
12272 {
12273 if (!ctx.
Read(value))
12274 return false;
12275 SetTemperatureDirect(value);
12276 }
12277 }
12278
12280 {
12281 if (!ctx.
Read(value))
12282 return false;
12284 }
12285
12287 {
12288 if (!ctx.
Read(intValue))
12289 return false;
12291 }
12292
12294 {
12295 int r,g,b,a;
12297 return false;
12299 return false;
12301 return false;
12303 return false;
12304
12306 }
12307
12309 {
12310 if (!ctx.
Read(intValue))
12311 return false;
12313 }
12314
12315 if (version >= 138 && version < 140)
12316 {
12318 {
12319 if (!ctx.
Read(intValue))
12320 return false;
12321 SetFrozen(intValue);
12322 }
12323 }
12324
12325 return true;
12326 }
12327
12328
12330 {
12333 {
12335 }
12336
12337 if (!super.OnStoreLoad(ctx, version))
12338 {
12340 return false;
12341 }
12342
12343 if (version >= 114)
12344 {
12345 bool hasQuickBarIndexSaved;
12346
12347 if (!ctx.
Read(hasQuickBarIndexSaved))
12348 {
12350 return false;
12351 }
12352
12353 if (hasQuickBarIndexSaved)
12354 {
12355 int itmQBIndex;
12356
12357
12358 if (!ctx.
Read(itmQBIndex))
12359 {
12361 return false;
12362 }
12363
12364 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12365 if (itmQBIndex != -1 && parentPlayer)
12366 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12367 }
12368 }
12369 else
12370 {
12371
12372 PlayerBase player;
12373 int itemQBIndex;
12374 if (version ==
int.
MAX)
12375 {
12376 if (!ctx.
Read(itemQBIndex))
12377 {
12379 return false;
12380 }
12381 }
12382 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12383 {
12384
12385 if (!ctx.
Read(itemQBIndex))
12386 {
12388 return false;
12389 }
12390 if (itemQBIndex != -1 && player)
12391 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12392 }
12393 }
12394
12395 if (version < 140)
12396 {
12397
12398 if (!LoadVariables(ctx, version))
12399 {
12401 return false;
12402 }
12403 }
12404
12405
12407 {
12409 return false;
12410 }
12411 if (version >= 132)
12412 {
12414 if (raib)
12415 {
12417 {
12419 return false;
12420 }
12421 }
12422 }
12423
12425 return true;
12426 }
12427
12428
12429
12431 {
12432 super.OnStoreSave(ctx);
12433
12434 PlayerBase player;
12435 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12436 {
12438
12439 int itemQBIndex = -1;
12440 itemQBIndex = player.FindQuickBarEntityIndex(this);
12441 ctx.
Write(itemQBIndex);
12442 }
12443 else
12444 {
12446 }
12447
12449
12451 if (raib)
12452 {
12454 }
12455 }
12456
12457
12459 {
12460 super.AfterStoreLoad();
12461
12463 {
12465 }
12466
12468 {
12471 }
12472 }
12473
12475 {
12476 super.EEOnAfterLoad();
12477
12479 {
12481 }
12482
12485 }
12486
12488 {
12489 return false;
12490 }
12491
12492
12493
12495 {
12497 {
12498 #ifdef PLATFORM_CONSOLE
12499
12501 {
12503 if (menu)
12504 {
12506 }
12507 }
12508 #endif
12509 }
12510
12512 {
12515 }
12516
12518 {
12519 SetWeightDirty();
12521 }
12523 {
12526 }
12527
12529 {
12532 }
12534 {
12537 }
12538
12539 super.OnVariablesSynchronized();
12540 }
12541
12542
12543
12545 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12546 {
12547 if (!IsServerCheck(allow_client))
12548 return false;
12549
12551 return false;
12552
12555
12556 if (value <= (min + 0.001))
12557 value = min;
12558
12559 if (value == min)
12560 {
12561 if (destroy_config)
12562 {
12563 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12564 if (dstr)
12565 {
12567 this.Delete();
12568 return true;
12569 }
12570 }
12571 else if (destroy_forced)
12572 {
12574 this.Delete();
12575 return true;
12576 }
12577
12579 }
12580
12583
12585 {
12587
12588 if (delta)
12590 }
12591
12593
12594 return false;
12595 }
12596
12597
12599 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12600 {
12602 }
12603
12605 {
12608 }
12609
12611 {
12614 }
12615
12618 {
12619 float value_clamped = Math.Clamp(value, 0, 1);
12621 SetQuantity(result, destroy_config, destroy_forced);
12622 }
12623
12624
12627 {
12629 }
12630
12632 {
12634 }
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12646 {
12647 int slot = -1;
12648 if (GetInventory())
12649 {
12650 InventoryLocation il = new InventoryLocation;
12651 GetInventory().GetCurrentInventoryLocation(il);
12653 }
12654
12656 }
12657
12659 {
12660 float quantity_max = 0;
12661
12663 {
12664 if (attSlotID != -1)
12665 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12666
12667 if (quantity_max <= 0)
12669 }
12670
12671 if (quantity_max <= 0)
12673
12674 return quantity_max;
12675 }
12676
12678 {
12680 }
12681
12683 {
12685 }
12686
12687
12689 {
12691 }
12692
12694 {
12696 }
12697
12699 {
12701 }
12702
12703
12705 {
12706
12707 float weightEx = GetWeightEx();
12708 float special = GetInventoryAndCargoWeight();
12709 return weightEx - special;
12710 }
12711
12712
12714 {
12716 }
12717
12719 {
12721 {
12722 #ifdef DEVELOPER
12723 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12724 {
12725 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12727 }
12728 #endif
12729
12730 return GetQuantity() * GetConfigWeightModified();
12731 }
12732 else if (HasEnergyManager())
12733 {
12734 #ifdef DEVELOPER
12735 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12736 {
12737 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12738 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12739 }
12740 #endif
12741 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12742 }
12743 else
12744 {
12745 #ifdef DEVELOPER
12746 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12747 {
12748 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12749 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12750 }
12751 #endif
12752 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12753 }
12754 }
12755
12758 {
12759 int item_count = 0;
12761
12762 if (GetInventory().GetCargo() != NULL)
12763 {
12764 item_count = GetInventory().GetCargo().GetItemCount();
12765 }
12766
12767 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12768 {
12769 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12770 if (item)
12771 item_count += item.GetNumberOfItems();
12772 }
12773 return item_count;
12774 }
12775
12778 {
12779 float weight = 0;
12780 float wetness = 1;
12781 if (include_wetness)
12784 {
12785 weight = wetness * m_ConfigWeight;
12786 }
12788 {
12789 weight = 1;
12790 }
12791 return weight;
12792 }
12793
12794
12795
12797 {
12798 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12799 {
12800 GameInventory inv = GetInventory();
12801 array<EntityAI> items = new array<EntityAI>;
12803 for (int i = 0; i < items.Count(); i++)
12804 {
12806 if (item)
12807 {
12809 }
12810 }
12811 }
12812 }
12813
12814
12815
12816
12818 {
12819 float energy = 0;
12820 if (HasEnergyManager())
12821 {
12822 energy = GetCompEM().GetEnergy();
12823 }
12824 return energy;
12825 }
12826
12827
12829 {
12830 super.OnEnergyConsumed();
12831
12833 }
12834
12836 {
12837 super.OnEnergyAdded();
12838
12840 }
12841
12842
12844 {
12845 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12846 {
12848 {
12849 float energy_0to1 = GetCompEM().GetEnergy0To1();
12851 }
12852 }
12853 }
12854
12855
12857 {
12858 return ConfigGetFloat("heatIsolation");
12859 }
12860
12862 {
12864 }
12865
12867 {
12868 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12869 if (
GetGame().ConfigIsExisting(paramPath))
12871
12872 return 0.0;
12873 }
12874
12876 {
12877 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12878 if (
GetGame().ConfigIsExisting(paramPath))
12880
12881 return 0.0;
12882 }
12883
12884 override void SetWet(
float value,
bool allow_client =
false)
12885 {
12886 if (!IsServerCheck(allow_client))
12887 return;
12888
12891
12893
12894 m_VarWet = Math.Clamp(value, min, max);
12895
12897 {
12900 }
12901 }
12902
12903 override void AddWet(
float value)
12904 {
12906 }
12907
12909 {
12911 }
12912
12914 {
12916 }
12917
12919 {
12921 }
12922
12924 {
12926 }
12927
12929 {
12931 }
12932
12933 override void OnWetChanged(
float newVal,
float oldVal)
12934 {
12937 if (newLevel != oldLevel)
12938 {
12940 }
12941 }
12942
12944 {
12945 SetWeightDirty();
12946 }
12947
12949 {
12950 return GetWetLevelInternal(
m_VarWet);
12951 }
12952
12953
12954
12956 {
12958 }
12959
12961 {
12963 }
12964
12966 {
12968 }
12969
12971 {
12973 }
12974
12975
12976
12978 {
12979 if (ConfigIsExisting("itemModelLength"))
12980 {
12981 return ConfigGetFloat("itemModelLength");
12982 }
12983 return 0;
12984 }
12985
12987 {
12988 if (ConfigIsExisting("itemAttachOffset"))
12989 {
12990 return ConfigGetFloat("itemAttachOffset");
12991 }
12992 return 0;
12993 }
12994
12995 override void SetCleanness(
int value,
bool allow_client =
false)
12996 {
12997 if (!IsServerCheck(allow_client))
12998 return;
12999
13001
13003
13006 }
13007
13009 {
13011 }
13012
13014 {
13015 return true;
13016 }
13017
13018
13019
13020
13022 {
13024 }
13025
13027 {
13029 }
13030
13031
13032
13033
13034 override void SetColor(
int r,
int g,
int b,
int a)
13035 {
13041 }
13043 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13044 {
13049 }
13050
13052 {
13054 }
13055
13058 {
13059 int r,g,b,a;
13061 r = r/255;
13062 g = g/255;
13063 b = b/255;
13064 a = a/255;
13065 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13066 }
13067
13068
13069
13070 override void SetLiquidType(
int value,
bool allow_client =
false)
13071 {
13072 if (!IsServerCheck(allow_client))
13073 return;
13074
13079 }
13080
13082 {
13083 return ConfigGetInt("varLiquidTypeInit");
13084 }
13085
13087 {
13089 }
13090
13092 {
13094 SetFrozen(false);
13095 }
13096
13099 {
13100 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13101 }
13102
13103
13106 {
13107 PlayerBase nplayer;
13108 if (PlayerBase.CastTo(nplayer, player))
13109 {
13111
13112 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13113 }
13114 }
13115
13116
13119 {
13120 PlayerBase nplayer;
13121 if (PlayerBase.CastTo(nplayer,player))
13122 {
13123
13124 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13125
13126 }
13127
13128
13129 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13130
13131
13132 if (HasEnergyManager())
13133 {
13134 GetCompEM().UpdatePlugState();
13135 }
13136 }
13137
13138
13140 {
13141 super.OnPlacementStarted(player);
13142
13144 }
13145
13146 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13147 {
13149 {
13150 m_AdminLog.OnPlacementComplete(player,
this);
13151 }
13152
13153 super.OnPlacementComplete(player, position, orientation);
13154 }
13155
13156
13157
13158
13159
13161 {
13163 {
13164 return true;
13165 }
13166 else
13167 {
13168 return false;
13169 }
13170 }
13171
13172
13174 {
13176 {
13178 }
13179 }
13180
13181
13183 {
13185 }
13186
13188 {
13190 }
13191
13192 override void InsertAgent(
int agent,
float count = 1)
13193 {
13194 if (count < 1)
13195 return;
13196
13198 }
13199
13202 {
13204 }
13205
13206
13208 {
13210 }
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13254 {
13256 return false;
13257 return true;
13258 }
13259
13261 {
13262
13264 }
13265
13266
13269 {
13270 super.CheckForRoofLimited(timeTresholdMS);
13271
13273 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13274 {
13275 m_PreviousRoofTestTime = time;
13276 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13277 }
13278 }
13279
13280
13282 {
13284 {
13285 return 0;
13286 }
13287
13288 if (GetInventory().GetAttachmentSlotsCount() != 0)
13289 {
13290 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13291 if (filter)
13292 return filter.GetProtectionLevel(type, false, system);
13293 else
13294 return 0;
13295 }
13296
13297 string subclassPath, entryName;
13298
13299 switch (type)
13300 {
13302 entryName = "biological";
13303 break;
13305 entryName = "chemical";
13306 break;
13307 default:
13308 entryName = "biological";
13309 break;
13310 }
13311
13312 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13313
13315 }
13316
13317
13318
13321 {
13322 if (!IsMagazine())
13324
13326 }
13327
13328
13329
13330
13331
13336 {
13337 return true;
13338 }
13339
13341 {
13343 }
13344
13345
13346
13347
13348
13350 {
13351 if (parent)
13352 {
13353 if (parent.IsInherited(DayZInfected))
13354 return true;
13355
13356 if (!parent.IsRuined())
13357 return true;
13358 }
13359
13360 return true;
13361 }
13362
13364 {
13365 if (!super.CanPutAsAttachment(parent))
13366 {
13367 return false;
13368 }
13369
13370 if (!IsRuined() && !parent.IsRuined())
13371 {
13372 return true;
13373 }
13374
13375 return false;
13376 }
13377
13379 {
13380
13381
13382
13383
13384 return super.CanReceiveItemIntoCargo(item);
13385 }
13386
13388 {
13389
13390
13391
13392
13393 GameInventory attachmentInv = attachment.GetInventory();
13395 {
13396 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13397 return false;
13398 }
13399
13400 InventoryLocation loc = new InventoryLocation();
13401 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13402 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13403 return false;
13404
13405 return super.CanReceiveAttachment(attachment, slotId);
13406 }
13407
13409 {
13410 if (!super.CanReleaseAttachment(attachment))
13411 return false;
13412
13413 return GetInventory().AreChildrenAccessible();
13414 }
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13437 {
13438 int id = muzzle_owner.GetMuzzleID();
13439 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13440
13441 if (WPOF_array)
13442 {
13443 for (int i = 0; i < WPOF_array.Count(); i++)
13444 {
13445 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13446
13447 if (WPOF)
13448 {
13449 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13450 }
13451 }
13452 }
13453 }
13454
13455
13457 {
13458 int id = muzzle_owner.GetMuzzleID();
13460
13461 if (WPOBE_array)
13462 {
13463 for (int i = 0; i < WPOBE_array.Count(); i++)
13464 {
13465 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13466
13467 if (WPOBE)
13468 {
13469 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13470 }
13471 }
13472 }
13473 }
13474
13475
13477 {
13478 int id = muzzle_owner.GetMuzzleID();
13479 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13480
13481 if (WPOOH_array)
13482 {
13483 for (int i = 0; i < WPOOH_array.Count(); i++)
13484 {
13485 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13486
13487 if (WPOOH)
13488 {
13489 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13490 }
13491 }
13492 }
13493 }
13494
13495
13497 {
13498 int id = muzzle_owner.GetMuzzleID();
13499 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13500
13501 if (WPOOH_array)
13502 {
13503 for (int i = 0; i < WPOOH_array.Count(); i++)
13504 {
13505 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13506
13507 if (WPOOH)
13508 {
13509 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13510 }
13511 }
13512 }
13513 }
13514
13515
13517 {
13518 int id = muzzle_owner.GetMuzzleID();
13519 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13520
13521 if (WPOOH_array)
13522 {
13523 for (int i = 0; i < WPOOH_array.Count(); i++)
13524 {
13525 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13526
13527 if (WPOOH)
13528 {
13529 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13530 }
13531 }
13532 }
13533 }
13534
13535
13536
13538 {
13540 {
13541 return true;
13542 }
13543
13544 return false;
13545 }
13546
13548 {
13550 {
13551 return true;
13552 }
13553
13554 return false;
13555 }
13556
13558 {
13560 {
13561 return true;
13562 }
13563
13564 return false;
13565 }
13566
13568 {
13569 return false;
13570 }
13571
13574 {
13575 return UATimeSpent.DEFAULT_DEPLOY;
13576 }
13577
13578
13579
13580
13582 {
13584 SetSynchDirty();
13585 }
13586
13588 {
13590 }
13591
13592
13594 {
13595 return false;
13596 }
13597
13600 {
13601 string att_type = "None";
13602
13603 if (ConfigIsExisting("soundAttType"))
13604 {
13605 att_type = ConfigGetString("soundAttType");
13606 }
13607
13609 }
13610
13612 {
13614 }
13615
13616
13617
13618
13619
13623
13625 {
13628
13630 }
13631
13632
13634 {
13636 return;
13637
13639
13642
13645
13646 SoundParameters params = new SoundParameters();
13650 }
13651
13652
13654 {
13656 return;
13657
13659 SetSynchDirty();
13660
13663 }
13664
13665
13667 {
13669 return;
13670
13672 SetSynchDirty();
13673
13676 }
13677
13679 {
13681 }
13682
13684 {
13686 }
13687
13690 {
13691 if (!
GetGame().IsDedicatedServer())
13692 {
13693 if (ConfigIsExisting("attachSoundSet"))
13694 {
13695 string cfg_path = "";
13696 string soundset = "";
13697 string type_name =
GetType();
13698
13701 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13702 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13703
13704 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13705 {
13706 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13707 {
13708 if (cfg_slot_array[i] == slot_type)
13709 {
13710 soundset = cfg_soundset_array[i];
13711 break;
13712 }
13713 }
13714 }
13715
13716 if (soundset != "")
13717 {
13718 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13720 }
13721 }
13722 }
13723 }
13724
13726 {
13727
13728 }
13729
13730 void OnApply(PlayerBase player);
13731
13733 {
13734 return 1.0;
13735 };
13736
13738 {
13740 }
13741
13743 {
13745 }
13746
13748
13750 {
13751 SetDynamicPhysicsLifeTime(0.01);
13753 }
13754
13756 {
13757 array<string> zone_names = new array<string>;
13758 GetDamageZones(zone_names);
13759 for (int i = 0; i < zone_names.Count(); i++)
13760 {
13761 SetHealthMax(zone_names.Get(i),"Health");
13762 }
13763 SetHealthMax("","Health");
13764 }
13765
13768 {
13769 float global_health = GetHealth01("","Health");
13770 array<string> zones = new array<string>;
13771 GetDamageZones(zones);
13772
13773 for (int i = 0; i < zones.Count(); i++)
13774 {
13775 SetHealth01(zones.Get(i),"Health",global_health);
13776 }
13777 }
13778
13781 {
13782 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13783 }
13784
13786 {
13787 if (!hasRootAsPlayer)
13788 {
13789 if (refParentIB)
13790 {
13791
13792 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13793 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13794
13795 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13796 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13797
13800 }
13801 else
13802 {
13803
13806 }
13807 }
13808 }
13809
13811 {
13813 {
13814 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13815 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13816 {
13817 float heatPermCoef = 1.0;
13819 while (ent)
13820 {
13821 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13822 ent = ent.GetHierarchyParent();
13823 }
13824
13825 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13826 }
13827 }
13828 }
13829
13831 {
13832
13833 EntityAI parent = GetHierarchyParent();
13834 if (!parent)
13835 {
13836 hasParent = false;
13837 hasRootAsPlayer = false;
13838 }
13839 else
13840 {
13841 hasParent = true;
13842 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13843 refParentIB =
ItemBase.Cast(parent);
13844 }
13845 }
13846
13847 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13848 {
13849
13850 }
13851
13853 {
13854
13855 return false;
13856 }
13857
13859 {
13860
13861
13862 return false;
13863 }
13864
13866 {
13867
13868 return false;
13869 }
13870
13873 {
13874 return !GetIsFrozen() &&
IsOpen();
13875 }
13876
13878 {
13879 bool hasParent = false, hasRootAsPlayer = false;
13881
13882 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13883 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13884
13885 if (wwtu || foodDecay)
13886 {
13890
13891 if (processWetness || processTemperature || processDecay)
13892 {
13894
13895 if (processWetness)
13896 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13897
13898 if (processTemperature)
13900
13901 if (processDecay)
13902 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13903 }
13904 }
13905 }
13906
13909 {
13911 }
13912
13914 {
13917
13918 return super.GetTemperatureFreezeThreshold();
13919 }
13920
13922 {
13925
13926 return super.GetTemperatureThawThreshold();
13927 }
13928
13930 {
13933
13934 return super.GetItemOverheatThreshold();
13935 }
13936
13938 {
13940 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13941
13942 return super.GetTemperatureFreezeTime();
13943 }
13944
13946 {
13948 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13949
13950 return super.GetTemperatureThawTime();
13951 }
13952
13957
13959 {
13960 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13961 }
13962
13964 {
13965 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13966 }
13967
13970 {
13972 }
13973
13975 {
13977 }
13978
13980 {
13982 }
13983
13986 {
13987 return null;
13988 }
13989
13992 {
13993 return false;
13994 }
13995
13997 {
13999 {
14002 if (!trg)
14003 {
14005 explosive = this;
14006 }
14007
14008 explosive.PairRemote(trg);
14010
14011 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14012 trg.SetPersistentPairID(persistentID);
14013 explosive.SetPersistentPairID(persistentID);
14014
14015 return true;
14016 }
14017 return false;
14018 }
14019
14022 {
14023 float ret = 1.0;
14026 ret *= GetHealth01();
14027
14028 return ret;
14029 }
14030
14031 #ifdef DEVELOPER
14032 override void SetDebugItem()
14033 {
14034 super.SetDebugItem();
14035 _itemBase = this;
14036 }
14037
14039 {
14040 string text = super.GetDebugText();
14041
14043 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14044
14045 return text;
14046 }
14047 #endif
14048
14050 {
14051 return true;
14052 }
14053
14055
14057
14059 {
14062 }
14063
14064
14072
14088}
14089
14091{
14093 if (entity)
14094 {
14095 bool is_item = entity.IsInherited(
ItemBase);
14096 if (is_item && full_quantity)
14097 {
14100 }
14101 }
14102 else
14103 {
14105 return NULL;
14106 }
14107 return entity;
14108}
14109
14111{
14112 if (item)
14113 {
14114 if (health > 0)
14115 item.SetHealth("", "", health);
14116
14117 if (item.CanHaveTemperature())
14118 {
14120 if (item.CanFreeze())
14121 item.SetFrozen(false);
14122 }
14123
14124 if (item.HasEnergyManager())
14125 {
14126 if (quantity >= 0)
14127 {
14128 item.GetCompEM().SetEnergy0To1(quantity);
14129 }
14130 else
14131 {
14133 }
14134 }
14135 else if (item.IsMagazine())
14136 {
14137 Magazine mag = Magazine.Cast(item);
14138 if (quantity >= 0)
14139 {
14140 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14141 }
14142 else
14143 {
14145 }
14146
14147 }
14148 else
14149 {
14150 if (quantity >= 0)
14151 {
14152 item.SetQuantityNormalized(quantity, false);
14153 }
14154 else
14155 {
14157 }
14158
14159 }
14160 }
14161}
14162
14163#ifdef DEVELOPER
14165#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.