9287{
9289 {
9290 return true;
9291 }
9292};
9293
9294
9295
9297{
9301
9303
9306
9307
9308
9309
9310
9319
9325
9330
9335
9356 protected bool m_IsResultOfSplit
9357
9359
9364
9365
9366
9368
9372
9373
9374
9376
9379
9380
9381
9387
9388
9396
9399
9400
9402
9403
9405
9406
9411
9412
9417
9418
9420
9421
9423 {
9428
9429 if (!
GetGame().IsDedicatedServer())
9430 {
9432 {
9434
9436 {
9438 }
9439 }
9440
9443 }
9444
9445 m_OldLocation = null;
9446
9448 {
9450 }
9451
9452 if (ConfigIsExisting("headSelectionsToHide"))
9453 {
9456 }
9457
9459 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9460 {
9462 }
9463
9465
9466 m_IsResultOfSplit = false;
9467
9469 }
9470
9472 {
9473 super.InitItemVariables();
9474
9480 m_Count = ConfigGetInt(
"count");
9481
9484
9489
9492
9497
9509
9513
9514
9517 if (ConfigIsExisting("canBeSplit"))
9518 {
9521 }
9522
9524 if (ConfigIsExisting("itemBehaviour"))
9526
9527
9530 RegisterNetSyncVariableInt("m_VarLiquidType");
9531 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9532
9533 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9534 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9535 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9536
9537 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9538 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9539 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9540 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9541
9542 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9543 RegisterNetSyncVariableBool("m_IsTakeable");
9544 RegisterNetSyncVariableBool("m_IsHologram");
9545
9548 {
9551 }
9552
9554
9556 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9558
9559 }
9560
9562 {
9564 }
9565
9567 {
9570 {
9575 }
9576 }
9577
9578 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9579 {
9581 {
9584 }
9585
9587 }
9588
9590 {
9596 }
9597
9599
9601 {
9603
9604 if (!action)
9605 {
9606 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9607 return;
9608 }
9609
9611 if (!ai)
9612 {
9614 return;
9615 }
9616
9618 if (!action_array)
9619 {
9620 action_array = new array<ActionBase_Basic>;
9622 }
9623 if (LogManager.IsActionLogEnable())
9624 {
9625 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9626 }
9627
9628 if (action_array.Find(action) != -1)
9629 {
9630 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9631 }
9632 else
9633 {
9634 action_array.Insert(action);
9635 }
9636 }
9637
9639 {
9641 ActionBase action = player.GetActionManager().GetAction(actionName);
9644
9645 if (action_array)
9646 {
9647 action_array.RemoveItem(action);
9648 }
9649 }
9650
9651
9652
9654 {
9655 ActionOverrideData overrideData = new ActionOverrideData();
9659
9661 if (!actionMap)
9662 {
9665 }
9666
9667 actionMap.Insert(this.
Type(), overrideData);
9668
9669 }
9670
9672
9674
9675
9677 {
9680
9683
9684 string config_to_search = "CfgVehicles";
9685 string muzzle_owner_config;
9686
9688 {
9689 if (IsInherited(Weapon))
9690 config_to_search = "CfgWeapons";
9691
9692 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9693
9694 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9695
9697
9698 if (config_OnFire_subclass_count > 0)
9699 {
9700 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9701
9702 for (int i = 0; i < config_OnFire_subclass_count; i++)
9703 {
9704 string particle_class = "";
9706 string config_OnFire_entry = config_OnFire_class + particle_class;
9707 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9708 WPOF_array.Insert(WPOF);
9709 }
9710
9711
9713 }
9714 }
9715
9717 {
9718 config_to_search = "CfgWeapons";
9719 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9720
9721 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9722
9724
9725 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9726 {
9727 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9728
9729 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9730 {
9731 string particle_class2 = "";
9733 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9734 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9735 WPOBE_array.Insert(WPOBE);
9736 }
9737
9738
9740 }
9741 }
9742 }
9743
9744
9746 {
9749
9751 {
9752 string config_to_search = "CfgVehicles";
9753
9754 if (IsInherited(Weapon))
9755 config_to_search = "CfgWeapons";
9756
9757 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9758 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9759
9760 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9761 {
9762
9764
9766 {
9768 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9770 return;
9771 }
9772
9775
9776
9777
9779 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9780
9781 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9782 {
9783 string particle_class = "";
9785 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9787
9788 if (entry_type == CT_CLASS)
9789 {
9790 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9791 WPOOH_array.Insert(WPOF);
9792 }
9793 }
9794
9795
9797 }
9798 }
9799 }
9800
9802 {
9804 }
9805
9807 {
9809 {
9811
9814
9817
9818 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9819 }
9820 }
9821
9823 {
9825 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9826
9828 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9829
9831 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9832
9834 {
9836 }
9837 }
9838
9840 {
9842 }
9843
9845 {
9848 else
9850
9852 {
9855 }
9856 else
9857 {
9860
9863 }
9864
9866 }
9867
9869 {
9871 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9872 }
9873
9875 {
9877 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9879 }
9880
9882 {
9884 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9885 }
9886
9888 {
9891
9892 OverheatingParticle OP = new OverheatingParticle();
9897
9899 }
9900
9902 {
9905
9906 return -1;
9907 }
9908
9910 {
9912 {
9915
9916 for (int i = count; i > 0; --i)
9917 {
9918 int id = i - 1;
9921
9924
9925 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9926 {
9927 if (p)
9928 {
9931 }
9932 }
9933 }
9934 }
9935 }
9936
9938 {
9940 {
9942 {
9943 int id = i - 1;
9945
9946 if (OP)
9947 {
9949
9950 if (p)
9951 {
9953 }
9954
9955 delete OP;
9956 }
9957 }
9958
9961 }
9962 }
9963
9966 {
9967 return 0.0;
9968 }
9969
9970
9972 {
9973 return 250;
9974 }
9975
9977 {
9978 return 0;
9979 }
9980
9983 {
9985 return true;
9986
9987 return false;
9988 }
9989
9992 {
9995
9997 {
9999 }
10000 else
10001 {
10002
10004 }
10005
10007 }
10008
10015 {
10016 return -1;
10017 }
10018
10019
10020
10021
10023 {
10025 {
10027 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10028
10029 if (r_index >= 0)
10030 {
10031 InventoryLocation r_il = new InventoryLocation;
10032 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10033
10034 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10037 {
10038 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10039 }
10041 {
10042 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10043 }
10044
10045 }
10046
10047 player.GetHumanInventory().ClearUserReservedLocation(this);
10048 }
10049
10052 }
10053
10054
10055
10056
10058 {
10059 return ItemBase.m_DebugActionsMask;
10060 }
10061
10063 {
10064 return ItemBase.m_DebugActionsMask & mask;
10065 }
10066
10068 {
10069 ItemBase.m_DebugActionsMask = mask;
10070 }
10071
10073 {
10074 ItemBase.m_DebugActionsMask |= mask;
10075 }
10076
10078 {
10079 ItemBase.m_DebugActionsMask &= ~mask;
10080 }
10081
10083 {
10085 {
10087 }
10088 else
10089 {
10091 }
10092 }
10093
10094
10096 {
10097 if (GetEconomyProfile())
10098 {
10099 float q_max = GetEconomyProfile().GetQuantityMax();
10100 if (q_max > 0)
10101 {
10102 float q_min = GetEconomyProfile().GetQuantityMin();
10103 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10104
10106 {
10107 ComponentEnergyManager comp = GetCompEM();
10109 {
10111 }
10112 }
10114 {
10116
10117 }
10118
10119 }
10120 }
10121 }
10122
10125 {
10126 EntityAI parent = GetHierarchyParent();
10127
10128 if (parent)
10129 {
10130 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10131 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10132 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10133 }
10134 }
10135
10138 {
10139 EntityAI parent = GetHierarchyParent();
10140
10141 if (parent)
10142 {
10143 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10144 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10145 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10146 }
10147 }
10148
10150 {
10151
10152
10153
10154
10156
10158 {
10159 if (ScriptInputUserData.CanStoreInputUserData())
10160 {
10161 ScriptInputUserData ctx = new ScriptInputUserData;
10167 ctx.
Write(use_stack_max);
10170
10172 {
10173 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10174 }
10175 }
10176 }
10177 else if (!
GetGame().IsMultiplayer())
10178 {
10180 }
10181 }
10182
10184 {
10186 }
10187
10189 {
10191 }
10192
10194 {
10196 }
10197
10199 {
10200
10201 return false;
10202 }
10203
10205 {
10206 return false;
10207 }
10208
10212 {
10213 return false;
10214 }
10215
10217 {
10218 return "";
10219 }
10220
10222
10224 {
10225 return false;
10226 }
10227
10229 {
10230 return true;
10231 }
10232
10233
10234
10236 {
10237 return true;
10238 }
10239
10241 {
10242 return true;
10243 }
10244
10246 {
10247 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10249 }
10250
10252 {
10254 }
10255
10257 {
10259 if (!is_being_placed)
10261 SetSynchDirty();
10262 }
10263
10264
10266
10268 {
10270 }
10271
10273 {
10275 }
10276
10278 {
10279 return 1;
10280 }
10281
10283 {
10284 return false;
10285 }
10286
10288 {
10290 SetSynchDirty();
10291 }
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10328 {
10329 super.OnMovedInsideCargo(container);
10330
10331 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10332 }
10333
10334 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10335 {
10336 super.EEItemLocationChanged(oldLoc,newLoc);
10337
10338 PlayerBase new_player = null;
10339 PlayerBase old_player = null;
10340
10341 if (newLoc.GetParent())
10342 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10343
10344 if (oldLoc.GetParent())
10345 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10346
10348 {
10349 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10350
10351 if (r_index >= 0)
10352 {
10353 InventoryLocation r_il = new InventoryLocation;
10354 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10355
10356 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10359 {
10360 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10361 }
10363 {
10364 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10365 }
10366
10367 }
10368 }
10369
10371 {
10372 if (new_player)
10373 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10374
10375 if (new_player == old_player)
10376 {
10377
10378 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10379 {
10381 {
10382 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10383 {
10384 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10385 }
10386 }
10387 else
10388 {
10389 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10390 }
10391 }
10392
10393 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10394 {
10395 int type = oldLoc.GetType();
10397 {
10398 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10399 }
10401 {
10402 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10403 }
10404 }
10405 if (!m_OldLocation)
10406 {
10407 m_OldLocation = new InventoryLocation;
10408 }
10409 m_OldLocation.Copy(oldLoc);
10410 }
10411 else
10412 {
10413 if (m_OldLocation)
10414 {
10415 m_OldLocation.Reset();
10416 }
10417 }
10418
10420 }
10421 else
10422 {
10423 if (new_player)
10424 {
10425 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10426 if (res_index >= 0)
10427 {
10428 InventoryLocation il = new InventoryLocation;
10429 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10431 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10434 {
10435 il.
GetParent().GetOnReleaseLock().Invoke(it);
10436 }
10438 {
10440 }
10441
10442 }
10443 }
10445 {
10446
10448 }
10449
10450 if (m_OldLocation)
10451 {
10452 m_OldLocation.Reset();
10453 }
10454 }
10455 }
10456
10457 override void EOnContact(IEntity other, Contact extra)
10458 {
10460 {
10461 int liquidType = -1;
10463 if (impactSpeed > 0.0)
10464 {
10466 #ifndef SERVER
10468 #else
10470 SetSynchDirty();
10471 #endif
10473 }
10474 }
10475
10476 #ifdef SERVER
10477 if (GetCompEM() && GetCompEM().IsPlugged())
10478 {
10479 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10480 GetCompEM().UnplugThis();
10481 }
10482 #endif
10483 }
10484
10486
10488 {
10490 }
10491
10493 {
10494
10495 }
10496
10498 {
10499 super.OnItemLocationChanged(old_owner, new_owner);
10500
10501 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10502 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10503
10504 if (!relatedPlayer && playerNew)
10505 relatedPlayer = playerNew;
10506
10507 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10508 {
10510 if (actionMgr)
10511 {
10512 ActionBase currentAction = actionMgr.GetRunningAction();
10513 if (currentAction)
10515 }
10516 }
10517
10518 Man ownerPlayerOld = null;
10519 Man ownerPlayerNew = null;
10520
10521 if (old_owner)
10522 {
10523 if (old_owner.
IsMan())
10524 {
10525 ownerPlayerOld = Man.Cast(old_owner);
10526 }
10527 else
10528 {
10529 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10530 }
10531 }
10532 else
10533 {
10535 {
10537
10538 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10539 {
10540 GetCompEM().UnplugThis();
10541 }
10542 }
10543 }
10544
10545 if (new_owner)
10546 {
10547 if (new_owner.
IsMan())
10548 {
10549 ownerPlayerNew = Man.Cast(new_owner);
10550 }
10551 else
10552 {
10553 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10554 }
10555 }
10556
10557 if (ownerPlayerOld != ownerPlayerNew)
10558 {
10559 if (ownerPlayerOld)
10560 {
10561 array<EntityAI> subItemsExit = new array<EntityAI>;
10563 for (int i = 0; i < subItemsExit.Count(); i++)
10564 {
10567 }
10568 }
10569
10570 if (ownerPlayerNew)
10571 {
10572 array<EntityAI> subItemsEnter = new array<EntityAI>;
10574 for (int j = 0; j < subItemsEnter.Count(); j++)
10575 {
10578 }
10579 }
10580 }
10581 else if (ownerPlayerNew != null)
10582 {
10583 PlayerBase nplayer;
10584 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10585 {
10586 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10588 for (int k = 0; k < subItemsUpdate.Count(); k++)
10589 {
10591 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10592 }
10593 }
10594 }
10595
10596 if (old_owner)
10597 old_owner.OnChildItemRemoved(this);
10598 if (new_owner)
10599 new_owner.OnChildItemReceived(this);
10600 }
10601
10602
10604 {
10605 super.EEDelete(parent);
10606 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10607 if (player)
10608 {
10610
10611 if (player.IsAlive())
10612 {
10613 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10614 if (r_index >= 0)
10615 {
10616 InventoryLocation r_il = new InventoryLocation;
10617 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10618
10619 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10622 {
10623 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10624 }
10626 {
10627 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10628 }
10629
10630 }
10631
10632 player.RemoveQuickBarEntityShortcut(this);
10633 }
10634 }
10635 }
10636
10638 {
10639 super.EEKilled(killer);
10640
10643 {
10644 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10645 {
10646 if (IsMagazine())
10647 {
10648 if (Magazine.Cast(this).GetAmmoCount() > 0)
10649 {
10651 }
10652 }
10653 else
10654 {
10656 }
10657 }
10658 }
10659 }
10660
10662 {
10663 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10664
10665 super.OnWasAttached(parent, slot_id);
10666
10669
10671 }
10672
10674 {
10675 super.OnWasDetached(parent, slot_id);
10676
10679 }
10680
10682 {
10683 int idx;
10686
10687 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10688 if (inventory_slots.Count() < 1)
10689 {
10690 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10691 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10692 }
10693 else
10694 {
10695 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10696 }
10697
10698 idx = inventory_slots.Find(slot);
10699 if (idx < 0)
10700 return "";
10701
10702 return attach_types.Get(idx);
10703 }
10704
10706 {
10707 int idx = -1;
10708 string slot;
10709
10712
10713 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10714 if (inventory_slots.Count() < 1)
10715 {
10716 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10717 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10718 }
10719 else
10720 {
10721 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10722 if (detach_types.Count() < 1)
10723 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10724 }
10725
10726 for (int i = 0; i < inventory_slots.Count(); i++)
10727 {
10728 slot = inventory_slots.Get(i);
10729 }
10730
10731 if (slot != "")
10732 {
10733 if (detach_types.Count() == 1)
10734 idx = 0;
10735 else
10736 idx = inventory_slots.Find(slot);
10737 }
10738 if (idx < 0)
10739 return "";
10740
10741 return detach_types.Get(idx);
10742 }
10743
10745 {
10746
10748
10749
10750 float min_time = 1;
10751 float max_time = 3;
10752 float delay = Math.RandomFloat(min_time, max_time);
10753
10754 explode_timer.Run(delay, this, "DoAmmoExplosion");
10755 }
10756
10758 {
10759 Magazine magazine = Magazine.Cast(this);
10760 int pop_sounds_count = 6;
10761 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10762
10763
10764 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10765 string sound_name = pop_sounds[ sound_idx ];
10767
10768
10769 magazine.ServerAddAmmoCount(-1);
10770
10771
10772 float min_temp_to_explode = 100;
10773
10774 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10775 {
10777 }
10778 }
10779
10780
10781 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10782 {
10783 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10784
10785 const int CHANCE_DAMAGE_CARGO = 4;
10786 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10787 const int CHANCE_DAMAGE_NOTHING = 2;
10788
10790 {
10791 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10792 int chances;
10793 int rnd;
10794
10795 if (GetInventory().GetCargo())
10796 {
10797 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10798 rnd = Math.RandomInt(0,chances);
10799
10800 if (rnd < CHANCE_DAMAGE_CARGO)
10801 {
10803 }
10804 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10805 {
10807 }
10808 }
10809 else
10810 {
10811 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10812 rnd = Math.RandomInt(0,chances);
10813
10814 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10815 {
10817 }
10818 }
10819 }
10820 }
10821
10823 {
10824 if (GetInventory().GetCargo())
10825 {
10826 int item_count = GetInventory().GetCargo().GetItemCount();
10827 if (item_count > 0)
10828 {
10829 int random_pick = Math.RandomInt(0, item_count);
10831 if (!item.IsExplosive())
10832 {
10833 item.AddHealth("","",damage);
10834 return true;
10835 }
10836 }
10837 }
10838 return false;
10839 }
10840
10842 {
10843 int attachment_count = GetInventory().AttachmentCount();
10844 if (attachment_count > 0)
10845 {
10846 int random_pick = Math.RandomInt(0, attachment_count);
10847 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10848 if (!attachment.IsExplosive())
10849 {
10850 attachment.AddHealth("","",damage);
10851 return true;
10852 }
10853 }
10854 return false;
10855 }
10856
10858 {
10860 }
10861
10863 {
10865 return GetInventory().CanRemoveEntity();
10866
10867 return false;
10868 }
10869
10871 {
10872
10874 return false;
10875
10876
10878 return false;
10879
10880
10881
10883 if (delta == 0)
10884 return false;
10885
10886
10887 return true;
10888 }
10889
10891 {
10893 {
10894 if (ScriptInputUserData.CanStoreInputUserData())
10895 {
10896 ScriptInputUserData ctx = new ScriptInputUserData;
10901 ctx.
Write(destination_entity);
10903 ctx.
Write(slot_id);
10905 }
10906 }
10907 else if (!
GetGame().IsMultiplayer())
10908 {
10910 }
10911 }
10912
10914 {
10915 float split_quantity_new;
10919 InventoryLocation loc = new InventoryLocation;
10920
10921 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10922 {
10924 split_quantity_new = stack_max;
10925 else
10927
10929 {
10930 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10931 if (new_item)
10932 {
10933 new_item.SetResultOfSplit(true);
10934 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10936 new_item.
SetQuantity(split_quantity_new,
false,
true);
10937 }
10938 }
10939 }
10940 else if (destination_entity && slot_id == -1)
10941 {
10942 if (quantity > stack_max)
10943 split_quantity_new = stack_max;
10944 else
10945 split_quantity_new = quantity;
10946
10948 {
10950 {
10953 }
10954
10955 if (new_item)
10956 {
10957 new_item.SetResultOfSplit(true);
10958 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10960 new_item.
SetQuantity(split_quantity_new,
false,
true);
10961 }
10962 }
10963 }
10964 else
10965 {
10966 if (stack_max != 0)
10967 {
10969 {
10971 }
10972
10973 if (split_quantity_new == 0)
10974 {
10975 if (!
GetGame().IsMultiplayer())
10976 player.PhysicalPredictiveDropItem(this);
10977 else
10978 player.ServerDropEntity(this);
10979 return;
10980 }
10981
10983 {
10985
10986 if (new_item)
10987 {
10988 new_item.SetResultOfSplit(true);
10989 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10992 new_item.PlaceOnSurface();
10993 }
10994 }
10995 }
10996 }
10997 }
10998
11000 {
11001 float split_quantity_new;
11005 InventoryLocation loc = new InventoryLocation;
11006
11007 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11008 {
11010 split_quantity_new = stack_max;
11011 else
11013
11015 {
11016 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11017 if (new_item)
11018 {
11019 new_item.SetResultOfSplit(true);
11020 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11022 new_item.
SetQuantity(split_quantity_new,
false,
true);
11023 }
11024 }
11025 }
11026 else if (destination_entity && slot_id == -1)
11027 {
11028 if (quantity > stack_max)
11029 split_quantity_new = stack_max;
11030 else
11031 split_quantity_new = quantity;
11032
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,
false,
true);
11047 }
11048 }
11049 }
11050 else
11051 {
11052 if (stack_max != 0)
11053 {
11055 {
11057 }
11058
11060 {
11062
11063 if (new_item)
11064 {
11065 new_item.SetResultOfSplit(true);
11066 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11069 new_item.PlaceOnSurface();
11070 }
11071 }
11072 }
11073 }
11074 }
11075
11077 {
11079 {
11080 if (ScriptInputUserData.CanStoreInputUserData())
11081 {
11082 ScriptInputUserData ctx = new ScriptInputUserData;
11087 dst.WriteToContext(ctx);
11089 }
11090 }
11091 else if (!
GetGame().IsMultiplayer())
11092 {
11094 }
11095 }
11096
11098 {
11100 {
11101 if (ScriptInputUserData.CanStoreInputUserData())
11102 {
11103 ScriptInputUserData ctx = new ScriptInputUserData;
11108 ctx.
Write(destination_entity);
11114 }
11115 }
11116 else if (!
GetGame().IsMultiplayer())
11117 {
11119 }
11120 }
11121
11123 {
11125 }
11126
11128 {
11130 float split_quantity_new;
11132 if (dst.IsValid())
11133 {
11134 int slot_id = dst.GetSlot();
11136
11137 if (quantity > stack_max)
11138 split_quantity_new = stack_max;
11139 else
11140 split_quantity_new = quantity;
11141
11143 {
11145
11146 if (new_item)
11147 {
11148 new_item.SetResultOfSplit(true);
11149 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11151 new_item.
SetQuantity(split_quantity_new,
false,
true);
11152 }
11153
11154 return new_item;
11155 }
11156 }
11157
11158 return null;
11159 }
11160
11162 {
11164 float split_quantity_new;
11166 if (destination_entity)
11167 {
11169 if (quantity > stackable)
11170 split_quantity_new = stackable;
11171 else
11172 split_quantity_new = quantity;
11173
11175 {
11176 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11177 if (new_item)
11178 {
11179 new_item.SetResultOfSplit(true);
11180 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11182 new_item.
SetQuantity(split_quantity_new,
false,
true);
11183 }
11184 }
11185 }
11186 }
11187
11189 {
11191 {
11192 if (ScriptInputUserData.CanStoreInputUserData())
11193 {
11194 ScriptInputUserData ctx = new ScriptInputUserData;
11199 ItemBase destination_entity =
this;
11200 ctx.
Write(destination_entity);
11204 }
11205 }
11206 else if (!
GetGame().IsMultiplayer())
11207 {
11209 }
11210 }
11211
11213 {
11215 float split_quantity_new;
11217 if (player)
11218 {
11220 if (quantity > stackable)
11221 split_quantity_new = stackable;
11222 else
11223 split_quantity_new = quantity;
11224
11226 {
11227 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11228 new_item =
ItemBase.Cast(in_hands);
11229 if (new_item)
11230 {
11231 new_item.SetResultOfSplit(true);
11232 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11234 new_item.SetQuantity(split_quantity_new, false, true);
11235 }
11236 }
11237 }
11238 }
11239
11241 {
11243 float split_quantity_new = Math.Floor(quantity * 0.5);
11244
11246 return;
11247
11249
11250 if (new_item)
11251 {
11252 if (new_item.GetQuantityMax() < split_quantity_new)
11253 {
11254 split_quantity_new = new_item.GetQuantityMax();
11255 }
11256
11257 new_item.SetResultOfSplit(true);
11258 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11259
11261 {
11264 }
11265 else
11266 {
11268 new_item.
SetQuantity(split_quantity_new,
false,
true);
11269 }
11270 }
11271 }
11272
11274 {
11276 float split_quantity_new = Math.Floor(quantity / 2);
11277
11279 return;
11280
11281 InventoryLocation invloc = new InventoryLocation;
11283
11285 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11286
11287 if (new_item)
11288 {
11289 if (new_item.GetQuantityMax() < split_quantity_new)
11290 {
11291 split_quantity_new = new_item.GetQuantityMax();
11292 }
11294 {
11297 }
11298 else if (split_quantity_new > 1)
11299 {
11301 new_item.
SetQuantity(split_quantity_new,
false,
true);
11302 }
11303 }
11304 }
11305
11308 {
11309 SetWeightDirty();
11311
11312 if (parent)
11313 parent.OnAttachmentQuantityChangedEx(this, delta);
11314
11316 {
11318 {
11320 }
11322 {
11323 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11325 }
11326 }
11327
11328 }
11329
11332 {
11333
11334 }
11335
11338 {
11340 }
11341
11343 {
11344 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11345
11347 {
11348 if (newLevel == GameConstants.STATE_RUINED)
11349 {
11351 EntityAI parent = GetHierarchyParent();
11352 if (parent && parent.IsFireplace())
11353 {
11354 CargoBase cargo = GetInventory().GetCargo();
11355 if (cargo)
11356 {
11358 {
11360 }
11361 }
11362 }
11363 }
11364
11366 {
11367
11369 return;
11370 }
11371
11372 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11373 {
11375 }
11376 }
11377 }
11378
11379
11381 {
11382 super.OnRightClick();
11383
11385 {
11387 {
11388 if (ScriptInputUserData.CanStoreInputUserData())
11389 {
11390 EntityAI root = GetHierarchyRoot();
11391 Man playerOwner = GetHierarchyRootPlayer();
11392 InventoryLocation dst = new InventoryLocation;
11393
11394
11395 if (!playerOwner && root && root == this)
11396 {
11398 }
11399 else
11400 {
11401
11402 GetInventory().GetCurrentInventoryLocation(dst);
11404 {
11407 {
11409 }
11410 else
11411 {
11413
11414
11415 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11416 {
11418 }
11419 else
11420 {
11421 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11422 }
11423 }
11424 }
11425 }
11426
11427 ScriptInputUserData ctx = new ScriptInputUserData;
11435 }
11436 }
11437 else if (!
GetGame().IsMultiplayer())
11438 {
11440 }
11441 }
11442 }
11443
11445 {
11446 if (root)
11447 {
11448 vector m4[4];
11449 root.GetTransform(m4);
11450 dst.SetGround(this, m4);
11451 }
11452 else
11453 {
11454 GetInventory().GetCurrentInventoryLocation(dst);
11455 }
11456 }
11457
11458 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11459 {
11460
11461 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11462 return false;
11463
11464 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11465 return false;
11466
11467
11469 return false;
11470
11471
11472 Magazine mag = Magazine.Cast(this);
11473 if (mag)
11474 {
11475 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11476 return false;
11477
11478 if (stack_max_limit)
11479 {
11480 Magazine other_mag = Magazine.Cast(other_item);
11481 if (other_item)
11482 {
11483 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11484 return false;
11485 }
11486
11487 }
11488 }
11489 else
11490 {
11491
11493 return false;
11494
11496 return false;
11497 }
11498
11499 PlayerBase player = null;
11500 if (CastTo(player, GetHierarchyRootPlayer()))
11501 {
11502 if (player.GetInventory().HasAttachment(this))
11503 return false;
11504
11505 if (player.IsItemsToDelete())
11506 return false;
11507 }
11508
11509 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11510 return false;
11511
11512 int slotID;
11514 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11515 return false;
11516
11517 return true;
11518 }
11519
11521 {
11523 }
11524
11526 {
11527 return m_IsResultOfSplit;
11528 }
11529
11531 {
11532 m_IsResultOfSplit = value;
11533 }
11534
11536 {
11538 }
11539
11541 {
11542 float other_item_quantity = other_item.GetQuantity();
11543 float this_free_space;
11544
11546
11548
11549 if (other_item_quantity > this_free_space)
11550 {
11551 return this_free_space;
11552 }
11553 else
11554 {
11555 return other_item_quantity;
11556 }
11557 }
11558
11560 {
11562 }
11563
11565 {
11567 return;
11568
11569 if (!IsMagazine() && other_item)
11570 {
11572 if (quantity_used != 0)
11573 {
11574 float hp1 = GetHealth01("","");
11575 float hp2 = other_item.GetHealth01("","");
11576 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11577 hpResult = hpResult / (
GetQuantity() + quantity_used);
11578
11579 hpResult *= GetMaxHealth();
11580 Math.Round(hpResult);
11581 SetHealth("", "Health", hpResult);
11582
11584 other_item.AddQuantity(-quantity_used);
11585 }
11586 }
11588 }
11589
11591 {
11592 #ifdef SERVER
11593 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11594 GetHierarchyParent().IncreaseLifetimeUp();
11595 #endif
11596 };
11597
11599 {
11600 PlayerBase p = PlayerBase.Cast(player);
11601
11602 array<int> recipesIds = p.m_Recipes;
11603 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11604 if (moduleRecipesManager)
11605 {
11606 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11607 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11608 }
11609
11610 for (int i = 0;i < recipesIds.Count(); i++)
11611 {
11612 int key = recipesIds.Get(i);
11613 string recipeName = moduleRecipesManager.GetRecipeName(key);
11615 }
11616 }
11617
11618
11619 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11620 {
11621 super.GetDebugActions(outputList);
11622
11623
11629
11630
11635
11640
11641
11645
11646
11648 {
11652 }
11653
11656
11657
11661
11663
11664 InventoryLocation loc = new InventoryLocation();
11665 GetInventory().GetCurrentInventoryLocation(loc);
11667 {
11668 if (Gizmo_IsSupported())
11671 }
11672
11674 }
11675
11676
11677
11678
11680 {
11681 super.OnAction(action_id, player, ctx);
11682
11684 {
11685 switch (action_id)
11686 {
11689 return true;
11692 return true;
11693 }
11694 }
11695
11697 {
11698 switch (action_id)
11699 {
11701 Delete();
11702 return true;
11703 }
11704 }
11705
11706 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11707 {
11708 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11709 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11710 PlayerBase p = PlayerBase.Cast(player);
11711 if (
EActions.RECIPES_RANGE_START < 1000)
11712 {
11713 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11714 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11715 }
11716 }
11717 #ifndef SERVER
11718 else if (action_id ==
EActions.WATCH_PLAYER)
11719 {
11720 PluginDeveloper.SetDeveloperItemClientEx(player);
11721 }
11722 #endif
11724 {
11725 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11726 {
11727 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11728 OnDebugButtonPressServer(id + 1);
11729 }
11730
11731 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11732 {
11733 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11735 }
11736
11737 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11738 {
11739 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11741 }
11742
11743 else if (action_id ==
EActions.ADD_QUANTITY)
11744 {
11745 if (IsMagazine())
11746 {
11747 Magazine mag = Magazine.Cast(this);
11748 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11749 }
11750 else
11751 {
11753 }
11754
11755 if (m_EM)
11756 {
11757 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11758 }
11759
11760 }
11761
11762 else if (action_id ==
EActions.REMOVE_QUANTITY)
11763 {
11764 if (IsMagazine())
11765 {
11766 Magazine mag2 = Magazine.Cast(this);
11767 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11768 }
11769 else
11770 {
11772 }
11773 if (m_EM)
11774 {
11775 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11776 }
11777
11778 }
11779
11780 else if (action_id ==
EActions.SET_QUANTITY_0)
11781 {
11783
11784 if (m_EM)
11785 {
11786 m_EM.SetEnergy(0);
11787 }
11788 }
11789
11790 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11791 {
11793
11794 if (m_EM)
11795 {
11796 m_EM.SetEnergy(m_EM.GetEnergyMax());
11797 }
11798 }
11799
11800 else if (action_id ==
EActions.ADD_HEALTH)
11801 {
11802 AddHealth("","",GetMaxHealth("","Health")/5);
11803 }
11804 else if (action_id ==
EActions.REMOVE_HEALTH)
11805 {
11806 AddHealth("","",-GetMaxHealth("","Health")/5);
11807 }
11808 else if (action_id ==
EActions.DESTROY_HEALTH)
11809 {
11810 SetHealth01("","",0);
11811 }
11812 else if (action_id ==
EActions.WATCH_ITEM)
11813 {
11815 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11816 #ifdef DEVELOPER
11817 SetDebugDeveloper_item(this);
11818 #endif
11819 }
11820
11821 else if (action_id ==
EActions.ADD_TEMPERATURE)
11822 {
11823 AddTemperature(20);
11824
11825 }
11826
11827 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11828 {
11829 AddTemperature(-20);
11830
11831 }
11832
11833 else if (action_id ==
EActions.FLIP_FROZEN)
11834 {
11835 SetFrozen(!GetIsFrozen());
11836
11837 }
11838
11839 else if (action_id ==
EActions.ADD_WETNESS)
11840 {
11842
11843 }
11844
11845 else if (action_id ==
EActions.REMOVE_WETNESS)
11846 {
11848
11849 }
11850
11851 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11852 {
11855
11856
11857 }
11858
11859 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11860 {
11863 }
11864
11865 else if (action_id ==
EActions.MAKE_SPECIAL)
11866 {
11867 auto debugParams = DebugSpawnParams.WithPlayer(player);
11868 OnDebugSpawnEx(debugParams);
11869 }
11870
11871 }
11872
11873
11874 return false;
11875 }
11876
11877
11878
11879
11883
11886
11887
11888
11890 {
11891 return false;
11892 }
11893
11894
11896 {
11897 return true;
11898 }
11899
11900
11902 {
11903 return true;
11904 }
11905
11906
11907
11909 {
11910 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11912 }
11913
11916 {
11917 return null;
11918 }
11919
11921 {
11922 return false;
11923 }
11924
11926 {
11927 return false;
11928 }
11929
11933
11934
11936 {
11937 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11938 return module_repairing.CanRepair(this, item_repair_kit);
11939 }
11940
11941
11942 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11943 {
11944 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11945 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11946 }
11947
11948
11950 {
11951
11952
11953
11954
11955
11956
11957
11958
11959 return 1;
11960 }
11961
11962
11963
11965 {
11967 }
11968
11969
11970
11972 {
11974 }
11975
11976
11985 {
11986 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11987
11988 if (player)
11989 {
11990 player.MessageStatus(text);
11991 }
11992 }
11993
11994
12003 {
12004 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12005
12006 if (player)
12007 {
12008 player.MessageAction(text);
12009 }
12010 }
12011
12012
12021 {
12022 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12023
12024 if (player)
12025 {
12026 player.MessageFriendly(text);
12027 }
12028 }
12029
12030
12039 {
12040 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12041
12042 if (player)
12043 {
12044 player.MessageImportant(text);
12045 }
12046 }
12047
12049 {
12050 return true;
12051 }
12052
12053
12054 override bool KindOf(
string tag)
12055 {
12056 bool found = false;
12057 string item_name = this.
GetType();
12060
12061 int array_size = item_tag_array.Count();
12062 for (int i = 0; i < array_size; i++)
12063 {
12064 if (item_tag_array.Get(i) == tag)
12065 {
12066 found = true;
12067 break;
12068 }
12069 }
12070 return found;
12071 }
12072
12073
12075 {
12076
12077 super.OnRPC(sender, rpc_type,ctx);
12078
12079
12080 switch (rpc_type)
12081 {
12082 #ifndef SERVER
12083 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12084 Param2<bool, string> p = new Param2<bool, string>(false, "");
12085
12087 return;
12088
12089 bool play = p.param1;
12090 string soundSet = p.param2;
12091
12092 if (play)
12093 {
12095 {
12097 {
12099 }
12100 }
12101 else
12102 {
12104 }
12105 }
12106 else
12107 {
12109 }
12110
12111 break;
12112 #endif
12113
12114 }
12115
12117 {
12119 }
12120 }
12121
12122
12123
12124
12126 {
12127 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12128 return plugin.GetID(
name);
12129 }
12130
12132 {
12133 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12134 return plugin.GetName(id);
12135 }
12136
12139 {
12140
12141
12142 int varFlags;
12143 if (!ctx.
Read(varFlags))
12144 return;
12145
12146 if (varFlags & ItemVariableFlags.FLOAT)
12147 {
12149 }
12150 }
12151
12153 {
12154
12155 super.SerializeNumericalVars(floats_out);
12156
12157
12158
12160 {
12162 }
12163
12165 {
12167 }
12168
12170 {
12172 }
12173
12175 {
12180 }
12181
12183 {
12185 }
12186 }
12187
12189 {
12190
12191 super.DeSerializeNumericalVars(floats);
12192
12193
12194 int index = 0;
12195 int mask = Math.Round(floats.Get(index));
12196
12197 index++;
12198
12200 {
12202 {
12204 }
12205 else
12206 {
12207 float quantity = floats.Get(index);
12208 SetQuantity(quantity,
true,
false,
false,
false);
12209 }
12210 index++;
12211 }
12212
12214 {
12215 float wet = floats.Get(index);
12217 index++;
12218 }
12219
12221 {
12222 int liquidtype = Math.Round(floats.Get(index));
12224 index++;
12225 }
12226
12228 {
12230 index++;
12232 index++;
12234 index++;
12236 index++;
12237 }
12238
12240 {
12241 int cleanness = Math.Round(floats.Get(index));
12243 index++;
12244 }
12245 }
12246
12248 {
12249 super.WriteVarsToCTX(ctx);
12250
12251
12253 {
12255 }
12256
12258 {
12260 }
12261
12263 {
12265 }
12266
12268 {
12269 int r,g,b,a;
12275 }
12276
12278 {
12280 }
12281 }
12282
12284 {
12285 if (!super.ReadVarsFromCTX(ctx,version))
12286 return false;
12287
12288 int intValue;
12289 float value;
12290
12291 if (version < 140)
12292 {
12293 if (!ctx.
Read(intValue))
12294 return false;
12295
12296 m_VariablesMask = intValue;
12297 }
12298
12300 {
12301 if (!ctx.
Read(value))
12302 return false;
12303
12305 {
12307 }
12308 else
12309 {
12311 }
12312 }
12313
12314 if (version < 140)
12315 {
12317 {
12318 if (!ctx.
Read(value))
12319 return false;
12320 SetTemperatureDirect(value);
12321 }
12322 }
12323
12325 {
12326 if (!ctx.
Read(value))
12327 return false;
12329 }
12330
12332 {
12333 if (!ctx.
Read(intValue))
12334 return false;
12336 }
12337
12339 {
12340 int r,g,b,a;
12342 return false;
12344 return false;
12346 return false;
12348 return false;
12349
12351 }
12352
12354 {
12355 if (!ctx.
Read(intValue))
12356 return false;
12358 }
12359
12360 if (version >= 138 && version < 140)
12361 {
12363 {
12364 if (!ctx.
Read(intValue))
12365 return false;
12366 SetFrozen(intValue);
12367 }
12368 }
12369
12370 return true;
12371 }
12372
12373
12375 {
12378 {
12380 }
12381
12382 if (!super.OnStoreLoad(ctx, version))
12383 {
12385 return false;
12386 }
12387
12388 if (version >= 114)
12389 {
12390 bool hasQuickBarIndexSaved;
12391
12392 if (!ctx.
Read(hasQuickBarIndexSaved))
12393 {
12395 return false;
12396 }
12397
12398 if (hasQuickBarIndexSaved)
12399 {
12400 int itmQBIndex;
12401
12402
12403 if (!ctx.
Read(itmQBIndex))
12404 {
12406 return false;
12407 }
12408
12409 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12410 if (itmQBIndex != -1 && parentPlayer)
12411 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12412 }
12413 }
12414 else
12415 {
12416
12417 PlayerBase player;
12418 int itemQBIndex;
12419 if (version ==
int.
MAX)
12420 {
12421 if (!ctx.
Read(itemQBIndex))
12422 {
12424 return false;
12425 }
12426 }
12427 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12428 {
12429
12430 if (!ctx.
Read(itemQBIndex))
12431 {
12433 return false;
12434 }
12435 if (itemQBIndex != -1 && player)
12436 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12437 }
12438 }
12439
12440 if (version < 140)
12441 {
12442
12443 if (!LoadVariables(ctx, version))
12444 {
12446 return false;
12447 }
12448 }
12449
12450
12452 {
12454 return false;
12455 }
12456 if (version >= 132)
12457 {
12459 if (raib)
12460 {
12462 {
12464 return false;
12465 }
12466 }
12467 }
12468
12470 return true;
12471 }
12472
12473
12474
12476 {
12477 super.OnStoreSave(ctx);
12478
12479 PlayerBase player;
12480 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12481 {
12483
12484 int itemQBIndex = -1;
12485 itemQBIndex = player.FindQuickBarEntityIndex(this);
12486 ctx.
Write(itemQBIndex);
12487 }
12488 else
12489 {
12491 }
12492
12494
12496 if (raib)
12497 {
12499 }
12500 }
12501
12502
12504 {
12505 super.AfterStoreLoad();
12506
12508 {
12510 }
12511
12513 {
12516 }
12517 }
12518
12520 {
12521 super.EEOnAfterLoad();
12522
12524 {
12526 }
12527
12530 }
12531
12533 {
12534 return false;
12535 }
12536
12537
12538
12540 {
12542 {
12543 #ifdef PLATFORM_CONSOLE
12544
12546 {
12548 if (menu)
12549 {
12551 }
12552 }
12553 #endif
12554 }
12555
12557 {
12560 }
12561
12563 {
12564 SetWeightDirty();
12566 }
12568 {
12571 }
12572
12574 {
12577 }
12579 {
12582 }
12583
12584 super.OnVariablesSynchronized();
12585 }
12586
12587
12588
12590 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12591 {
12592 if (!IsServerCheck(allow_client))
12593 return false;
12594
12596 return false;
12597
12600
12601 if (value <= (min + 0.001))
12602 value = min;
12603
12604 if (value == min)
12605 {
12606 if (destroy_config)
12607 {
12608 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12609 if (dstr)
12610 {
12612 this.Delete();
12613 return true;
12614 }
12615 }
12616 else if (destroy_forced)
12617 {
12619 this.Delete();
12620 return true;
12621 }
12622
12624 }
12625
12628
12630 {
12632
12633 if (delta)
12635 }
12636
12638
12639 return false;
12640 }
12641
12642
12644 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12645 {
12647 }
12648
12650 {
12653 }
12654
12656 {
12659 }
12660
12662 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12663 {
12664 float value_clamped = Math.Clamp(value, 0, 1);
12666 SetQuantity(result, destroy_config, destroy_forced);
12667 }
12668
12669
12672 {
12674 }
12675
12677 {
12679 }
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12691 {
12692 int slot = -1;
12693 if (GetInventory())
12694 {
12695 InventoryLocation il = new InventoryLocation;
12696 GetInventory().GetCurrentInventoryLocation(il);
12698 }
12699
12701 }
12702
12704 {
12705 float quantity_max = 0;
12706
12708 {
12709 if (attSlotID != -1)
12710 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12711
12712 if (quantity_max <= 0)
12714 }
12715
12716 if (quantity_max <= 0)
12718
12719 return quantity_max;
12720 }
12721
12723 {
12725 }
12726
12728 {
12730 }
12731
12732
12734 {
12736 }
12737
12739 {
12741 }
12742
12744 {
12746 }
12747
12748
12750 {
12751
12752 float weightEx = GetWeightEx();
12753 float special = GetInventoryAndCargoWeight();
12754 return weightEx - special;
12755 }
12756
12757
12759 {
12761 }
12762
12764 {
12766 {
12767 #ifdef DEVELOPER
12768 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12769 {
12770 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12772 }
12773 #endif
12774
12775 return GetQuantity() * GetConfigWeightModified();
12776 }
12777 else if (HasEnergyManager())
12778 {
12779 #ifdef DEVELOPER
12780 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12781 {
12782 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12783 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12784 }
12785 #endif
12786 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12787 }
12788 else
12789 {
12790 #ifdef DEVELOPER
12791 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12792 {
12793 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12794 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12795 }
12796 #endif
12797 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12798 }
12799 }
12800
12803 {
12804 int item_count = 0;
12806
12807 if (GetInventory().GetCargo() != NULL)
12808 {
12809 item_count = GetInventory().GetCargo().GetItemCount();
12810 }
12811
12812 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12813 {
12814 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12815 if (item)
12816 item_count += item.GetNumberOfItems();
12817 }
12818 return item_count;
12819 }
12820
12823 {
12824 float weight = 0;
12825 float wetness = 1;
12826 if (include_wetness)
12829 {
12830 weight = wetness * m_ConfigWeight;
12831 }
12833 {
12834 weight = 1;
12835 }
12836 return weight;
12837 }
12838
12839
12840
12842 {
12843 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12844 {
12845 GameInventory inv = GetInventory();
12846 array<EntityAI> items = new array<EntityAI>;
12848 for (int i = 0; i < items.Count(); i++)
12849 {
12851 if (item)
12852 {
12854 }
12855 }
12856 }
12857 }
12858
12859
12860
12861
12863 {
12864 float energy = 0;
12865 if (HasEnergyManager())
12866 {
12867 energy = GetCompEM().GetEnergy();
12868 }
12869 return energy;
12870 }
12871
12872
12874 {
12875 super.OnEnergyConsumed();
12876
12878 }
12879
12881 {
12882 super.OnEnergyAdded();
12883
12885 }
12886
12887
12889 {
12890 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12891 {
12893 {
12894 float energy_0to1 = GetCompEM().GetEnergy0To1();
12896 }
12897 }
12898 }
12899
12900
12902 {
12903 return ConfigGetFloat("heatIsolation");
12904 }
12905
12907 {
12909 }
12910
12912 {
12913 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12914 if (
GetGame().ConfigIsExisting(paramPath))
12916
12917 return 0.0;
12918 }
12919
12921 {
12922 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12923 if (
GetGame().ConfigIsExisting(paramPath))
12925
12926 return 0.0;
12927 }
12928
12929 override void SetWet(
float value,
bool allow_client =
false)
12930 {
12931 if (!IsServerCheck(allow_client))
12932 return;
12933
12936
12938
12939 m_VarWet = Math.Clamp(value, min, max);
12940
12942 {
12945 }
12946 }
12947
12948 override void AddWet(
float value)
12949 {
12951 }
12952
12954 {
12956 }
12957
12959 {
12961 }
12962
12964 {
12966 }
12967
12969 {
12971 }
12972
12974 {
12976 }
12977
12978 override void OnWetChanged(
float newVal,
float oldVal)
12979 {
12982 if (newLevel != oldLevel)
12983 {
12985 }
12986 }
12987
12989 {
12990 SetWeightDirty();
12991 }
12992
12994 {
12995 return GetWetLevelInternal(
m_VarWet);
12996 }
12997
12998
12999
13001 {
13003 }
13004
13006 {
13008 }
13009
13011 {
13013 }
13014
13016 {
13018 }
13019
13020
13021
13023 {
13024 if (ConfigIsExisting("itemModelLength"))
13025 {
13026 return ConfigGetFloat("itemModelLength");
13027 }
13028 return 0;
13029 }
13030
13032 {
13033 if (ConfigIsExisting("itemAttachOffset"))
13034 {
13035 return ConfigGetFloat("itemAttachOffset");
13036 }
13037 return 0;
13038 }
13039
13040 override void SetCleanness(
int value,
bool allow_client =
false)
13041 {
13042 if (!IsServerCheck(allow_client))
13043 return;
13044
13046
13048
13051 }
13052
13054 {
13056 }
13057
13059 {
13060 return true;
13061 }
13062
13063
13064
13065
13067 {
13069 }
13070
13072 {
13074 }
13075
13076
13077
13078
13079 override void SetColor(
int r,
int g,
int b,
int a)
13080 {
13086 }
13088 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13089 {
13094 }
13095
13097 {
13099 }
13100
13103 {
13104 int r,g,b,a;
13106 r = r/255;
13107 g = g/255;
13108 b = b/255;
13109 a = a/255;
13110 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13111 }
13112
13113
13114
13115 override void SetLiquidType(
int value,
bool allow_client =
false)
13116 {
13117 if (!IsServerCheck(allow_client))
13118 return;
13119
13124 }
13125
13127 {
13128 return ConfigGetInt("varLiquidTypeInit");
13129 }
13130
13132 {
13134 }
13135
13137 {
13139 SetFrozen(false);
13140 }
13141
13144 {
13145 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13146 }
13147
13148
13151 {
13152 PlayerBase nplayer;
13153 if (PlayerBase.CastTo(nplayer, player))
13154 {
13156
13157 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13158 }
13159 }
13160
13161
13164 {
13165 PlayerBase nplayer;
13166 if (PlayerBase.CastTo(nplayer,player))
13167 {
13168
13169 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13170
13171 }
13172
13173
13174 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13175
13176
13177 if (HasEnergyManager())
13178 {
13179 GetCompEM().UpdatePlugState();
13180 }
13181 }
13182
13183
13185 {
13186 super.OnPlacementStarted(player);
13187
13189 }
13190
13191 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13192 {
13194 {
13195 m_AdminLog.OnPlacementComplete(player,
this);
13196 }
13197
13198 super.OnPlacementComplete(player, position, orientation);
13199 }
13200
13201
13202
13203
13204
13206 {
13208 {
13209 return true;
13210 }
13211 else
13212 {
13213 return false;
13214 }
13215 }
13216
13217
13219 {
13221 {
13223 }
13224 }
13225
13226
13228 {
13230 }
13231
13233 {
13235 }
13236
13237 override void InsertAgent(
int agent,
float count = 1)
13238 {
13239 if (count < 1)
13240 return;
13241
13243 }
13244
13247 {
13249 }
13250
13251
13253 {
13255 }
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13299 {
13301 return false;
13302 return true;
13303 }
13304
13306 {
13307
13309 }
13310
13311
13314 {
13315 super.CheckForRoofLimited(timeTresholdMS);
13316
13318 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13319 {
13320 m_PreviousRoofTestTime = time;
13321 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13322 }
13323 }
13324
13325
13327 {
13329 {
13330 return 0;
13331 }
13332
13333 if (GetInventory().GetAttachmentSlotsCount() != 0)
13334 {
13335 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13336 if (filter)
13337 return filter.GetProtectionLevel(type, false, system);
13338 else
13339 return 0;
13340 }
13341
13342 string subclassPath, entryName;
13343
13344 switch (type)
13345 {
13347 entryName = "biological";
13348 break;
13350 entryName = "chemical";
13351 break;
13352 default:
13353 entryName = "biological";
13354 break;
13355 }
13356
13357 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13358
13360 }
13361
13362
13363
13366 {
13367 if (!IsMagazine())
13369
13371 }
13372
13373
13374
13375
13376
13381 {
13382 return true;
13383 }
13384
13386 {
13388 }
13389
13390
13391
13392
13393
13395 {
13396 if (parent)
13397 {
13398 if (parent.IsInherited(DayZInfected))
13399 return true;
13400
13401 if (!parent.IsRuined())
13402 return true;
13403 }
13404
13405 return true;
13406 }
13407
13409 {
13410 if (!super.CanPutAsAttachment(parent))
13411 {
13412 return false;
13413 }
13414
13415 if (!IsRuined() && !parent.IsRuined())
13416 {
13417 return true;
13418 }
13419
13420 return false;
13421 }
13422
13424 {
13425
13426
13427
13428
13429 return super.CanReceiveItemIntoCargo(item);
13430 }
13431
13433 {
13434
13435
13436
13437
13438 GameInventory attachmentInv = attachment.GetInventory();
13440 {
13441 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13442 return false;
13443 }
13444
13445 InventoryLocation loc = new InventoryLocation();
13446 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13447 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13448 return false;
13449
13450 return super.CanReceiveAttachment(attachment, slotId);
13451 }
13452
13454 {
13455 if (!super.CanReleaseAttachment(attachment))
13456 return false;
13457
13458 return GetInventory().AreChildrenAccessible();
13459 }
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13482 {
13483 int id = muzzle_owner.GetMuzzleID();
13484 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13485
13486 if (WPOF_array)
13487 {
13488 for (int i = 0; i < WPOF_array.Count(); i++)
13489 {
13490 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13491
13492 if (WPOF)
13493 {
13494 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13495 }
13496 }
13497 }
13498 }
13499
13500
13502 {
13503 int id = muzzle_owner.GetMuzzleID();
13505
13506 if (WPOBE_array)
13507 {
13508 for (int i = 0; i < WPOBE_array.Count(); i++)
13509 {
13510 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13511
13512 if (WPOBE)
13513 {
13514 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13515 }
13516 }
13517 }
13518 }
13519
13520
13522 {
13523 int id = muzzle_owner.GetMuzzleID();
13524 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13525
13526 if (WPOOH_array)
13527 {
13528 for (int i = 0; i < WPOOH_array.Count(); i++)
13529 {
13530 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13531
13532 if (WPOOH)
13533 {
13534 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13535 }
13536 }
13537 }
13538 }
13539
13540
13542 {
13543 int id = muzzle_owner.GetMuzzleID();
13544 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13545
13546 if (WPOOH_array)
13547 {
13548 for (int i = 0; i < WPOOH_array.Count(); i++)
13549 {
13550 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13551
13552 if (WPOOH)
13553 {
13554 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13555 }
13556 }
13557 }
13558 }
13559
13560
13562 {
13563 int id = muzzle_owner.GetMuzzleID();
13564 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13565
13566 if (WPOOH_array)
13567 {
13568 for (int i = 0; i < WPOOH_array.Count(); i++)
13569 {
13570 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13571
13572 if (WPOOH)
13573 {
13574 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13575 }
13576 }
13577 }
13578 }
13579
13580
13581
13583 {
13585 {
13586 return true;
13587 }
13588
13589 return false;
13590 }
13591
13593 {
13595 {
13596 return true;
13597 }
13598
13599 return false;
13600 }
13601
13603 {
13605 {
13606 return true;
13607 }
13608
13609 return false;
13610 }
13611
13613 {
13614 return false;
13615 }
13616
13619 {
13620 return UATimeSpent.DEFAULT_DEPLOY;
13621 }
13622
13623
13624
13625
13627 {
13629 SetSynchDirty();
13630 }
13631
13633 {
13635 }
13636
13637
13639 {
13640 return false;
13641 }
13642
13645 {
13646 string att_type = "None";
13647
13648 if (ConfigIsExisting("soundAttType"))
13649 {
13650 att_type = ConfigGetString("soundAttType");
13651 }
13652
13654 }
13655
13657 {
13659 }
13660
13661
13662
13663
13664
13670
13672 {
13675
13677 }
13678
13679
13681 {
13683 return;
13684
13686
13689
13692
13693 SoundParameters params = new SoundParameters();
13697 }
13698
13699
13701 {
13703 return;
13704
13706 SetSynchDirty();
13707
13710 }
13711
13712
13714 {
13716 return;
13717
13719 SetSynchDirty();
13720
13723 }
13724
13726 {
13728 }
13729
13731 {
13733 }
13734
13737 {
13738 if (!
GetGame().IsDedicatedServer())
13739 {
13740 if (ConfigIsExisting("attachSoundSet"))
13741 {
13742 string cfg_path = "";
13743 string soundset = "";
13744 string type_name =
GetType();
13745
13748 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13749 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13750
13751 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13752 {
13753 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13754 {
13755 if (cfg_slot_array[i] == slot_type)
13756 {
13757 soundset = cfg_soundset_array[i];
13758 break;
13759 }
13760 }
13761 }
13762
13763 if (soundset != "")
13764 {
13765 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13767 }
13768 }
13769 }
13770 }
13771
13773 {
13774
13775 }
13776
13777 void OnApply(PlayerBase player);
13778
13780 {
13781 return 1.0;
13782 };
13783
13785 {
13787 }
13788
13790 {
13792 }
13793
13795
13797 {
13798 SetDynamicPhysicsLifeTime(0.01);
13800 }
13801
13803 {
13804 array<string> zone_names = new array<string>;
13805 GetDamageZones(zone_names);
13806 for (int i = 0; i < zone_names.Count(); i++)
13807 {
13808 SetHealthMax(zone_names.Get(i),"Health");
13809 }
13810 SetHealthMax("","Health");
13811 }
13812
13815 {
13816 float global_health = GetHealth01("","Health");
13817 array<string> zones = new array<string>;
13818 GetDamageZones(zones);
13819
13820 for (int i = 0; i < zones.Count(); i++)
13821 {
13822 SetHealth01(zones.Get(i),"Health",global_health);
13823 }
13824 }
13825
13828 {
13829 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13830 }
13831
13833 {
13834 if (!hasRootAsPlayer)
13835 {
13836 if (refParentIB)
13837 {
13838
13839 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13840 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13841
13842 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13843 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13844
13847 }
13848 else
13849 {
13850
13853 }
13854 }
13855 }
13856
13858 {
13860 {
13861 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13862 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13863 {
13864 float heatPermCoef = 1.0;
13866 while (ent)
13867 {
13868 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13869 ent = ent.GetHierarchyParent();
13870 }
13871
13872 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13873 }
13874 }
13875 }
13876
13878 {
13879
13880 EntityAI parent = GetHierarchyParent();
13881 if (!parent)
13882 {
13883 hasParent = false;
13884 hasRootAsPlayer = false;
13885 }
13886 else
13887 {
13888 hasParent = true;
13889 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13890 refParentIB =
ItemBase.Cast(parent);
13891 }
13892 }
13893
13894 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13895 {
13896
13897 }
13898
13900 {
13901
13902 return false;
13903 }
13904
13906 {
13907
13908
13909 return false;
13910 }
13911
13913 {
13914
13915 return false;
13916 }
13917
13920 {
13921 return !GetIsFrozen() &&
IsOpen();
13922 }
13923
13925 {
13926 bool hasParent = false, hasRootAsPlayer = false;
13928
13929 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13930 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13931
13932 if (wwtu || foodDecay)
13933 {
13937
13938 if (processWetness || processTemperature || processDecay)
13939 {
13941
13942 if (processWetness)
13943 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13944
13945 if (processTemperature)
13947
13948 if (processDecay)
13949 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13950 }
13951 }
13952 }
13953
13956 {
13958 }
13959
13961 {
13964
13965 return super.GetTemperatureFreezeThreshold();
13966 }
13967
13969 {
13972
13973 return super.GetTemperatureThawThreshold();
13974 }
13975
13977 {
13980
13981 return super.GetItemOverheatThreshold();
13982 }
13983
13985 {
13987 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13988
13989 return super.GetTemperatureFreezeTime();
13990 }
13991
13993 {
13995 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13996
13997 return super.GetTemperatureThawTime();
13998 }
13999
14004
14006 {
14007 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14008 }
14009
14011 {
14012 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14013 }
14014
14017 {
14019 }
14020
14022 {
14024 }
14025
14027 {
14029 }
14030
14033 {
14034 return null;
14035 }
14036
14039 {
14040 return false;
14041 }
14042
14044 {
14046 {
14049 if (!trg)
14050 {
14052 explosive = this;
14053 }
14054
14055 explosive.PairRemote(trg);
14057
14058 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14059 trg.SetPersistentPairID(persistentID);
14060 explosive.SetPersistentPairID(persistentID);
14061
14062 return true;
14063 }
14064 return false;
14065 }
14066
14069 {
14070 float ret = 1.0;
14073 ret *= GetHealth01();
14074
14075 return ret;
14076 }
14077
14078 #ifdef DEVELOPER
14079 override void SetDebugItem()
14080 {
14081 super.SetDebugItem();
14082 _itemBase = this;
14083 }
14084
14086 {
14087 string text = super.GetDebugText();
14088
14090 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14091
14092 return text;
14093 }
14094 #endif
14095
14097 {
14098 return true;
14099 }
14100
14102
14104
14106 {
14109 }
14110
14111
14119
14135}
14136
14138{
14140 if (entity)
14141 {
14142 bool is_item = entity.IsInherited(
ItemBase);
14143 if (is_item && full_quantity)
14144 {
14147 }
14148 }
14149 else
14150 {
14152 return NULL;
14153 }
14154 return entity;
14155}
14156
14158{
14159 if (item)
14160 {
14161 if (health > 0)
14162 item.SetHealth("", "", health);
14163
14164 if (item.CanHaveTemperature())
14165 {
14167 if (item.CanFreeze())
14168 item.SetFrozen(false);
14169 }
14170
14171 if (item.HasEnergyManager())
14172 {
14173 if (quantity >= 0)
14174 {
14175 item.GetCompEM().SetEnergy0To1(quantity);
14176 }
14177 else
14178 {
14180 }
14181 }
14182 else if (item.IsMagazine())
14183 {
14184 Magazine mag = Magazine.Cast(item);
14185 if (quantity >= 0)
14186 {
14187 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14188 }
14189 else
14190 {
14192 }
14193
14194 }
14195 else
14196 {
14197 if (quantity >= 0)
14198 {
14199 item.SetQuantityNormalized(quantity, false);
14200 }
14201 else
14202 {
14204 }
14205
14206 }
14207 }
14208}
14209
14210#ifdef DEVELOPER
14212#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.