9341{
9343 {
9344 return true;
9345 }
9346};
9347
9348
9349
9351{
9355
9357
9360
9361
9362
9363
9364
9373
9379
9384
9389
9410 protected bool m_IsResultOfSplit
9411
9413
9418
9419
9420
9422
9426
9427
9428
9430
9433
9434
9435
9441
9442
9450
9453
9454
9456
9457
9459
9460
9465
9466
9471
9472
9474
9475
9477 {
9482
9483 if (!
GetGame().IsDedicatedServer())
9484 {
9486 {
9488
9490 {
9492 }
9493 }
9494
9497 }
9498
9499 m_OldLocation = null;
9500
9502 {
9504 }
9505
9506 if (ConfigIsExisting("headSelectionsToHide"))
9507 {
9510 }
9511
9513 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9514 {
9516 }
9517
9519
9520 m_IsResultOfSplit = false;
9521
9523 }
9524
9526 {
9527 super.InitItemVariables();
9528
9534 m_Count = ConfigGetInt(
"count");
9535
9538
9543
9546
9551
9563
9567
9568
9571 if (ConfigIsExisting("canBeSplit"))
9572 {
9575 }
9576
9578 if (ConfigIsExisting("itemBehaviour"))
9580
9581
9584 RegisterNetSyncVariableInt("m_VarLiquidType");
9585 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9586
9587 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9588 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9589 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9590
9591 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9592 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9593 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9594 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9595
9596 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9597 RegisterNetSyncVariableBool("m_IsTakeable");
9598 RegisterNetSyncVariableBool("m_IsHologram");
9599
9602 {
9605 }
9606
9608
9610 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9612
9613 }
9614
9616 {
9618 }
9619
9621 {
9624 {
9629 }
9630 }
9631
9632 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9633 {
9635 {
9638 }
9639
9641 }
9642
9644 {
9650 }
9651
9653
9655 {
9657
9658 if (!action)
9659 {
9660 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9661 return;
9662 }
9663
9665 if (!ai)
9666 {
9668 return;
9669 }
9670
9672 if (!action_array)
9673 {
9674 action_array = new array<ActionBase_Basic>;
9676 }
9677 if (LogManager.IsActionLogEnable())
9678 {
9679 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9680 }
9681
9682 if (action_array.Find(action) != -1)
9683 {
9684 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9685 }
9686 else
9687 {
9688 action_array.Insert(action);
9689 }
9690 }
9691
9693 {
9695 ActionBase action = player.GetActionManager().GetAction(actionName);
9698
9699 if (action_array)
9700 {
9701 action_array.RemoveItem(action);
9702 }
9703 }
9704
9705
9706
9708 {
9709 ActionOverrideData overrideData = new ActionOverrideData();
9713
9715 if (!actionMap)
9716 {
9719 }
9720
9721 actionMap.Insert(this.
Type(), overrideData);
9722
9723 }
9724
9726
9728
9729
9731 {
9734
9737
9738 string config_to_search = "CfgVehicles";
9739 string muzzle_owner_config;
9740
9742 {
9743 if (IsInherited(Weapon))
9744 config_to_search = "CfgWeapons";
9745
9746 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9747
9748 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9749
9751
9752 if (config_OnFire_subclass_count > 0)
9753 {
9754 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9755
9756 for (int i = 0; i < config_OnFire_subclass_count; i++)
9757 {
9758 string particle_class = "";
9760 string config_OnFire_entry = config_OnFire_class + particle_class;
9761 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9762 WPOF_array.Insert(WPOF);
9763 }
9764
9765
9767 }
9768 }
9769
9771 {
9772 config_to_search = "CfgWeapons";
9773 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9774
9775 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9776
9778
9779 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9780 {
9781 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9782
9783 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9784 {
9785 string particle_class2 = "";
9787 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9788 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9789 WPOBE_array.Insert(WPOBE);
9790 }
9791
9792
9794 }
9795 }
9796 }
9797
9798
9800 {
9803
9805 {
9806 string config_to_search = "CfgVehicles";
9807
9808 if (IsInherited(Weapon))
9809 config_to_search = "CfgWeapons";
9810
9811 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9812 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9813
9814 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9815 {
9816
9818
9820 {
9822 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9824 return;
9825 }
9826
9829
9830
9831
9833 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9834
9835 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9836 {
9837 string particle_class = "";
9839 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9841
9842 if (entry_type == CT_CLASS)
9843 {
9844 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9845 WPOOH_array.Insert(WPOF);
9846 }
9847 }
9848
9849
9851 }
9852 }
9853 }
9854
9856 {
9858 }
9859
9861 {
9863 {
9865
9868
9871
9872 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9873 }
9874 }
9875
9877 {
9879 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9880
9882 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9883
9885 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9886
9888 {
9890 }
9891 }
9892
9894 {
9896 }
9897
9899 {
9902 else
9904
9906 {
9909 }
9910 else
9911 {
9914
9917 }
9918
9920 }
9921
9923 {
9925 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9926 }
9927
9929 {
9931 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9933 }
9934
9936 {
9938 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9939 }
9940
9942 {
9945
9946 OverheatingParticle OP = new OverheatingParticle();
9951
9953 }
9954
9956 {
9959
9960 return -1;
9961 }
9962
9964 {
9966 {
9969
9970 for (int i = count; i > 0; --i)
9971 {
9972 int id = i - 1;
9975
9978
9979 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9980 {
9981 if (p)
9982 {
9985 }
9986 }
9987 }
9988 }
9989 }
9990
9992 {
9994 {
9996 {
9997 int id = i - 1;
9999
10000 if (OP)
10001 {
10003
10004 if (p)
10005 {
10007 }
10008
10009 delete OP;
10010 }
10011 }
10012
10015 }
10016 }
10017
10020 {
10021 return 0.0;
10022 }
10023
10024
10026 {
10027 return 250;
10028 }
10029
10031 {
10032 return 0;
10033 }
10034
10037 {
10039 return true;
10040
10041 return false;
10042 }
10043
10046 {
10049
10051 {
10053 }
10054 else
10055 {
10056
10058 }
10059
10061 }
10062
10069 {
10070 return -1;
10071 }
10072
10073
10074
10075
10077 {
10079 {
10081 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10082
10083 if (r_index >= 0)
10084 {
10085 InventoryLocation r_il = new InventoryLocation;
10086 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10087
10088 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10091 {
10092 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10093 }
10095 {
10096 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10097 }
10098
10099 }
10100
10101 player.GetHumanInventory().ClearUserReservedLocation(this);
10102 }
10103
10106 }
10107
10108
10109
10110
10112 {
10113 return ItemBase.m_DebugActionsMask;
10114 }
10115
10117 {
10118 return ItemBase.m_DebugActionsMask & mask;
10119 }
10120
10122 {
10123 ItemBase.m_DebugActionsMask = mask;
10124 }
10125
10127 {
10128 ItemBase.m_DebugActionsMask |= mask;
10129 }
10130
10132 {
10133 ItemBase.m_DebugActionsMask &= ~mask;
10134 }
10135
10137 {
10139 {
10141 }
10142 else
10143 {
10145 }
10146 }
10147
10148
10150 {
10151 if (GetEconomyProfile())
10152 {
10153 float q_max = GetEconomyProfile().GetQuantityMax();
10154 if (q_max > 0)
10155 {
10156 float q_min = GetEconomyProfile().GetQuantityMin();
10157 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10158
10160 {
10161 ComponentEnergyManager comp = GetCompEM();
10163 {
10165 }
10166 }
10168 {
10170
10171 }
10172
10173 }
10174 }
10175 }
10176
10179 {
10180 EntityAI parent = GetHierarchyParent();
10181
10182 if (parent)
10183 {
10184 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10185 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10186 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10187 }
10188 }
10189
10192 {
10193 EntityAI parent = GetHierarchyParent();
10194
10195 if (parent)
10196 {
10197 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10198 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10199 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10200 }
10201 }
10202
10204 {
10205
10206
10207
10208
10210
10212 {
10213 if (ScriptInputUserData.CanStoreInputUserData())
10214 {
10215 ScriptInputUserData ctx = new ScriptInputUserData;
10221 ctx.
Write(use_stack_max);
10224
10226 {
10227 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10228 }
10229 }
10230 }
10231 else if (!
GetGame().IsMultiplayer())
10232 {
10234 }
10235 }
10236
10238 {
10240 }
10241
10243 {
10245 }
10246
10248 {
10250 }
10251
10253 {
10254
10255 return false;
10256 }
10257
10259 {
10260 return false;
10261 }
10262
10266 {
10267 return false;
10268 }
10269
10271 {
10272 return "";
10273 }
10274
10276
10278 {
10279 return false;
10280 }
10281
10283 {
10284 return true;
10285 }
10286
10287
10288
10290 {
10291 return true;
10292 }
10293
10295 {
10296 return true;
10297 }
10298
10300 {
10301 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10303 }
10304
10306 {
10308 }
10309
10311 {
10313 if (!is_being_placed)
10315 SetSynchDirty();
10316 }
10317
10318
10320
10322 {
10324 }
10325
10327 {
10329 }
10330
10332 {
10333 return 1;
10334 }
10335
10337 {
10338 return false;
10339 }
10340
10342 {
10344 SetSynchDirty();
10345 }
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10382 {
10383 super.OnMovedInsideCargo(container);
10384
10385 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10386 }
10387
10388 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10389 {
10390 super.EEItemLocationChanged(oldLoc,newLoc);
10391
10392 PlayerBase new_player = null;
10393 PlayerBase old_player = null;
10394
10395 if (newLoc.GetParent())
10396 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10397
10398 if (oldLoc.GetParent())
10399 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10400
10402 {
10403 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10404
10405 if (r_index >= 0)
10406 {
10407 InventoryLocation r_il = new InventoryLocation;
10408 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10409
10410 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10413 {
10414 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10415 }
10417 {
10418 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10419 }
10420
10421 }
10422 }
10423
10425 {
10426 if (new_player)
10427 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10428
10429 if (new_player == old_player)
10430 {
10431
10432 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10433 {
10435 {
10436 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10437 {
10438 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10439 }
10440 }
10441 else
10442 {
10443 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10444 }
10445 }
10446
10447 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10448 {
10449 int type = oldLoc.GetType();
10451 {
10452 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10453 }
10455 {
10456 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10457 }
10458 }
10459 if (!m_OldLocation)
10460 {
10461 m_OldLocation = new InventoryLocation;
10462 }
10463 m_OldLocation.Copy(oldLoc);
10464 }
10465 else
10466 {
10467 if (m_OldLocation)
10468 {
10469 m_OldLocation.Reset();
10470 }
10471 }
10472
10474 }
10475 else
10476 {
10477 if (new_player)
10478 {
10479 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10480 if (res_index >= 0)
10481 {
10482 InventoryLocation il = new InventoryLocation;
10483 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10485 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10488 {
10489 il.
GetParent().GetOnReleaseLock().Invoke(it);
10490 }
10492 {
10494 }
10495
10496 }
10497 }
10499 {
10500
10502 }
10503
10504 if (m_OldLocation)
10505 {
10506 m_OldLocation.Reset();
10507 }
10508 }
10509 }
10510
10511 override void EOnContact(IEntity other, Contact extra)
10512 {
10514 {
10515 int liquidType = -1;
10517 if (impactSpeed > 0.0)
10518 {
10520 #ifndef SERVER
10522 #else
10524 SetSynchDirty();
10525 #endif
10527 }
10528 }
10529
10530 #ifdef SERVER
10531 if (GetCompEM() && GetCompEM().IsPlugged())
10532 {
10533 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10534 GetCompEM().UnplugThis();
10535 }
10536 #endif
10537 }
10538
10540
10542 {
10544 }
10545
10547 {
10548
10549 }
10550
10552 {
10553 super.OnItemLocationChanged(old_owner, new_owner);
10554
10555 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10556 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10557
10558 if (!relatedPlayer && playerNew)
10559 relatedPlayer = playerNew;
10560
10561 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10562 {
10564 if (actionMgr)
10565 {
10566 ActionBase currentAction = actionMgr.GetRunningAction();
10567 if (currentAction)
10569 }
10570 }
10571
10572 Man ownerPlayerOld = null;
10573 Man ownerPlayerNew = null;
10574
10575 if (old_owner)
10576 {
10577 if (old_owner.
IsMan())
10578 {
10579 ownerPlayerOld = Man.Cast(old_owner);
10580 }
10581 else
10582 {
10583 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10584 }
10585 }
10586 else
10587 {
10589 {
10591
10592 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10593 {
10594 GetCompEM().UnplugThis();
10595 }
10596 }
10597 }
10598
10599 if (new_owner)
10600 {
10601 if (new_owner.
IsMan())
10602 {
10603 ownerPlayerNew = Man.Cast(new_owner);
10604 }
10605 else
10606 {
10607 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10608 }
10609 }
10610
10611 if (ownerPlayerOld != ownerPlayerNew)
10612 {
10613 if (ownerPlayerOld)
10614 {
10615 array<EntityAI> subItemsExit = new array<EntityAI>;
10617 for (int i = 0; i < subItemsExit.Count(); i++)
10618 {
10621 }
10622 }
10623
10624 if (ownerPlayerNew)
10625 {
10626 array<EntityAI> subItemsEnter = new array<EntityAI>;
10628 for (int j = 0; j < subItemsEnter.Count(); j++)
10629 {
10632 }
10633 }
10634 }
10635 else if (ownerPlayerNew != null)
10636 {
10637 PlayerBase nplayer;
10638 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10639 {
10640 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10642 for (int k = 0; k < subItemsUpdate.Count(); k++)
10643 {
10645 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10646 }
10647 }
10648 }
10649
10650 if (old_owner)
10651 old_owner.OnChildItemRemoved(this);
10652 if (new_owner)
10653 new_owner.OnChildItemReceived(this);
10654 }
10655
10656
10658 {
10659 super.EEDelete(parent);
10660 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10661 if (player)
10662 {
10664
10665 if (player.IsAlive())
10666 {
10667 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10668 if (r_index >= 0)
10669 {
10670 InventoryLocation r_il = new InventoryLocation;
10671 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10672
10673 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10676 {
10677 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10678 }
10680 {
10681 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10682 }
10683
10684 }
10685
10686 player.RemoveQuickBarEntityShortcut(this);
10687 }
10688 }
10689 }
10690
10692 {
10693 super.EEKilled(killer);
10694
10697 {
10698 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10699 {
10700 if (IsMagazine())
10701 {
10702 if (Magazine.Cast(this).GetAmmoCount() > 0)
10703 {
10705 }
10706 }
10707 else
10708 {
10710 }
10711 }
10712 }
10713 }
10714
10716 {
10717 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10718
10719 super.OnWasAttached(parent, slot_id);
10720
10723
10725 }
10726
10728 {
10729 super.OnWasDetached(parent, slot_id);
10730
10733 }
10734
10736 {
10737 int idx;
10740
10741 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10742 if (inventory_slots.Count() < 1)
10743 {
10744 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10745 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10746 }
10747 else
10748 {
10749 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10750 }
10751
10752 idx = inventory_slots.Find(slot);
10753 if (idx < 0)
10754 return "";
10755
10756 return attach_types.Get(idx);
10757 }
10758
10760 {
10761 int idx = -1;
10762 string slot;
10763
10766
10767 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10768 if (inventory_slots.Count() < 1)
10769 {
10770 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10771 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10772 }
10773 else
10774 {
10775 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10776 if (detach_types.Count() < 1)
10777 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10778 }
10779
10780 for (int i = 0; i < inventory_slots.Count(); i++)
10781 {
10782 slot = inventory_slots.Get(i);
10783 }
10784
10785 if (slot != "")
10786 {
10787 if (detach_types.Count() == 1)
10788 idx = 0;
10789 else
10790 idx = inventory_slots.Find(slot);
10791 }
10792 if (idx < 0)
10793 return "";
10794
10795 return detach_types.Get(idx);
10796 }
10797
10799 {
10800
10802
10803
10804 float min_time = 1;
10805 float max_time = 3;
10806 float delay = Math.RandomFloat(min_time, max_time);
10807
10808 explode_timer.Run(delay, this, "DoAmmoExplosion");
10809 }
10810
10812 {
10813 Magazine magazine = Magazine.Cast(this);
10814 int pop_sounds_count = 6;
10815 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10816
10817
10818 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10819 string sound_name = pop_sounds[ sound_idx ];
10821
10822
10823 magazine.ServerAddAmmoCount(-1);
10824
10825
10826 float min_temp_to_explode = 100;
10827
10828 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10829 {
10831 }
10832 }
10833
10834
10835 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10836 {
10837 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10838
10839 const int CHANCE_DAMAGE_CARGO = 4;
10840 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10841 const int CHANCE_DAMAGE_NOTHING = 2;
10842
10844 {
10845 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10846 int chances;
10847 int rnd;
10848
10849 if (GetInventory().GetCargo())
10850 {
10851 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10852 rnd = Math.RandomInt(0,chances);
10853
10854 if (rnd < CHANCE_DAMAGE_CARGO)
10855 {
10857 }
10858 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10859 {
10861 }
10862 }
10863 else
10864 {
10865 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10866 rnd = Math.RandomInt(0,chances);
10867
10868 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10869 {
10871 }
10872 }
10873 }
10874 }
10875
10877 {
10878 if (GetInventory().GetCargo())
10879 {
10880 int item_count = GetInventory().GetCargo().GetItemCount();
10881 if (item_count > 0)
10882 {
10883 int random_pick = Math.RandomInt(0, item_count);
10885 if (!item.IsExplosive())
10886 {
10887 item.AddHealth("","",damage);
10888 return true;
10889 }
10890 }
10891 }
10892 return false;
10893 }
10894
10896 {
10897 int attachment_count = GetInventory().AttachmentCount();
10898 if (attachment_count > 0)
10899 {
10900 int random_pick = Math.RandomInt(0, attachment_count);
10901 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10902 if (!attachment.IsExplosive())
10903 {
10904 attachment.AddHealth("","",damage);
10905 return true;
10906 }
10907 }
10908 return false;
10909 }
10910
10912 {
10914 }
10915
10917 {
10919 return GetInventory().CanRemoveEntity();
10920
10921 return false;
10922 }
10923
10925 {
10926
10928 return false;
10929
10930
10932 return false;
10933
10934
10935
10937 if (delta == 0)
10938 return false;
10939
10940
10941 return true;
10942 }
10943
10945 {
10947 {
10948 if (ScriptInputUserData.CanStoreInputUserData())
10949 {
10950 ScriptInputUserData ctx = new ScriptInputUserData;
10955 ctx.
Write(destination_entity);
10957 ctx.
Write(slot_id);
10959 }
10960 }
10961 else if (!
GetGame().IsMultiplayer())
10962 {
10964 }
10965 }
10966
10968 {
10969 float split_quantity_new;
10973 InventoryLocation loc = new InventoryLocation;
10974
10975 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10976 {
10978 split_quantity_new = stack_max;
10979 else
10981
10983 {
10984 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10985 if (new_item)
10986 {
10987 new_item.SetResultOfSplit(true);
10988 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10990 new_item.
SetQuantity(split_quantity_new,
false,
true);
10991 }
10992 }
10993 }
10994 else if (destination_entity && slot_id == -1)
10995 {
10996 if (quantity > stack_max)
10997 split_quantity_new = stack_max;
10998 else
10999 split_quantity_new = quantity;
11000
11002 {
11004 {
11007 }
11008
11009 if (new_item)
11010 {
11011 new_item.SetResultOfSplit(true);
11012 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11014 new_item.
SetQuantity(split_quantity_new,
false,
true);
11015 }
11016 }
11017 }
11018 else
11019 {
11020 if (stack_max != 0)
11021 {
11023 {
11025 }
11026
11027 if (split_quantity_new == 0)
11028 {
11029 if (!
GetGame().IsMultiplayer())
11030 player.PhysicalPredictiveDropItem(this);
11031 else
11032 player.ServerDropEntity(this);
11033 return;
11034 }
11035
11037 {
11039
11040 if (new_item)
11041 {
11042 new_item.SetResultOfSplit(true);
11043 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11046 new_item.PlaceOnSurface();
11047 }
11048 }
11049 }
11050 }
11051 }
11052
11054 {
11055 float split_quantity_new;
11059 InventoryLocation loc = new InventoryLocation;
11060
11061 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11062 {
11064 split_quantity_new = stack_max;
11065 else
11067
11069 {
11070 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11071 if (new_item)
11072 {
11073 new_item.SetResultOfSplit(true);
11074 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11076 new_item.
SetQuantity(split_quantity_new,
false,
true);
11077 }
11078 }
11079 }
11080 else if (destination_entity && slot_id == -1)
11081 {
11082 if (quantity > stack_max)
11083 split_quantity_new = stack_max;
11084 else
11085 split_quantity_new = quantity;
11086
11088 {
11090 {
11093 }
11094
11095 if (new_item)
11096 {
11097 new_item.SetResultOfSplit(true);
11098 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11100 new_item.
SetQuantity(split_quantity_new,
false,
true);
11101 }
11102 }
11103 }
11104 else
11105 {
11106 if (stack_max != 0)
11107 {
11109 {
11111 }
11112
11114 {
11116
11117 if (new_item)
11118 {
11119 new_item.SetResultOfSplit(true);
11120 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11123 new_item.PlaceOnSurface();
11124 }
11125 }
11126 }
11127 }
11128 }
11129
11131 {
11133 {
11134 if (ScriptInputUserData.CanStoreInputUserData())
11135 {
11136 ScriptInputUserData ctx = new ScriptInputUserData;
11141 dst.WriteToContext(ctx);
11143 }
11144 }
11145 else if (!
GetGame().IsMultiplayer())
11146 {
11148 }
11149 }
11150
11152 {
11154 {
11155 if (ScriptInputUserData.CanStoreInputUserData())
11156 {
11157 ScriptInputUserData ctx = new ScriptInputUserData;
11162 ctx.
Write(destination_entity);
11168 }
11169 }
11170 else if (!
GetGame().IsMultiplayer())
11171 {
11173 }
11174 }
11175
11177 {
11179 }
11180
11182 {
11184 float split_quantity_new;
11186 if (dst.IsValid())
11187 {
11188 int slot_id = dst.GetSlot();
11190
11191 if (quantity > stack_max)
11192 split_quantity_new = stack_max;
11193 else
11194 split_quantity_new = quantity;
11195
11197 {
11199
11200 if (new_item)
11201 {
11202 new_item.SetResultOfSplit(true);
11203 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11205 new_item.
SetQuantity(split_quantity_new,
false,
true);
11206 }
11207
11208 return new_item;
11209 }
11210 }
11211
11212 return null;
11213 }
11214
11216 {
11218 float split_quantity_new;
11220 if (destination_entity)
11221 {
11223 if (quantity > stackable)
11224 split_quantity_new = stackable;
11225 else
11226 split_quantity_new = quantity;
11227
11229 {
11230 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11231 if (new_item)
11232 {
11233 new_item.SetResultOfSplit(true);
11234 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11236 new_item.
SetQuantity(split_quantity_new,
false,
true);
11237 }
11238 }
11239 }
11240 }
11241
11243 {
11245 {
11246 if (ScriptInputUserData.CanStoreInputUserData())
11247 {
11248 ScriptInputUserData ctx = new ScriptInputUserData;
11253 ItemBase destination_entity =
this;
11254 ctx.
Write(destination_entity);
11258 }
11259 }
11260 else if (!
GetGame().IsMultiplayer())
11261 {
11263 }
11264 }
11265
11267 {
11269 float split_quantity_new;
11271 if (player)
11272 {
11274 if (quantity > stackable)
11275 split_quantity_new = stackable;
11276 else
11277 split_quantity_new = quantity;
11278
11280 {
11281 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11282 new_item =
ItemBase.Cast(in_hands);
11283 if (new_item)
11284 {
11285 new_item.SetResultOfSplit(true);
11286 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11288 new_item.SetQuantity(split_quantity_new, false, true);
11289 }
11290 }
11291 }
11292 }
11293
11295 {
11297 float split_quantity_new = Math.Floor(quantity * 0.5);
11298
11300 return;
11301
11303
11304 if (new_item)
11305 {
11306 if (new_item.GetQuantityMax() < split_quantity_new)
11307 {
11308 split_quantity_new = new_item.GetQuantityMax();
11309 }
11310
11311 new_item.SetResultOfSplit(true);
11312 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11313
11315 {
11318 }
11319 else
11320 {
11322 new_item.
SetQuantity(split_quantity_new,
false,
true);
11323 }
11324 }
11325 }
11326
11328 {
11330 float split_quantity_new = Math.Floor(quantity / 2);
11331
11333 return;
11334
11335 InventoryLocation invloc = new InventoryLocation;
11337
11339 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11340
11341 if (new_item)
11342 {
11343 if (new_item.GetQuantityMax() < split_quantity_new)
11344 {
11345 split_quantity_new = new_item.GetQuantityMax();
11346 }
11348 {
11351 }
11352 else if (split_quantity_new > 1)
11353 {
11355 new_item.
SetQuantity(split_quantity_new,
false,
true);
11356 }
11357 }
11358 }
11359
11362 {
11363 SetWeightDirty();
11365
11366 if (parent)
11367 parent.OnAttachmentQuantityChangedEx(this, delta);
11368
11370 {
11372 {
11374 }
11376 {
11377 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11379 }
11380 }
11381
11382 }
11383
11386 {
11387
11388 }
11389
11392 {
11394 }
11395
11397 {
11398 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11399
11401 {
11402 if (newLevel == GameConstants.STATE_RUINED)
11403 {
11405 EntityAI parent = GetHierarchyParent();
11406 if (parent && parent.IsFireplace())
11407 {
11408 CargoBase cargo = GetInventory().GetCargo();
11409 if (cargo)
11410 {
11412 {
11414 }
11415 }
11416 }
11417 }
11418
11420 {
11421
11423 return;
11424 }
11425
11426 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11427 {
11429 }
11430 }
11431 }
11432
11433
11435 {
11436 super.OnRightClick();
11437
11439 {
11441 {
11442 if (ScriptInputUserData.CanStoreInputUserData())
11443 {
11444 EntityAI root = GetHierarchyRoot();
11445 Man playerOwner = GetHierarchyRootPlayer();
11446 InventoryLocation dst = new InventoryLocation;
11447
11448
11449 if (!playerOwner && root && root == this)
11450 {
11452 }
11453 else
11454 {
11455
11456 GetInventory().GetCurrentInventoryLocation(dst);
11458 {
11461 {
11463 }
11464 else
11465 {
11467
11468
11469 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11470 {
11472 }
11473 else
11474 {
11475 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11476 }
11477 }
11478 }
11479 }
11480
11481 ScriptInputUserData ctx = new ScriptInputUserData;
11489 }
11490 }
11491 else if (!
GetGame().IsMultiplayer())
11492 {
11494 }
11495 }
11496 }
11497
11499 {
11500 if (root)
11501 {
11502 vector m4[4];
11503 root.GetTransform(m4);
11504 dst.SetGround(this, m4);
11505 }
11506 else
11507 {
11508 GetInventory().GetCurrentInventoryLocation(dst);
11509 }
11510 }
11511
11512 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11513 {
11514
11515 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11516 return false;
11517
11518 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11519 return false;
11520
11521
11523 return false;
11524
11525
11526 Magazine mag = Magazine.Cast(this);
11527 if (mag)
11528 {
11529 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11530 return false;
11531
11532 if (stack_max_limit)
11533 {
11534 Magazine other_mag = Magazine.Cast(other_item);
11535 if (other_item)
11536 {
11537 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11538 return false;
11539 }
11540
11541 }
11542 }
11543 else
11544 {
11545
11547 return false;
11548
11550 return false;
11551 }
11552
11553 PlayerBase player = null;
11554 if (CastTo(player, GetHierarchyRootPlayer()))
11555 {
11556 if (player.GetInventory().HasAttachment(this))
11557 return false;
11558
11559 if (player.IsItemsToDelete())
11560 return false;
11561 }
11562
11563 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11564 return false;
11565
11566 int slotID;
11568 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11569 return false;
11570
11571 return true;
11572 }
11573
11575 {
11577 }
11578
11580 {
11581 return m_IsResultOfSplit;
11582 }
11583
11585 {
11586 m_IsResultOfSplit = value;
11587 }
11588
11590 {
11592 }
11593
11595 {
11596 float other_item_quantity = other_item.GetQuantity();
11597 float this_free_space;
11598
11600
11602
11603 if (other_item_quantity > this_free_space)
11604 {
11605 return this_free_space;
11606 }
11607 else
11608 {
11609 return other_item_quantity;
11610 }
11611 }
11612
11614 {
11616 }
11617
11619 {
11621 return;
11622
11623 if (!IsMagazine() && other_item)
11624 {
11626 if (quantity_used != 0)
11627 {
11628 float hp1 = GetHealth01("","");
11629 float hp2 = other_item.GetHealth01("","");
11630 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11631 hpResult = hpResult / (
GetQuantity() + quantity_used);
11632
11633 hpResult *= GetMaxHealth();
11634 Math.Round(hpResult);
11635 SetHealth("", "Health", hpResult);
11636
11638 other_item.AddQuantity(-quantity_used);
11639 }
11640 }
11642 }
11643
11645 {
11646 #ifdef SERVER
11647 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11648 GetHierarchyParent().IncreaseLifetimeUp();
11649 #endif
11650 };
11651
11653 {
11654 PlayerBase p = PlayerBase.Cast(player);
11655
11656 array<int> recipesIds = p.m_Recipes;
11657 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11658 if (moduleRecipesManager)
11659 {
11660 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11661 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11662 }
11663
11664 for (int i = 0;i < recipesIds.Count(); i++)
11665 {
11666 int key = recipesIds.Get(i);
11667 string recipeName = moduleRecipesManager.GetRecipeName(key);
11669 }
11670 }
11671
11672
11673 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11674 {
11675 super.GetDebugActions(outputList);
11676
11677
11683
11684
11689
11694
11695
11699
11700
11702 {
11706 }
11707
11710
11711
11715
11717
11718 InventoryLocation loc = new InventoryLocation();
11719 GetInventory().GetCurrentInventoryLocation(loc);
11721 {
11722 if (Gizmo_IsSupported())
11725 }
11726
11728 }
11729
11730
11731
11732
11734 {
11735 super.OnAction(action_id, player, ctx);
11736
11738 {
11739 switch (action_id)
11740 {
11743 return true;
11746 return true;
11747 }
11748 }
11749
11751 {
11752 switch (action_id)
11753 {
11755 Delete();
11756 return true;
11757 }
11758 }
11759
11760 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11761 {
11762 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11763 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11764 PlayerBase p = PlayerBase.Cast(player);
11765 if (
EActions.RECIPES_RANGE_START < 1000)
11766 {
11767 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11768 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11769 }
11770 }
11771 #ifndef SERVER
11772 else if (action_id ==
EActions.WATCH_PLAYER)
11773 {
11774 PluginDeveloper.SetDeveloperItemClientEx(player);
11775 }
11776 #endif
11778 {
11779 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11780 {
11781 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11782 OnDebugButtonPressServer(id + 1);
11783 }
11784
11785 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11786 {
11787 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11789 }
11790
11791 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11792 {
11793 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11795 }
11796
11797 else if (action_id ==
EActions.ADD_QUANTITY)
11798 {
11799 if (IsMagazine())
11800 {
11801 Magazine mag = Magazine.Cast(this);
11802 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11803 }
11804 else
11805 {
11807 }
11808
11809 if (m_EM)
11810 {
11811 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11812 }
11813
11814 }
11815
11816 else if (action_id ==
EActions.REMOVE_QUANTITY)
11817 {
11818 if (IsMagazine())
11819 {
11820 Magazine mag2 = Magazine.Cast(this);
11821 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11822 }
11823 else
11824 {
11826 }
11827 if (m_EM)
11828 {
11829 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11830 }
11831
11832 }
11833
11834 else if (action_id ==
EActions.SET_QUANTITY_0)
11835 {
11837
11838 if (m_EM)
11839 {
11840 m_EM.SetEnergy(0);
11841 }
11842 }
11843
11844 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11845 {
11847
11848 if (m_EM)
11849 {
11850 m_EM.SetEnergy(m_EM.GetEnergyMax());
11851 }
11852 }
11853
11854 else if (action_id ==
EActions.ADD_HEALTH)
11855 {
11856 AddHealth("","",GetMaxHealth("","Health")/5);
11857 }
11858 else if (action_id ==
EActions.REMOVE_HEALTH)
11859 {
11860 AddHealth("","",-GetMaxHealth("","Health")/5);
11861 }
11862 else if (action_id ==
EActions.DESTROY_HEALTH)
11863 {
11864 SetHealth01("","",0);
11865 }
11866 else if (action_id ==
EActions.WATCH_ITEM)
11867 {
11869 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11870 #ifdef DEVELOPER
11871 SetDebugDeveloper_item(this);
11872 #endif
11873 }
11874
11875 else if (action_id ==
EActions.ADD_TEMPERATURE)
11876 {
11877 AddTemperature(20);
11878
11879 }
11880
11881 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11882 {
11883 AddTemperature(-20);
11884
11885 }
11886
11887 else if (action_id ==
EActions.FLIP_FROZEN)
11888 {
11889 SetFrozen(!GetIsFrozen());
11890
11891 }
11892
11893 else if (action_id ==
EActions.ADD_WETNESS)
11894 {
11896
11897 }
11898
11899 else if (action_id ==
EActions.REMOVE_WETNESS)
11900 {
11902
11903 }
11904
11905 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11906 {
11909
11910
11911 }
11912
11913 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11914 {
11917 }
11918
11919 else if (action_id ==
EActions.MAKE_SPECIAL)
11920 {
11921 auto debugParams = DebugSpawnParams.WithPlayer(player);
11922 OnDebugSpawnEx(debugParams);
11923 }
11924
11925 }
11926
11927
11928 return false;
11929 }
11930
11931
11932
11933
11937
11940
11941
11942
11944 {
11945 return false;
11946 }
11947
11948
11950 {
11951 return true;
11952 }
11953
11954
11956 {
11957 return true;
11958 }
11959
11960
11961
11963 {
11964 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11966 }
11967
11970 {
11971 return null;
11972 }
11973
11975 {
11976 return false;
11977 }
11978
11980 {
11981 return false;
11982 }
11983
11987
11988
11990 {
11991 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11992 return module_repairing.CanRepair(this, item_repair_kit);
11993 }
11994
11995
11996 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11997 {
11998 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11999 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12000 }
12001
12002
12004 {
12005
12006
12007
12008
12009
12010
12011
12012
12013 return 1;
12014 }
12015
12016
12017
12019 {
12021 }
12022
12023
12024
12026 {
12028 }
12029
12030
12039 {
12040 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12041
12042 if (player)
12043 {
12044 player.MessageStatus(text);
12045 }
12046 }
12047
12048
12057 {
12058 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12059
12060 if (player)
12061 {
12062 player.MessageAction(text);
12063 }
12064 }
12065
12066
12075 {
12076 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12077
12078 if (player)
12079 {
12080 player.MessageFriendly(text);
12081 }
12082 }
12083
12084
12093 {
12094 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12095
12096 if (player)
12097 {
12098 player.MessageImportant(text);
12099 }
12100 }
12101
12103 {
12104 return true;
12105 }
12106
12107
12108 override bool KindOf(
string tag)
12109 {
12110 bool found = false;
12111 string item_name = this.
GetType();
12114
12115 int array_size = item_tag_array.Count();
12116 for (int i = 0; i < array_size; i++)
12117 {
12118 if (item_tag_array.Get(i) == tag)
12119 {
12120 found = true;
12121 break;
12122 }
12123 }
12124 return found;
12125 }
12126
12127
12129 {
12130
12131 super.OnRPC(sender, rpc_type,ctx);
12132
12133
12134 switch (rpc_type)
12135 {
12136 #ifndef SERVER
12137 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12138 Param2<bool, string> p = new Param2<bool, string>(false, "");
12139
12141 return;
12142
12143 bool play = p.param1;
12144 string soundSet = p.param2;
12145
12146 if (play)
12147 {
12149 {
12151 {
12153 }
12154 }
12155 else
12156 {
12158 }
12159 }
12160 else
12161 {
12163 }
12164
12165 break;
12166 #endif
12167
12168 }
12169
12171 {
12173 }
12174 }
12175
12176
12177
12178
12180 {
12181 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12182 return plugin.GetID(
name);
12183 }
12184
12186 {
12187 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12188 return plugin.GetName(id);
12189 }
12190
12193 {
12194
12195
12196 int varFlags;
12197 if (!ctx.
Read(varFlags))
12198 return;
12199
12200 if (varFlags & ItemVariableFlags.FLOAT)
12201 {
12203 }
12204 }
12205
12207 {
12208
12209 super.SerializeNumericalVars(floats_out);
12210
12211
12212
12214 {
12216 }
12217
12219 {
12221 }
12222
12224 {
12226 }
12227
12229 {
12234 }
12235
12237 {
12239 }
12240 }
12241
12243 {
12244
12245 super.DeSerializeNumericalVars(floats);
12246
12247
12248 int index = 0;
12249 int mask = Math.Round(floats.Get(index));
12250
12251 index++;
12252
12254 {
12256 {
12258 }
12259 else
12260 {
12261 float quantity = floats.Get(index);
12262 SetQuantity(quantity,
true,
false,
false,
false);
12263 }
12264 index++;
12265 }
12266
12268 {
12269 float wet = floats.Get(index);
12271 index++;
12272 }
12273
12275 {
12276 int liquidtype = Math.Round(floats.Get(index));
12278 index++;
12279 }
12280
12282 {
12284 index++;
12286 index++;
12288 index++;
12290 index++;
12291 }
12292
12294 {
12295 int cleanness = Math.Round(floats.Get(index));
12297 index++;
12298 }
12299 }
12300
12302 {
12303 super.WriteVarsToCTX(ctx);
12304
12305
12307 {
12309 }
12310
12312 {
12314 }
12315
12317 {
12319 }
12320
12322 {
12323 int r,g,b,a;
12329 }
12330
12332 {
12334 }
12335 }
12336
12338 {
12339 if (!super.ReadVarsFromCTX(ctx,version))
12340 return false;
12341
12342 int intValue;
12343 float value;
12344
12345 if (version < 140)
12346 {
12347 if (!ctx.
Read(intValue))
12348 return false;
12349
12350 m_VariablesMask = intValue;
12351 }
12352
12354 {
12355 if (!ctx.
Read(value))
12356 return false;
12357
12359 {
12361 }
12362 else
12363 {
12365 }
12366 }
12367
12368 if (version < 140)
12369 {
12371 {
12372 if (!ctx.
Read(value))
12373 return false;
12374 SetTemperatureDirect(value);
12375 }
12376 }
12377
12379 {
12380 if (!ctx.
Read(value))
12381 return false;
12383 }
12384
12386 {
12387 if (!ctx.
Read(intValue))
12388 return false;
12390 }
12391
12393 {
12394 int r,g,b,a;
12396 return false;
12398 return false;
12400 return false;
12402 return false;
12403
12405 }
12406
12408 {
12409 if (!ctx.
Read(intValue))
12410 return false;
12412 }
12413
12414 if (version >= 138 && version < 140)
12415 {
12417 {
12418 if (!ctx.
Read(intValue))
12419 return false;
12420 SetFrozen(intValue);
12421 }
12422 }
12423
12424 return true;
12425 }
12426
12427
12429 {
12432 {
12434 }
12435
12436 if (!super.OnStoreLoad(ctx, version))
12437 {
12439 return false;
12440 }
12441
12442 if (version >= 114)
12443 {
12444 bool hasQuickBarIndexSaved;
12445
12446 if (!ctx.
Read(hasQuickBarIndexSaved))
12447 {
12449 return false;
12450 }
12451
12452 if (hasQuickBarIndexSaved)
12453 {
12454 int itmQBIndex;
12455
12456
12457 if (!ctx.
Read(itmQBIndex))
12458 {
12460 return false;
12461 }
12462
12463 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12464 if (itmQBIndex != -1 && parentPlayer)
12465 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12466 }
12467 }
12468 else
12469 {
12470
12471 PlayerBase player;
12472 int itemQBIndex;
12473 if (version ==
int.
MAX)
12474 {
12475 if (!ctx.
Read(itemQBIndex))
12476 {
12478 return false;
12479 }
12480 }
12481 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12482 {
12483
12484 if (!ctx.
Read(itemQBIndex))
12485 {
12487 return false;
12488 }
12489 if (itemQBIndex != -1 && player)
12490 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12491 }
12492 }
12493
12494 if (version < 140)
12495 {
12496
12497 if (!LoadVariables(ctx, version))
12498 {
12500 return false;
12501 }
12502 }
12503
12504
12506 {
12508 return false;
12509 }
12510 if (version >= 132)
12511 {
12513 if (raib)
12514 {
12516 {
12518 return false;
12519 }
12520 }
12521 }
12522
12524 return true;
12525 }
12526
12527
12528
12530 {
12531 super.OnStoreSave(ctx);
12532
12533 PlayerBase player;
12534 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12535 {
12537
12538 int itemQBIndex = -1;
12539 itemQBIndex = player.FindQuickBarEntityIndex(this);
12540 ctx.
Write(itemQBIndex);
12541 }
12542 else
12543 {
12545 }
12546
12548
12550 if (raib)
12551 {
12553 }
12554 }
12555
12556
12558 {
12559 super.AfterStoreLoad();
12560
12562 {
12564 }
12565
12567 {
12570 }
12571 }
12572
12574 {
12575 super.EEOnAfterLoad();
12576
12578 {
12580 }
12581
12584 }
12585
12587 {
12588 return false;
12589 }
12590
12591
12592
12594 {
12596 {
12597 #ifdef PLATFORM_CONSOLE
12598
12600 {
12602 if (menu)
12603 {
12605 }
12606 }
12607 #endif
12608 }
12609
12611 {
12614 }
12615
12617 {
12618 SetWeightDirty();
12620 }
12622 {
12625 }
12626
12628 {
12631 }
12633 {
12636 }
12637
12638 super.OnVariablesSynchronized();
12639 }
12640
12641
12642
12644 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12645 {
12646 if (!IsServerCheck(allow_client))
12647 return false;
12648
12650 return false;
12651
12654
12655 if (value <= (min + 0.001))
12656 value = min;
12657
12658 if (value == min)
12659 {
12660 if (destroy_config)
12661 {
12662 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12663 if (dstr)
12664 {
12666 this.Delete();
12667 return true;
12668 }
12669 }
12670 else if (destroy_forced)
12671 {
12673 this.Delete();
12674 return true;
12675 }
12676
12678 }
12679
12682
12684 {
12686
12687 if (delta)
12689 }
12690
12692
12693 return false;
12694 }
12695
12696
12698 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12699 {
12701 }
12702
12704 {
12707 }
12708
12710 {
12713 }
12714
12716 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12717 {
12718 float value_clamped = Math.Clamp(value, 0, 1);
12720 SetQuantity(result, destroy_config, destroy_forced);
12721 }
12722
12723
12726 {
12728 }
12729
12731 {
12733 }
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12745 {
12746 int slot = -1;
12747 if (GetInventory())
12748 {
12749 InventoryLocation il = new InventoryLocation;
12750 GetInventory().GetCurrentInventoryLocation(il);
12752 }
12753
12755 }
12756
12758 {
12759 float quantity_max = 0;
12760
12762 {
12763 if (attSlotID != -1)
12764 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12765
12766 if (quantity_max <= 0)
12768 }
12769
12770 if (quantity_max <= 0)
12772
12773 return quantity_max;
12774 }
12775
12777 {
12779 }
12780
12782 {
12784 }
12785
12786
12788 {
12790 }
12791
12793 {
12795 }
12796
12798 {
12800 }
12801
12802
12804 {
12805
12806 float weightEx = GetWeightEx();
12807 float special = GetInventoryAndCargoWeight();
12808 return weightEx - special;
12809 }
12810
12811
12813 {
12815 }
12816
12818 {
12820 {
12821 #ifdef DEVELOPER
12822 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12823 {
12824 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12826 }
12827 #endif
12828
12829 return GetQuantity() * GetConfigWeightModified();
12830 }
12831 else if (HasEnergyManager())
12832 {
12833 #ifdef DEVELOPER
12834 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12835 {
12836 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12837 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12838 }
12839 #endif
12840 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12841 }
12842 else
12843 {
12844 #ifdef DEVELOPER
12845 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12846 {
12847 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12848 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12849 }
12850 #endif
12851 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12852 }
12853 }
12854
12857 {
12858 int item_count = 0;
12860
12861 if (GetInventory().GetCargo() != NULL)
12862 {
12863 item_count = GetInventory().GetCargo().GetItemCount();
12864 }
12865
12866 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12867 {
12868 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12869 if (item)
12870 item_count += item.GetNumberOfItems();
12871 }
12872 return item_count;
12873 }
12874
12877 {
12878 float weight = 0;
12879 float wetness = 1;
12880 if (include_wetness)
12883 {
12884 weight = wetness * m_ConfigWeight;
12885 }
12887 {
12888 weight = 1;
12889 }
12890 return weight;
12891 }
12892
12893
12894
12896 {
12897 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12898 {
12899 GameInventory inv = GetInventory();
12900 array<EntityAI> items = new array<EntityAI>;
12902 for (int i = 0; i < items.Count(); i++)
12903 {
12905 if (item)
12906 {
12908 }
12909 }
12910 }
12911 }
12912
12913
12914
12915
12917 {
12918 float energy = 0;
12919 if (HasEnergyManager())
12920 {
12921 energy = GetCompEM().GetEnergy();
12922 }
12923 return energy;
12924 }
12925
12926
12928 {
12929 super.OnEnergyConsumed();
12930
12932 }
12933
12935 {
12936 super.OnEnergyAdded();
12937
12939 }
12940
12941
12943 {
12944 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12945 {
12947 {
12948 float energy_0to1 = GetCompEM().GetEnergy0To1();
12950 }
12951 }
12952 }
12953
12954
12956 {
12957 return ConfigGetFloat("heatIsolation");
12958 }
12959
12961 {
12963 }
12964
12966 {
12967 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12968 if (
GetGame().ConfigIsExisting(paramPath))
12970
12971 return 0.0;
12972 }
12973
12975 {
12976 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12977 if (
GetGame().ConfigIsExisting(paramPath))
12979
12980 return 0.0;
12981 }
12982
12983 override void SetWet(
float value,
bool allow_client =
false)
12984 {
12985 if (!IsServerCheck(allow_client))
12986 return;
12987
12990
12992
12993 m_VarWet = Math.Clamp(value, min, max);
12994
12996 {
12999 }
13000 }
13001
13002 override void AddWet(
float value)
13003 {
13005 }
13006
13008 {
13010 }
13011
13013 {
13015 }
13016
13018 {
13020 }
13021
13023 {
13025 }
13026
13028 {
13030 }
13031
13032 override void OnWetChanged(
float newVal,
float oldVal)
13033 {
13036 if (newLevel != oldLevel)
13037 {
13039 }
13040 }
13041
13043 {
13044 SetWeightDirty();
13045 }
13046
13048 {
13049 return GetWetLevelInternal(
m_VarWet);
13050 }
13051
13052
13053
13055 {
13057 }
13058
13060 {
13062 }
13063
13065 {
13067 }
13068
13070 {
13072 }
13073
13074
13075
13077 {
13078 if (ConfigIsExisting("itemModelLength"))
13079 {
13080 return ConfigGetFloat("itemModelLength");
13081 }
13082 return 0;
13083 }
13084
13086 {
13087 if (ConfigIsExisting("itemAttachOffset"))
13088 {
13089 return ConfigGetFloat("itemAttachOffset");
13090 }
13091 return 0;
13092 }
13093
13094 override void SetCleanness(
int value,
bool allow_client =
false)
13095 {
13096 if (!IsServerCheck(allow_client))
13097 return;
13098
13100
13102
13105 }
13106
13108 {
13110 }
13111
13113 {
13114 return true;
13115 }
13116
13117
13118
13119
13121 {
13123 }
13124
13126 {
13128 }
13129
13130
13131
13132
13133 override void SetColor(
int r,
int g,
int b,
int a)
13134 {
13140 }
13142 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13143 {
13148 }
13149
13151 {
13153 }
13154
13157 {
13158 int r,g,b,a;
13160 r = r/255;
13161 g = g/255;
13162 b = b/255;
13163 a = a/255;
13164 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13165 }
13166
13167
13168
13169 override void SetLiquidType(
int value,
bool allow_client =
false)
13170 {
13171 if (!IsServerCheck(allow_client))
13172 return;
13173
13178 }
13179
13181 {
13182 return ConfigGetInt("varLiquidTypeInit");
13183 }
13184
13186 {
13188 }
13189
13191 {
13193 SetFrozen(false);
13194 }
13195
13198 {
13199 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13200 }
13201
13202
13205 {
13206 PlayerBase nplayer;
13207 if (PlayerBase.CastTo(nplayer, player))
13208 {
13210
13211 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13212 }
13213 }
13214
13215
13218 {
13219 PlayerBase nplayer;
13220 if (PlayerBase.CastTo(nplayer,player))
13221 {
13222
13223 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13224
13225 }
13226
13227
13228 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13229
13230
13231 if (HasEnergyManager())
13232 {
13233 GetCompEM().UpdatePlugState();
13234 }
13235 }
13236
13237
13239 {
13240 super.OnPlacementStarted(player);
13241
13243 }
13244
13245 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13246 {
13248 {
13249 m_AdminLog.OnPlacementComplete(player,
this);
13250 }
13251
13252 super.OnPlacementComplete(player, position, orientation);
13253 }
13254
13255
13256
13257
13258
13260 {
13262 {
13263 return true;
13264 }
13265 else
13266 {
13267 return false;
13268 }
13269 }
13270
13271
13273 {
13275 {
13277 }
13278 }
13279
13280
13282 {
13284 }
13285
13287 {
13289 }
13290
13291 override void InsertAgent(
int agent,
float count = 1)
13292 {
13293 if (count < 1)
13294 return;
13295
13297 }
13298
13301 {
13303 }
13304
13305
13307 {
13309 }
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13353 {
13355 return false;
13356 return true;
13357 }
13358
13360 {
13361
13363 }
13364
13365
13368 {
13369 super.CheckForRoofLimited(timeTresholdMS);
13370
13372 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13373 {
13374 m_PreviousRoofTestTime = time;
13375 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13376 }
13377 }
13378
13379
13381 {
13383 {
13384 return 0;
13385 }
13386
13387 if (GetInventory().GetAttachmentSlotsCount() != 0)
13388 {
13389 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13390 if (filter)
13391 return filter.GetProtectionLevel(type, false, system);
13392 else
13393 return 0;
13394 }
13395
13396 string subclassPath, entryName;
13397
13398 switch (type)
13399 {
13401 entryName = "biological";
13402 break;
13404 entryName = "chemical";
13405 break;
13406 default:
13407 entryName = "biological";
13408 break;
13409 }
13410
13411 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13412
13414 }
13415
13416
13417
13420 {
13421 if (!IsMagazine())
13423
13425 }
13426
13427
13428
13429
13430
13435 {
13436 return true;
13437 }
13438
13440 {
13442 }
13443
13444
13445
13446
13447
13449 {
13450 if (parent)
13451 {
13452 if (parent.IsInherited(DayZInfected))
13453 return true;
13454
13455 if (!parent.IsRuined())
13456 return true;
13457 }
13458
13459 return true;
13460 }
13461
13463 {
13464 if (!super.CanPutAsAttachment(parent))
13465 {
13466 return false;
13467 }
13468
13469 if (!IsRuined() && !parent.IsRuined())
13470 {
13471 return true;
13472 }
13473
13474 return false;
13475 }
13476
13478 {
13479
13480
13481
13482
13483 return super.CanReceiveItemIntoCargo(item);
13484 }
13485
13487 {
13488
13489
13490
13491
13492 GameInventory attachmentInv = attachment.GetInventory();
13494 {
13495 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13496 return false;
13497 }
13498
13499 InventoryLocation loc = new InventoryLocation();
13500 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13501 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13502 return false;
13503
13504 return super.CanReceiveAttachment(attachment, slotId);
13505 }
13506
13508 {
13509 if (!super.CanReleaseAttachment(attachment))
13510 return false;
13511
13512 return GetInventory().AreChildrenAccessible();
13513 }
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13536 {
13537 int id = muzzle_owner.GetMuzzleID();
13538 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13539
13540 if (WPOF_array)
13541 {
13542 for (int i = 0; i < WPOF_array.Count(); i++)
13543 {
13544 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13545
13546 if (WPOF)
13547 {
13548 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13549 }
13550 }
13551 }
13552 }
13553
13554
13556 {
13557 int id = muzzle_owner.GetMuzzleID();
13559
13560 if (WPOBE_array)
13561 {
13562 for (int i = 0; i < WPOBE_array.Count(); i++)
13563 {
13564 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13565
13566 if (WPOBE)
13567 {
13568 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13569 }
13570 }
13571 }
13572 }
13573
13574
13576 {
13577 int id = muzzle_owner.GetMuzzleID();
13578 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13579
13580 if (WPOOH_array)
13581 {
13582 for (int i = 0; i < WPOOH_array.Count(); i++)
13583 {
13584 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13585
13586 if (WPOOH)
13587 {
13588 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13589 }
13590 }
13591 }
13592 }
13593
13594
13596 {
13597 int id = muzzle_owner.GetMuzzleID();
13598 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13599
13600 if (WPOOH_array)
13601 {
13602 for (int i = 0; i < WPOOH_array.Count(); i++)
13603 {
13604 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13605
13606 if (WPOOH)
13607 {
13608 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13609 }
13610 }
13611 }
13612 }
13613
13614
13616 {
13617 int id = muzzle_owner.GetMuzzleID();
13618 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13619
13620 if (WPOOH_array)
13621 {
13622 for (int i = 0; i < WPOOH_array.Count(); i++)
13623 {
13624 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13625
13626 if (WPOOH)
13627 {
13628 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13629 }
13630 }
13631 }
13632 }
13633
13634
13635
13637 {
13639 {
13640 return true;
13641 }
13642
13643 return false;
13644 }
13645
13647 {
13649 {
13650 return true;
13651 }
13652
13653 return false;
13654 }
13655
13657 {
13659 {
13660 return true;
13661 }
13662
13663 return false;
13664 }
13665
13667 {
13668 return false;
13669 }
13670
13673 {
13674 return UATimeSpent.DEFAULT_DEPLOY;
13675 }
13676
13677
13678
13679
13681 {
13683 SetSynchDirty();
13684 }
13685
13687 {
13689 }
13690
13691
13693 {
13694 return false;
13695 }
13696
13699 {
13700 string att_type = "None";
13701
13702 if (ConfigIsExisting("soundAttType"))
13703 {
13704 att_type = ConfigGetString("soundAttType");
13705 }
13706
13708 }
13709
13711 {
13713 }
13714
13715
13716
13717
13718
13724
13726 {
13729
13731 }
13732
13733
13735 {
13737 return;
13738
13740
13743
13746
13747 SoundParameters params = new SoundParameters();
13751 }
13752
13753
13755 {
13757 return;
13758
13760 SetSynchDirty();
13761
13764 }
13765
13766
13768 {
13770 return;
13771
13773 SetSynchDirty();
13774
13777 }
13778
13780 {
13782 }
13783
13785 {
13787 }
13788
13791 {
13792 if (!
GetGame().IsDedicatedServer())
13793 {
13794 if (ConfigIsExisting("attachSoundSet"))
13795 {
13796 string cfg_path = "";
13797 string soundset = "";
13798 string type_name =
GetType();
13799
13802 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13803 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13804
13805 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13806 {
13807 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13808 {
13809 if (cfg_slot_array[i] == slot_type)
13810 {
13811 soundset = cfg_soundset_array[i];
13812 break;
13813 }
13814 }
13815 }
13816
13817 if (soundset != "")
13818 {
13819 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13821 }
13822 }
13823 }
13824 }
13825
13827 {
13828
13829 }
13830
13831 void OnApply(PlayerBase player);
13832
13834 {
13835 return 1.0;
13836 };
13837
13839 {
13841 }
13842
13844 {
13846 }
13847
13849
13851 {
13852 SetDynamicPhysicsLifeTime(0.01);
13854 }
13855
13857 {
13858 array<string> zone_names = new array<string>;
13859 GetDamageZones(zone_names);
13860 for (int i = 0; i < zone_names.Count(); i++)
13861 {
13862 SetHealthMax(zone_names.Get(i),"Health");
13863 }
13864 SetHealthMax("","Health");
13865 }
13866
13869 {
13870 float global_health = GetHealth01("","Health");
13871 array<string> zones = new array<string>;
13872 GetDamageZones(zones);
13873
13874 for (int i = 0; i < zones.Count(); i++)
13875 {
13876 SetHealth01(zones.Get(i),"Health",global_health);
13877 }
13878 }
13879
13882 {
13883 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13884 }
13885
13887 {
13888 if (!hasRootAsPlayer)
13889 {
13890 if (refParentIB)
13891 {
13892
13893 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13894 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13895
13896 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13897 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13898
13901 }
13902 else
13903 {
13904
13907 }
13908 }
13909 }
13910
13912 {
13914 {
13915 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13916 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13917 {
13918 float heatPermCoef = 1.0;
13920 while (ent)
13921 {
13922 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13923 ent = ent.GetHierarchyParent();
13924 }
13925
13926 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13927 }
13928 }
13929 }
13930
13932 {
13933
13934 EntityAI parent = GetHierarchyParent();
13935 if (!parent)
13936 {
13937 hasParent = false;
13938 hasRootAsPlayer = false;
13939 }
13940 else
13941 {
13942 hasParent = true;
13943 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13944 refParentIB =
ItemBase.Cast(parent);
13945 }
13946 }
13947
13948 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13949 {
13950
13951 }
13952
13954 {
13955
13956 return false;
13957 }
13958
13960 {
13961
13962
13963 return false;
13964 }
13965
13967 {
13968
13969 return false;
13970 }
13971
13974 {
13975 return !GetIsFrozen() &&
IsOpen();
13976 }
13977
13979 {
13980 bool hasParent = false, hasRootAsPlayer = false;
13982
13983 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13984 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13985
13986 if (wwtu || foodDecay)
13987 {
13991
13992 if (processWetness || processTemperature || processDecay)
13993 {
13995
13996 if (processWetness)
13997 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13998
13999 if (processTemperature)
14001
14002 if (processDecay)
14003 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14004 }
14005 }
14006 }
14007
14010 {
14012 }
14013
14015 {
14018
14019 return super.GetTemperatureFreezeThreshold();
14020 }
14021
14023 {
14026
14027 return super.GetTemperatureThawThreshold();
14028 }
14029
14031 {
14034
14035 return super.GetItemOverheatThreshold();
14036 }
14037
14039 {
14041 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14042
14043 return super.GetTemperatureFreezeTime();
14044 }
14045
14047 {
14049 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14050
14051 return super.GetTemperatureThawTime();
14052 }
14053
14058
14060 {
14061 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14062 }
14063
14065 {
14066 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14067 }
14068
14071 {
14073 }
14074
14076 {
14078 }
14079
14081 {
14083 }
14084
14087 {
14088 return null;
14089 }
14090
14093 {
14094 return false;
14095 }
14096
14098 {
14100 {
14103 if (!trg)
14104 {
14106 explosive = this;
14107 }
14108
14109 explosive.PairRemote(trg);
14111
14112 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14113 trg.SetPersistentPairID(persistentID);
14114 explosive.SetPersistentPairID(persistentID);
14115
14116 return true;
14117 }
14118 return false;
14119 }
14120
14123 {
14124 float ret = 1.0;
14127 ret *= GetHealth01();
14128
14129 return ret;
14130 }
14131
14132 #ifdef DEVELOPER
14133 override void SetDebugItem()
14134 {
14135 super.SetDebugItem();
14136 _itemBase = this;
14137 }
14138
14140 {
14141 string text = super.GetDebugText();
14142
14144 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14145
14146 return text;
14147 }
14148 #endif
14149
14151 {
14152 return true;
14153 }
14154
14156
14158
14160 {
14163 }
14164
14165
14173
14189}
14190
14192{
14194 if (entity)
14195 {
14196 bool is_item = entity.IsInherited(
ItemBase);
14197 if (is_item && full_quantity)
14198 {
14201 }
14202 }
14203 else
14204 {
14206 return NULL;
14207 }
14208 return entity;
14209}
14210
14212{
14213 if (item)
14214 {
14215 if (health > 0)
14216 item.SetHealth("", "", health);
14217
14218 if (item.CanHaveTemperature())
14219 {
14221 if (item.CanFreeze())
14222 item.SetFrozen(false);
14223 }
14224
14225 if (item.HasEnergyManager())
14226 {
14227 if (quantity >= 0)
14228 {
14229 item.GetCompEM().SetEnergy0To1(quantity);
14230 }
14231 else
14232 {
14234 }
14235 }
14236 else if (item.IsMagazine())
14237 {
14238 Magazine mag = Magazine.Cast(item);
14239 if (quantity >= 0)
14240 {
14241 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14242 }
14243 else
14244 {
14246 }
14247
14248 }
14249 else
14250 {
14251 if (quantity >= 0)
14252 {
14253 item.SetQuantityNormalized(quantity, false);
14254 }
14255 else
14256 {
14258 }
14259
14260 }
14261 }
14262}
14263
14264#ifdef DEVELOPER
14266#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.