9275{
9277 {
9278 return true;
9279 }
9280};
9281
9282
9283
9285{
9289
9291
9294
9295
9296
9297
9298
9307
9313
9318
9323
9344 protected bool m_IsResultOfSplit
9345
9347
9352
9353
9354
9356
9360
9361
9362
9364
9367
9368
9369
9375
9376
9384
9387
9388
9390
9391
9393
9394
9399
9400
9405
9406
9408
9409
9411 {
9416
9417 if (!
GetGame().IsDedicatedServer())
9418 {
9420 {
9422
9424 {
9426 }
9427 }
9428
9431 }
9432
9433 m_OldLocation = null;
9434
9436 {
9438 }
9439
9440 if (ConfigIsExisting("headSelectionsToHide"))
9441 {
9444 }
9445
9447 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9448 {
9450 }
9451
9453
9454 m_IsResultOfSplit = false;
9455
9457 }
9458
9460 {
9461 super.InitItemVariables();
9462
9468 m_Count = ConfigGetInt(
"count");
9469
9472
9477
9480
9485
9497
9501
9502
9505 if (ConfigIsExisting("canBeSplit"))
9506 {
9509 }
9510
9512 if (ConfigIsExisting("itemBehaviour"))
9514
9515
9518 RegisterNetSyncVariableInt("m_VarLiquidType");
9519 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9520
9521 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9522 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9523 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9524
9525 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9526 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9527 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9528 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9529
9530 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9531 RegisterNetSyncVariableBool("m_IsTakeable");
9532 RegisterNetSyncVariableBool("m_IsHologram");
9533
9536 {
9539 }
9540
9542
9544 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9546
9547 }
9548
9550 {
9552 }
9553
9555 {
9558 {
9563 }
9564 }
9565
9566 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9567 {
9569 {
9572 }
9573
9575 }
9576
9578 {
9584 }
9585
9587
9589 {
9591
9592 if (!action)
9593 {
9594 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9595 return;
9596 }
9597
9599 if (!ai)
9600 {
9602 return;
9603 }
9604
9606 if (!action_array)
9607 {
9608 action_array = new array<ActionBase_Basic>;
9610 }
9611 if (LogManager.IsActionLogEnable())
9612 {
9613 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9614 }
9615
9616 if (action_array.Find(action) != -1)
9617 {
9618 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9619 }
9620 else
9621 {
9622 action_array.Insert(action);
9623 }
9624 }
9625
9627 {
9629 ActionBase action = player.GetActionManager().GetAction(actionName);
9632
9633 if (action_array)
9634 {
9635 action_array.RemoveItem(action);
9636 }
9637 }
9638
9639
9640
9642 {
9643 ActionOverrideData overrideData = new ActionOverrideData();
9647
9649 if (!actionMap)
9650 {
9653 }
9654
9655 actionMap.Insert(this.
Type(), overrideData);
9656
9657 }
9658
9660
9662
9663
9665 {
9668
9671
9672 string config_to_search = "CfgVehicles";
9673 string muzzle_owner_config;
9674
9676 {
9677 if (IsInherited(Weapon))
9678 config_to_search = "CfgWeapons";
9679
9680 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9681
9682 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9683
9685
9686 if (config_OnFire_subclass_count > 0)
9687 {
9688 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9689
9690 for (int i = 0; i < config_OnFire_subclass_count; i++)
9691 {
9692 string particle_class = "";
9694 string config_OnFire_entry = config_OnFire_class + particle_class;
9695 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9696 WPOF_array.Insert(WPOF);
9697 }
9698
9699
9701 }
9702 }
9703
9705 {
9706 config_to_search = "CfgWeapons";
9707 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9708
9709 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9710
9712
9713 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9714 {
9715 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9716
9717 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9718 {
9719 string particle_class2 = "";
9721 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9722 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9723 WPOBE_array.Insert(WPOBE);
9724 }
9725
9726
9728 }
9729 }
9730 }
9731
9732
9734 {
9737
9739 {
9740 string config_to_search = "CfgVehicles";
9741
9742 if (IsInherited(Weapon))
9743 config_to_search = "CfgWeapons";
9744
9745 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9746 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9747
9748 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9749 {
9750
9752
9754 {
9756 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9758 return;
9759 }
9760
9763
9764
9765
9767 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9768
9769 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9770 {
9771 string particle_class = "";
9773 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9775
9776 if (entry_type == CT_CLASS)
9777 {
9778 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9779 WPOOH_array.Insert(WPOF);
9780 }
9781 }
9782
9783
9785 }
9786 }
9787 }
9788
9790 {
9792 }
9793
9795 {
9797 {
9799
9802
9805
9806 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9807 }
9808 }
9809
9811 {
9813 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9814
9816 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9817
9819 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9820
9822 {
9824 }
9825 }
9826
9828 {
9830 }
9831
9833 {
9836 else
9838
9840 {
9843 }
9844 else
9845 {
9848
9851 }
9852
9854 }
9855
9857 {
9859 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9860 }
9861
9863 {
9865 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9867 }
9868
9870 {
9872 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9873 }
9874
9876 {
9879
9880 OverheatingParticle OP = new OverheatingParticle();
9885
9887 }
9888
9890 {
9893
9894 return -1;
9895 }
9896
9898 {
9900 {
9903
9904 for (int i = count; i > 0; --i)
9905 {
9906 int id = i - 1;
9909
9912
9913 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9914 {
9915 if (p)
9916 {
9919 }
9920 }
9921 }
9922 }
9923 }
9924
9926 {
9928 {
9930 {
9931 int id = i - 1;
9933
9934 if (OP)
9935 {
9937
9938 if (p)
9939 {
9941 }
9942
9943 delete OP;
9944 }
9945 }
9946
9949 }
9950 }
9951
9954 {
9955 return 0.0;
9956 }
9957
9958
9960 {
9961 return 250;
9962 }
9963
9965 {
9966 return 0;
9967 }
9968
9971 {
9973 return true;
9974
9975 return false;
9976 }
9977
9980 {
9983
9985 {
9987 }
9988 else
9989 {
9990
9992 }
9993
9995 }
9996
10003 {
10004 return -1;
10005 }
10006
10007
10008
10009
10011 {
10013 {
10015 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10016
10017 if (r_index >= 0)
10018 {
10019 InventoryLocation r_il = new InventoryLocation;
10020 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10021
10022 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10025 {
10026 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10027 }
10029 {
10030 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10031 }
10032
10033 }
10034
10035 player.GetHumanInventory().ClearUserReservedLocation(this);
10036 }
10037
10040 }
10041
10042
10043
10044
10046 {
10047 return ItemBase.m_DebugActionsMask;
10048 }
10049
10051 {
10052 return ItemBase.m_DebugActionsMask & mask;
10053 }
10054
10056 {
10057 ItemBase.m_DebugActionsMask = mask;
10058 }
10059
10061 {
10062 ItemBase.m_DebugActionsMask |= mask;
10063 }
10064
10066 {
10067 ItemBase.m_DebugActionsMask &= ~mask;
10068 }
10069
10071 {
10073 {
10075 }
10076 else
10077 {
10079 }
10080 }
10081
10082
10084 {
10085 if (GetEconomyProfile())
10086 {
10087 float q_max = GetEconomyProfile().GetQuantityMax();
10088 if (q_max > 0)
10089 {
10090 float q_min = GetEconomyProfile().GetQuantityMin();
10091 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10092
10094 {
10095 ComponentEnergyManager comp = GetCompEM();
10097 {
10099 }
10100 }
10102 {
10104
10105 }
10106
10107 }
10108 }
10109 }
10110
10113 {
10114 EntityAI parent = GetHierarchyParent();
10115
10116 if (parent)
10117 {
10118 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10119 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10120 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10121 }
10122 }
10123
10126 {
10127 EntityAI parent = GetHierarchyParent();
10128
10129 if (parent)
10130 {
10131 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10132 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10133 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10134 }
10135 }
10136
10138 {
10139
10140
10141
10142
10144
10146 {
10147 if (ScriptInputUserData.CanStoreInputUserData())
10148 {
10149 ScriptInputUserData ctx = new ScriptInputUserData;
10155 ctx.
Write(use_stack_max);
10158
10160 {
10161 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10162 }
10163 }
10164 }
10165 else if (!
GetGame().IsMultiplayer())
10166 {
10168 }
10169 }
10170
10172 {
10174 }
10175
10177 {
10179 }
10180
10182 {
10184 }
10185
10187 {
10188
10189 return false;
10190 }
10191
10193 {
10194 return false;
10195 }
10196
10200 {
10201 return false;
10202 }
10203
10205 {
10206 return "";
10207 }
10208
10210
10212 {
10213 return false;
10214 }
10215
10217 {
10218 return true;
10219 }
10220
10221
10222
10224 {
10225 return true;
10226 }
10227
10229 {
10230 return true;
10231 }
10232
10234 {
10235 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10237 }
10238
10240 {
10242 }
10243
10245 {
10247 if (!is_being_placed)
10249 SetSynchDirty();
10250 }
10251
10252
10254
10256 {
10258 }
10259
10261 {
10263 }
10264
10266 {
10267 return 1;
10268 }
10269
10271 {
10272 return false;
10273 }
10274
10276 {
10278 SetSynchDirty();
10279 }
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10316 {
10317 super.OnMovedInsideCargo(container);
10318
10319 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10320 }
10321
10322 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10323 {
10324 super.EEItemLocationChanged(oldLoc,newLoc);
10325
10326 PlayerBase new_player = null;
10327 PlayerBase old_player = null;
10328
10329 if (newLoc.GetParent())
10330 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10331
10332 if (oldLoc.GetParent())
10333 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10334
10336 {
10337 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10338
10339 if (r_index >= 0)
10340 {
10341 InventoryLocation r_il = new InventoryLocation;
10342 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10343
10344 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10347 {
10348 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10349 }
10351 {
10352 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10353 }
10354
10355 }
10356 }
10357
10359 {
10360 if (new_player)
10361 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10362
10363 if (new_player == old_player)
10364 {
10365
10366 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10367 {
10369 {
10370 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10371 {
10372 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10373 }
10374 }
10375 else
10376 {
10377 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10378 }
10379 }
10380
10381 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10382 {
10383 int type = oldLoc.GetType();
10385 {
10386 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10387 }
10389 {
10390 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10391 }
10392 }
10393 if (!m_OldLocation)
10394 {
10395 m_OldLocation = new InventoryLocation;
10396 }
10397 m_OldLocation.Copy(oldLoc);
10398 }
10399 else
10400 {
10401 if (m_OldLocation)
10402 {
10403 m_OldLocation.Reset();
10404 }
10405 }
10406
10408 }
10409 else
10410 {
10411 if (new_player)
10412 {
10413 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10414 if (res_index >= 0)
10415 {
10416 InventoryLocation il = new InventoryLocation;
10417 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10419 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10422 {
10423 il.
GetParent().GetOnReleaseLock().Invoke(it);
10424 }
10426 {
10428 }
10429
10430 }
10431 }
10433 {
10434
10436 }
10437
10438 if (m_OldLocation)
10439 {
10440 m_OldLocation.Reset();
10441 }
10442 }
10443 }
10444
10445 override void EOnContact(IEntity other, Contact extra)
10446 {
10448 {
10449 int liquidType = -1;
10451 if (impactSpeed > 0.0)
10452 {
10454 #ifndef SERVER
10456 #else
10458 SetSynchDirty();
10459 #endif
10461 }
10462 }
10463
10464 #ifdef SERVER
10465 if (GetCompEM() && GetCompEM().IsPlugged())
10466 {
10467 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10468 GetCompEM().UnplugThis();
10469 }
10470 #endif
10471 }
10472
10474
10476 {
10478 }
10479
10481 {
10482
10483 }
10484
10486 {
10487 super.OnItemLocationChanged(old_owner, new_owner);
10488
10489 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10490 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10491
10492 if (!relatedPlayer && playerNew)
10493 relatedPlayer = playerNew;
10494
10495 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10496 {
10498 if (actionMgr)
10499 {
10500 ActionBase currentAction = actionMgr.GetRunningAction();
10501 if (currentAction)
10503 }
10504 }
10505
10506 Man ownerPlayerOld = null;
10507 Man ownerPlayerNew = null;
10508
10509 if (old_owner)
10510 {
10511 if (old_owner.
IsMan())
10512 {
10513 ownerPlayerOld = Man.Cast(old_owner);
10514 }
10515 else
10516 {
10517 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10518 }
10519 }
10520 else
10521 {
10523 {
10525
10526 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10527 {
10528 GetCompEM().UnplugThis();
10529 }
10530 }
10531 }
10532
10533 if (new_owner)
10534 {
10535 if (new_owner.
IsMan())
10536 {
10537 ownerPlayerNew = Man.Cast(new_owner);
10538 }
10539 else
10540 {
10541 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10542 }
10543 }
10544
10545 if (ownerPlayerOld != ownerPlayerNew)
10546 {
10547 if (ownerPlayerOld)
10548 {
10549 array<EntityAI> subItemsExit = new array<EntityAI>;
10551 for (int i = 0; i < subItemsExit.Count(); i++)
10552 {
10555 }
10556 }
10557
10558 if (ownerPlayerNew)
10559 {
10560 array<EntityAI> subItemsEnter = new array<EntityAI>;
10562 for (int j = 0; j < subItemsEnter.Count(); j++)
10563 {
10566 }
10567 }
10568 }
10569 else if (ownerPlayerNew != null)
10570 {
10571 PlayerBase nplayer;
10572 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10573 {
10574 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10576 for (int k = 0; k < subItemsUpdate.Count(); k++)
10577 {
10579 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10580 }
10581 }
10582 }
10583
10584 if (old_owner)
10585 old_owner.OnChildItemRemoved(this);
10586 if (new_owner)
10587 new_owner.OnChildItemReceived(this);
10588 }
10589
10590
10592 {
10593 super.EEDelete(parent);
10594 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10595 if (player)
10596 {
10598
10599 if (player.IsAlive())
10600 {
10601 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10602 if (r_index >= 0)
10603 {
10604 InventoryLocation r_il = new InventoryLocation;
10605 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10606
10607 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10610 {
10611 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10612 }
10614 {
10615 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10616 }
10617
10618 }
10619
10620 player.RemoveQuickBarEntityShortcut(this);
10621 }
10622 }
10623 }
10624
10626 {
10627 super.EEKilled(killer);
10628
10631 {
10632 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10633 {
10634 if (IsMagazine())
10635 {
10636 if (Magazine.Cast(this).GetAmmoCount() > 0)
10637 {
10639 }
10640 }
10641 else
10642 {
10644 }
10645 }
10646 }
10647 }
10648
10650 {
10651 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10652
10653 super.OnWasAttached(parent, slot_id);
10654
10657
10659 }
10660
10662 {
10663 super.OnWasDetached(parent, slot_id);
10664
10667 }
10668
10670 {
10671 int idx;
10674
10675 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10676 if (inventory_slots.Count() < 1)
10677 {
10678 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10679 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10680 }
10681 else
10682 {
10683 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10684 }
10685
10686 idx = inventory_slots.Find(slot);
10687 if (idx < 0)
10688 return "";
10689
10690 return attach_types.Get(idx);
10691 }
10692
10694 {
10695 int idx = -1;
10696 string slot;
10697
10700
10701 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10702 if (inventory_slots.Count() < 1)
10703 {
10704 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10705 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10706 }
10707 else
10708 {
10709 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10710 if (detach_types.Count() < 1)
10711 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10712 }
10713
10714 for (int i = 0; i < inventory_slots.Count(); i++)
10715 {
10716 slot = inventory_slots.Get(i);
10717 }
10718
10719 if (slot != "")
10720 {
10721 if (detach_types.Count() == 1)
10722 idx = 0;
10723 else
10724 idx = inventory_slots.Find(slot);
10725 }
10726 if (idx < 0)
10727 return "";
10728
10729 return detach_types.Get(idx);
10730 }
10731
10733 {
10734
10736
10737
10738 float min_time = 1;
10739 float max_time = 3;
10740 float delay = Math.RandomFloat(min_time, max_time);
10741
10742 explode_timer.Run(delay, this, "DoAmmoExplosion");
10743 }
10744
10746 {
10747 Magazine magazine = Magazine.Cast(this);
10748 int pop_sounds_count = 6;
10749 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10750
10751
10752 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10753 string sound_name = pop_sounds[ sound_idx ];
10755
10756
10757 magazine.ServerAddAmmoCount(-1);
10758
10759
10760 float min_temp_to_explode = 100;
10761
10762 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10763 {
10765 }
10766 }
10767
10768
10769 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10770 {
10771 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10772
10773 const int CHANCE_DAMAGE_CARGO = 4;
10774 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10775 const int CHANCE_DAMAGE_NOTHING = 2;
10776
10778 {
10779 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10780 int chances;
10781 int rnd;
10782
10783 if (GetInventory().GetCargo())
10784 {
10785 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10786 rnd = Math.RandomInt(0,chances);
10787
10788 if (rnd < CHANCE_DAMAGE_CARGO)
10789 {
10791 }
10792 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10793 {
10795 }
10796 }
10797 else
10798 {
10799 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10800 rnd = Math.RandomInt(0,chances);
10801
10802 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10803 {
10805 }
10806 }
10807 }
10808 }
10809
10811 {
10812 if (GetInventory().GetCargo())
10813 {
10814 int item_count = GetInventory().GetCargo().GetItemCount();
10815 if (item_count > 0)
10816 {
10817 int random_pick = Math.RandomInt(0, item_count);
10819 if (!item.IsExplosive())
10820 {
10821 item.AddHealth("","",damage);
10822 return true;
10823 }
10824 }
10825 }
10826 return false;
10827 }
10828
10830 {
10831 int attachment_count = GetInventory().AttachmentCount();
10832 if (attachment_count > 0)
10833 {
10834 int random_pick = Math.RandomInt(0, attachment_count);
10835 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10836 if (!attachment.IsExplosive())
10837 {
10838 attachment.AddHealth("","",damage);
10839 return true;
10840 }
10841 }
10842 return false;
10843 }
10844
10846 {
10848 }
10849
10851 {
10853 return GetInventory().CanRemoveEntity();
10854
10855 return false;
10856 }
10857
10859 {
10860
10862 return false;
10863
10864
10866 return false;
10867
10868
10869
10871 if (delta == 0)
10872 return false;
10873
10874
10875 return true;
10876 }
10877
10879 {
10881 {
10882 if (ScriptInputUserData.CanStoreInputUserData())
10883 {
10884 ScriptInputUserData ctx = new ScriptInputUserData;
10889 ctx.
Write(destination_entity);
10891 ctx.
Write(slot_id);
10893 }
10894 }
10895 else if (!
GetGame().IsMultiplayer())
10896 {
10898 }
10899 }
10900
10902 {
10903 float split_quantity_new;
10907 InventoryLocation loc = new InventoryLocation;
10908
10909 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10910 {
10912 split_quantity_new = stack_max;
10913 else
10915
10917 {
10918 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10919 if (new_item)
10920 {
10921 new_item.SetResultOfSplit(true);
10922 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10924 new_item.
SetQuantity(split_quantity_new,
false,
true);
10925 }
10926 }
10927 }
10928 else if (destination_entity && slot_id == -1)
10929 {
10930 if (quantity > stack_max)
10931 split_quantity_new = stack_max;
10932 else
10933 split_quantity_new = quantity;
10934
10936 {
10938 {
10941 }
10942
10943 if (new_item)
10944 {
10945 new_item.SetResultOfSplit(true);
10946 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10948 new_item.
SetQuantity(split_quantity_new,
false,
true);
10949 }
10950 }
10951 }
10952 else
10953 {
10954 if (stack_max != 0)
10955 {
10957 {
10959 }
10960
10961 if (split_quantity_new == 0)
10962 {
10963 if (!
GetGame().IsMultiplayer())
10964 player.PhysicalPredictiveDropItem(this);
10965 else
10966 player.ServerDropEntity(this);
10967 return;
10968 }
10969
10971 {
10973
10974 if (new_item)
10975 {
10976 new_item.SetResultOfSplit(true);
10977 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10980 new_item.PlaceOnSurface();
10981 }
10982 }
10983 }
10984 }
10985 }
10986
10988 {
10989 float split_quantity_new;
10993 InventoryLocation loc = new InventoryLocation;
10994
10995 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10996 {
10998 split_quantity_new = stack_max;
10999 else
11001
11003 {
11004 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11005 if (new_item)
11006 {
11007 new_item.SetResultOfSplit(true);
11008 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11010 new_item.
SetQuantity(split_quantity_new,
false,
true);
11011 }
11012 }
11013 }
11014 else if (destination_entity && slot_id == -1)
11015 {
11016 if (quantity > stack_max)
11017 split_quantity_new = stack_max;
11018 else
11019 split_quantity_new = quantity;
11020
11022 {
11024 {
11027 }
11028
11029 if (new_item)
11030 {
11031 new_item.SetResultOfSplit(true);
11032 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11034 new_item.
SetQuantity(split_quantity_new,
false,
true);
11035 }
11036 }
11037 }
11038 else
11039 {
11040 if (stack_max != 0)
11041 {
11043 {
11045 }
11046
11048 {
11050
11051 if (new_item)
11052 {
11053 new_item.SetResultOfSplit(true);
11054 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11057 new_item.PlaceOnSurface();
11058 }
11059 }
11060 }
11061 }
11062 }
11063
11065 {
11067 {
11068 if (ScriptInputUserData.CanStoreInputUserData())
11069 {
11070 ScriptInputUserData ctx = new ScriptInputUserData;
11075 dst.WriteToContext(ctx);
11077 }
11078 }
11079 else if (!
GetGame().IsMultiplayer())
11080 {
11082 }
11083 }
11084
11086 {
11088 {
11089 if (ScriptInputUserData.CanStoreInputUserData())
11090 {
11091 ScriptInputUserData ctx = new ScriptInputUserData;
11096 ctx.
Write(destination_entity);
11102 }
11103 }
11104 else if (!
GetGame().IsMultiplayer())
11105 {
11107 }
11108 }
11109
11111 {
11113 }
11114
11116 {
11118 float split_quantity_new;
11120 if (dst.IsValid())
11121 {
11122 int slot_id = dst.GetSlot();
11124
11125 if (quantity > stack_max)
11126 split_quantity_new = stack_max;
11127 else
11128 split_quantity_new = quantity;
11129
11131 {
11133
11134 if (new_item)
11135 {
11136 new_item.SetResultOfSplit(true);
11137 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11139 new_item.
SetQuantity(split_quantity_new,
false,
true);
11140 }
11141
11142 return new_item;
11143 }
11144 }
11145
11146 return null;
11147 }
11148
11150 {
11152 float split_quantity_new;
11154 if (destination_entity)
11155 {
11157 if (quantity > stackable)
11158 split_quantity_new = stackable;
11159 else
11160 split_quantity_new = quantity;
11161
11163 {
11164 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11165 if (new_item)
11166 {
11167 new_item.SetResultOfSplit(true);
11168 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11170 new_item.
SetQuantity(split_quantity_new,
false,
true);
11171 }
11172 }
11173 }
11174 }
11175
11177 {
11179 {
11180 if (ScriptInputUserData.CanStoreInputUserData())
11181 {
11182 ScriptInputUserData ctx = new ScriptInputUserData;
11187 ItemBase destination_entity =
this;
11188 ctx.
Write(destination_entity);
11192 }
11193 }
11194 else if (!
GetGame().IsMultiplayer())
11195 {
11197 }
11198 }
11199
11201 {
11203 float split_quantity_new;
11205 if (player)
11206 {
11208 if (quantity > stackable)
11209 split_quantity_new = stackable;
11210 else
11211 split_quantity_new = quantity;
11212
11214 {
11215 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11216 new_item =
ItemBase.Cast(in_hands);
11217 if (new_item)
11218 {
11219 new_item.SetResultOfSplit(true);
11220 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11222 new_item.SetQuantity(split_quantity_new, false, true);
11223 }
11224 }
11225 }
11226 }
11227
11229 {
11231 float split_quantity_new = Math.Floor(quantity * 0.5);
11232
11234 return;
11235
11237
11238 if (new_item)
11239 {
11240 if (new_item.GetQuantityMax() < split_quantity_new)
11241 {
11242 split_quantity_new = new_item.GetQuantityMax();
11243 }
11244
11245 new_item.SetResultOfSplit(true);
11246 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11247
11249 {
11252 }
11253 else
11254 {
11256 new_item.
SetQuantity(split_quantity_new,
false,
true);
11257 }
11258 }
11259 }
11260
11262 {
11264 float split_quantity_new = Math.Floor(quantity / 2);
11265
11267 return;
11268
11269 InventoryLocation invloc = new InventoryLocation;
11271
11273 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11274
11275 if (new_item)
11276 {
11277 if (new_item.GetQuantityMax() < split_quantity_new)
11278 {
11279 split_quantity_new = new_item.GetQuantityMax();
11280 }
11282 {
11285 }
11286 else if (split_quantity_new > 1)
11287 {
11289 new_item.
SetQuantity(split_quantity_new,
false,
true);
11290 }
11291 }
11292 }
11293
11296 {
11297 SetWeightDirty();
11299
11300 if (parent)
11301 parent.OnAttachmentQuantityChangedEx(this, delta);
11302
11304 {
11306 {
11308 }
11310 {
11311 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11313 }
11314 }
11315
11316 }
11317
11320 {
11321
11322 }
11323
11326 {
11328 }
11329
11331 {
11332 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11333
11335 {
11336 if (newLevel == GameConstants.STATE_RUINED)
11337 {
11339 EntityAI parent = GetHierarchyParent();
11340 if (parent && parent.IsFireplace())
11341 {
11342 CargoBase cargo = GetInventory().GetCargo();
11343 if (cargo)
11344 {
11346 {
11348 }
11349 }
11350 }
11351 }
11352
11354 {
11355
11357 return;
11358 }
11359
11360 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11361 {
11363 }
11364 }
11365 }
11366
11367
11369 {
11370 super.OnRightClick();
11371
11373 {
11375 {
11376 if (ScriptInputUserData.CanStoreInputUserData())
11377 {
11378 EntityAI root = GetHierarchyRoot();
11379 Man playerOwner = GetHierarchyRootPlayer();
11380 InventoryLocation dst = new InventoryLocation;
11381
11382
11383 if (!playerOwner && root && root == this)
11384 {
11386 }
11387 else
11388 {
11389
11390 GetInventory().GetCurrentInventoryLocation(dst);
11392 {
11395 {
11397 }
11398 else
11399 {
11401
11402
11403 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11404 {
11406 }
11407 else
11408 {
11409 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11410 }
11411 }
11412 }
11413 }
11414
11415 ScriptInputUserData ctx = new ScriptInputUserData;
11423 }
11424 }
11425 else if (!
GetGame().IsMultiplayer())
11426 {
11428 }
11429 }
11430 }
11431
11433 {
11434 if (root)
11435 {
11436 vector m4[4];
11437 root.GetTransform(m4);
11438 dst.SetGround(this, m4);
11439 }
11440 else
11441 {
11442 GetInventory().GetCurrentInventoryLocation(dst);
11443 }
11444 }
11445
11446 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11447 {
11448
11449 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11450 return false;
11451
11452 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11453 return false;
11454
11455
11457 return false;
11458
11459
11460 Magazine mag = Magazine.Cast(this);
11461 if (mag)
11462 {
11463 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11464 return false;
11465
11466 if (stack_max_limit)
11467 {
11468 Magazine other_mag = Magazine.Cast(other_item);
11469 if (other_item)
11470 {
11471 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11472 return false;
11473 }
11474
11475 }
11476 }
11477 else
11478 {
11479
11481 return false;
11482
11484 return false;
11485 }
11486
11487 PlayerBase player = null;
11488 if (CastTo(player, GetHierarchyRootPlayer()))
11489 {
11490 if (player.GetInventory().HasAttachment(this))
11491 return false;
11492
11493 if (player.IsItemsToDelete())
11494 return false;
11495 }
11496
11497 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11498 return false;
11499
11500 int slotID;
11502 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11503 return false;
11504
11505 return true;
11506 }
11507
11509 {
11511 }
11512
11514 {
11515 return m_IsResultOfSplit;
11516 }
11517
11519 {
11520 m_IsResultOfSplit = value;
11521 }
11522
11524 {
11526 }
11527
11529 {
11530 float other_item_quantity = other_item.GetQuantity();
11531 float this_free_space;
11532
11534
11536
11537 if (other_item_quantity > this_free_space)
11538 {
11539 return this_free_space;
11540 }
11541 else
11542 {
11543 return other_item_quantity;
11544 }
11545 }
11546
11548 {
11550 }
11551
11553 {
11555 return;
11556
11557 if (!IsMagazine() && other_item)
11558 {
11560 if (quantity_used != 0)
11561 {
11562 float hp1 = GetHealth01("","");
11563 float hp2 = other_item.GetHealth01("","");
11564 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11565 hpResult = hpResult / (
GetQuantity() + quantity_used);
11566
11567 hpResult *= GetMaxHealth();
11568 Math.Round(hpResult);
11569 SetHealth("", "Health", hpResult);
11570
11572 other_item.AddQuantity(-quantity_used);
11573 }
11574 }
11576 }
11577
11579 {
11580 #ifdef SERVER
11581 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11582 GetHierarchyParent().IncreaseLifetimeUp();
11583 #endif
11584 };
11585
11587 {
11588 PlayerBase p = PlayerBase.Cast(player);
11589
11590 array<int> recipesIds = p.m_Recipes;
11591 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11592 if (moduleRecipesManager)
11593 {
11594 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11595 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11596 }
11597
11598 for (int i = 0;i < recipesIds.Count(); i++)
11599 {
11600 int key = recipesIds.Get(i);
11601 string recipeName = moduleRecipesManager.GetRecipeName(key);
11603 }
11604 }
11605
11606
11607 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11608 {
11609 super.GetDebugActions(outputList);
11610
11611
11617
11618
11623
11628
11629
11633
11634
11636 {
11640 }
11641
11644
11645
11649
11651
11652 InventoryLocation loc = new InventoryLocation();
11653 GetInventory().GetCurrentInventoryLocation(loc);
11655 {
11656 if (Gizmo_IsSupported())
11659 }
11660
11662 }
11663
11664
11665
11666
11668 {
11669 super.OnAction(action_id, player, ctx);
11670
11672 {
11673 switch (action_id)
11674 {
11677 return true;
11680 return true;
11681 }
11682 }
11683
11685 {
11686 switch (action_id)
11687 {
11689 Delete();
11690 return true;
11691 }
11692 }
11693
11694 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11695 {
11696 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11697 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11698 PlayerBase p = PlayerBase.Cast(player);
11699 if (
EActions.RECIPES_RANGE_START < 1000)
11700 {
11701 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11702 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11703 }
11704 }
11705 #ifndef SERVER
11706 else if (action_id ==
EActions.WATCH_PLAYER)
11707 {
11708 PluginDeveloper.SetDeveloperItemClientEx(player);
11709 }
11710 #endif
11712 {
11713 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11714 {
11715 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11716 OnDebugButtonPressServer(id + 1);
11717 }
11718
11719 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11720 {
11721 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11723 }
11724
11725 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11726 {
11727 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11729 }
11730
11731 else if (action_id ==
EActions.ADD_QUANTITY)
11732 {
11733 if (IsMagazine())
11734 {
11735 Magazine mag = Magazine.Cast(this);
11736 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11737 }
11738 else
11739 {
11741 }
11742
11743 if (m_EM)
11744 {
11745 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11746 }
11747
11748 }
11749
11750 else if (action_id ==
EActions.REMOVE_QUANTITY)
11751 {
11752 if (IsMagazine())
11753 {
11754 Magazine mag2 = Magazine.Cast(this);
11755 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11756 }
11757 else
11758 {
11760 }
11761 if (m_EM)
11762 {
11763 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11764 }
11765
11766 }
11767
11768 else if (action_id ==
EActions.SET_QUANTITY_0)
11769 {
11771
11772 if (m_EM)
11773 {
11774 m_EM.SetEnergy(0);
11775 }
11776 }
11777
11778 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11779 {
11781
11782 if (m_EM)
11783 {
11784 m_EM.SetEnergy(m_EM.GetEnergyMax());
11785 }
11786 }
11787
11788 else if (action_id ==
EActions.ADD_HEALTH)
11789 {
11790 AddHealth("","",GetMaxHealth("","Health")/5);
11791 }
11792 else if (action_id ==
EActions.REMOVE_HEALTH)
11793 {
11794 AddHealth("","",-GetMaxHealth("","Health")/5);
11795 }
11796 else if (action_id ==
EActions.DESTROY_HEALTH)
11797 {
11798 SetHealth01("","",0);
11799 }
11800 else if (action_id ==
EActions.WATCH_ITEM)
11801 {
11803 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11804 #ifdef DEVELOPER
11805 SetDebugDeveloper_item(this);
11806 #endif
11807 }
11808
11809 else if (action_id ==
EActions.ADD_TEMPERATURE)
11810 {
11811 AddTemperature(20);
11812
11813 }
11814
11815 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11816 {
11817 AddTemperature(-20);
11818
11819 }
11820
11821 else if (action_id ==
EActions.FLIP_FROZEN)
11822 {
11823 SetFrozen(!GetIsFrozen());
11824
11825 }
11826
11827 else if (action_id ==
EActions.ADD_WETNESS)
11828 {
11830
11831 }
11832
11833 else if (action_id ==
EActions.REMOVE_WETNESS)
11834 {
11836
11837 }
11838
11839 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11840 {
11843
11844
11845 }
11846
11847 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11848 {
11851 }
11852
11853 else if (action_id ==
EActions.MAKE_SPECIAL)
11854 {
11855 auto debugParams = DebugSpawnParams.WithPlayer(player);
11856 OnDebugSpawnEx(debugParams);
11857 }
11858
11859 }
11860
11861
11862 return false;
11863 }
11864
11865
11866
11867
11871
11874
11875
11876
11878 {
11879 return false;
11880 }
11881
11882
11884 {
11885 return true;
11886 }
11887
11888
11890 {
11891 return true;
11892 }
11893
11894
11895
11897 {
11898 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11900 }
11901
11904 {
11905 return null;
11906 }
11907
11909 {
11910 return false;
11911 }
11912
11914 {
11915 return false;
11916 }
11917
11921
11922
11924 {
11925 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11926 return module_repairing.CanRepair(this, item_repair_kit);
11927 }
11928
11929
11930 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11931 {
11932 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11933 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11934 }
11935
11936
11938 {
11939
11940
11941
11942
11943
11944
11945
11946
11947 return 1;
11948 }
11949
11950
11951
11953 {
11955 }
11956
11957
11958
11960 {
11962 }
11963
11964
11973 {
11974 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11975
11976 if (player)
11977 {
11978 player.MessageStatus(text);
11979 }
11980 }
11981
11982
11991 {
11992 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11993
11994 if (player)
11995 {
11996 player.MessageAction(text);
11997 }
11998 }
11999
12000
12009 {
12010 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12011
12012 if (player)
12013 {
12014 player.MessageFriendly(text);
12015 }
12016 }
12017
12018
12027 {
12028 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12029
12030 if (player)
12031 {
12032 player.MessageImportant(text);
12033 }
12034 }
12035
12037 {
12038 return true;
12039 }
12040
12041
12042 override bool KindOf(
string tag)
12043 {
12044 bool found = false;
12045 string item_name = this.
GetType();
12048
12049 int array_size = item_tag_array.Count();
12050 for (int i = 0; i < array_size; i++)
12051 {
12052 if (item_tag_array.Get(i) == tag)
12053 {
12054 found = true;
12055 break;
12056 }
12057 }
12058 return found;
12059 }
12060
12061
12063 {
12064
12065 super.OnRPC(sender, rpc_type,ctx);
12066
12067
12068 switch (rpc_type)
12069 {
12070 #ifndef SERVER
12071 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12072 Param2<bool, string> p = new Param2<bool, string>(false, "");
12073
12075 return;
12076
12077 bool play = p.param1;
12078 string soundSet = p.param2;
12079
12080 if (play)
12081 {
12083 {
12085 {
12087 }
12088 }
12089 else
12090 {
12092 }
12093 }
12094 else
12095 {
12097 }
12098
12099 break;
12100 #endif
12101
12102 }
12103
12105 {
12107 }
12108 }
12109
12110
12111
12112
12114 {
12115 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12116 return plugin.GetID(
name);
12117 }
12118
12120 {
12121 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12122 return plugin.GetName(id);
12123 }
12124
12127 {
12128
12129
12130 int varFlags;
12131 if (!ctx.
Read(varFlags))
12132 return;
12133
12134 if (varFlags & ItemVariableFlags.FLOAT)
12135 {
12137 }
12138 }
12139
12141 {
12142
12143 super.SerializeNumericalVars(floats_out);
12144
12145
12146
12148 {
12150 }
12151
12153 {
12155 }
12156
12158 {
12160 }
12161
12163 {
12168 }
12169
12171 {
12173 }
12174 }
12175
12177 {
12178
12179 super.DeSerializeNumericalVars(floats);
12180
12181
12182 int index = 0;
12183 int mask = Math.Round(floats.Get(index));
12184
12185 index++;
12186
12188 {
12190 {
12192 }
12193 else
12194 {
12195 float quantity = floats.Get(index);
12196 SetQuantity(quantity,
true,
false,
false,
false);
12197 }
12198 index++;
12199 }
12200
12202 {
12203 float wet = floats.Get(index);
12205 index++;
12206 }
12207
12209 {
12210 int liquidtype = Math.Round(floats.Get(index));
12212 index++;
12213 }
12214
12216 {
12218 index++;
12220 index++;
12222 index++;
12224 index++;
12225 }
12226
12228 {
12229 int cleanness = Math.Round(floats.Get(index));
12231 index++;
12232 }
12233 }
12234
12236 {
12237 super.WriteVarsToCTX(ctx);
12238
12239
12241 {
12243 }
12244
12246 {
12248 }
12249
12251 {
12253 }
12254
12256 {
12257 int r,g,b,a;
12263 }
12264
12266 {
12268 }
12269 }
12270
12272 {
12273 if (!super.ReadVarsFromCTX(ctx,version))
12274 return false;
12275
12276 int intValue;
12277 float value;
12278
12279 if (version < 140)
12280 {
12281 if (!ctx.
Read(intValue))
12282 return false;
12283
12284 m_VariablesMask = intValue;
12285 }
12286
12288 {
12289 if (!ctx.
Read(value))
12290 return false;
12291
12293 {
12295 }
12296 else
12297 {
12299 }
12300 }
12301
12302 if (version < 140)
12303 {
12305 {
12306 if (!ctx.
Read(value))
12307 return false;
12308 SetTemperatureDirect(value);
12309 }
12310 }
12311
12313 {
12314 if (!ctx.
Read(value))
12315 return false;
12317 }
12318
12320 {
12321 if (!ctx.
Read(intValue))
12322 return false;
12324 }
12325
12327 {
12328 int r,g,b,a;
12330 return false;
12332 return false;
12334 return false;
12336 return false;
12337
12339 }
12340
12342 {
12343 if (!ctx.
Read(intValue))
12344 return false;
12346 }
12347
12348 if (version >= 138 && version < 140)
12349 {
12351 {
12352 if (!ctx.
Read(intValue))
12353 return false;
12354 SetFrozen(intValue);
12355 }
12356 }
12357
12358 return true;
12359 }
12360
12361
12363 {
12366 {
12368 }
12369
12370 if (!super.OnStoreLoad(ctx, version))
12371 {
12373 return false;
12374 }
12375
12376 if (version >= 114)
12377 {
12378 bool hasQuickBarIndexSaved;
12379
12380 if (!ctx.
Read(hasQuickBarIndexSaved))
12381 {
12383 return false;
12384 }
12385
12386 if (hasQuickBarIndexSaved)
12387 {
12388 int itmQBIndex;
12389
12390
12391 if (!ctx.
Read(itmQBIndex))
12392 {
12394 return false;
12395 }
12396
12397 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12398 if (itmQBIndex != -1 && parentPlayer)
12399 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12400 }
12401 }
12402 else
12403 {
12404
12405 PlayerBase player;
12406 int itemQBIndex;
12407 if (version ==
int.
MAX)
12408 {
12409 if (!ctx.
Read(itemQBIndex))
12410 {
12412 return false;
12413 }
12414 }
12415 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12416 {
12417
12418 if (!ctx.
Read(itemQBIndex))
12419 {
12421 return false;
12422 }
12423 if (itemQBIndex != -1 && player)
12424 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12425 }
12426 }
12427
12428 if (version < 140)
12429 {
12430
12431 if (!LoadVariables(ctx, version))
12432 {
12434 return false;
12435 }
12436 }
12437
12438
12440 {
12442 return false;
12443 }
12444 if (version >= 132)
12445 {
12447 if (raib)
12448 {
12450 {
12452 return false;
12453 }
12454 }
12455 }
12456
12458 return true;
12459 }
12460
12461
12462
12464 {
12465 super.OnStoreSave(ctx);
12466
12467 PlayerBase player;
12468 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12469 {
12471
12472 int itemQBIndex = -1;
12473 itemQBIndex = player.FindQuickBarEntityIndex(this);
12474 ctx.
Write(itemQBIndex);
12475 }
12476 else
12477 {
12479 }
12480
12482
12484 if (raib)
12485 {
12487 }
12488 }
12489
12490
12492 {
12493 super.AfterStoreLoad();
12494
12496 {
12498 }
12499
12501 {
12504 }
12505 }
12506
12508 {
12509 super.EEOnAfterLoad();
12510
12512 {
12514 }
12515
12518 }
12519
12521 {
12522 return false;
12523 }
12524
12525
12526
12528 {
12530 {
12531 #ifdef PLATFORM_CONSOLE
12532
12534 {
12536 if (menu)
12537 {
12539 }
12540 }
12541 #endif
12542 }
12543
12545 {
12548 }
12549
12551 {
12552 SetWeightDirty();
12554 }
12556 {
12559 }
12560
12562 {
12565 }
12567 {
12570 }
12571
12572 super.OnVariablesSynchronized();
12573 }
12574
12575
12576
12578 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12579 {
12580 if (!IsServerCheck(allow_client))
12581 return false;
12582
12584 return false;
12585
12588
12589 if (value <= (min + 0.001))
12590 value = min;
12591
12592 if (value == min)
12593 {
12594 if (destroy_config)
12595 {
12596 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12597 if (dstr)
12598 {
12600 this.Delete();
12601 return true;
12602 }
12603 }
12604 else if (destroy_forced)
12605 {
12607 this.Delete();
12608 return true;
12609 }
12610
12612 }
12613
12616
12618 {
12620
12621 if (delta)
12623 }
12624
12626
12627 return false;
12628 }
12629
12630
12632 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12633 {
12635 }
12636
12638 {
12641 }
12642
12644 {
12647 }
12648
12650 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12651 {
12652 float value_clamped = Math.Clamp(value, 0, 1);
12654 SetQuantity(result, destroy_config, destroy_forced);
12655 }
12656
12657
12660 {
12662 }
12663
12665 {
12667 }
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12679 {
12680 int slot = -1;
12681 if (GetInventory())
12682 {
12683 InventoryLocation il = new InventoryLocation;
12684 GetInventory().GetCurrentInventoryLocation(il);
12686 }
12687
12689 }
12690
12692 {
12693 float quantity_max = 0;
12694
12696 {
12697 if (attSlotID != -1)
12698 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12699
12700 if (quantity_max <= 0)
12702 }
12703
12704 if (quantity_max <= 0)
12706
12707 return quantity_max;
12708 }
12709
12711 {
12713 }
12714
12716 {
12718 }
12719
12720
12722 {
12724 }
12725
12727 {
12729 }
12730
12732 {
12734 }
12735
12736
12738 {
12739
12740 float weightEx = GetWeightEx();
12741 float special = GetInventoryAndCargoWeight();
12742 return weightEx - special;
12743 }
12744
12745
12747 {
12749 }
12750
12752 {
12754 {
12755 #ifdef DEVELOPER
12756 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12757 {
12758 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12760 }
12761 #endif
12762
12763 return GetQuantity() * GetConfigWeightModified();
12764 }
12765 else if (HasEnergyManager())
12766 {
12767 #ifdef DEVELOPER
12768 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12769 {
12770 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12771 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12772 }
12773 #endif
12774 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12775 }
12776 else
12777 {
12778 #ifdef DEVELOPER
12779 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12780 {
12781 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12782 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12783 }
12784 #endif
12785 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12786 }
12787 }
12788
12791 {
12792 int item_count = 0;
12794
12795 if (GetInventory().GetCargo() != NULL)
12796 {
12797 item_count = GetInventory().GetCargo().GetItemCount();
12798 }
12799
12800 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12801 {
12802 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12803 if (item)
12804 item_count += item.GetNumberOfItems();
12805 }
12806 return item_count;
12807 }
12808
12811 {
12812 float weight = 0;
12813 float wetness = 1;
12814 if (include_wetness)
12817 {
12818 weight = wetness * m_ConfigWeight;
12819 }
12821 {
12822 weight = 1;
12823 }
12824 return weight;
12825 }
12826
12827
12828
12830 {
12831 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12832 {
12833 GameInventory inv = GetInventory();
12834 array<EntityAI> items = new array<EntityAI>;
12836 for (int i = 0; i < items.Count(); i++)
12837 {
12839 if (item)
12840 {
12842 }
12843 }
12844 }
12845 }
12846
12847
12848
12849
12851 {
12852 float energy = 0;
12853 if (HasEnergyManager())
12854 {
12855 energy = GetCompEM().GetEnergy();
12856 }
12857 return energy;
12858 }
12859
12860
12862 {
12863 super.OnEnergyConsumed();
12864
12866 }
12867
12869 {
12870 super.OnEnergyAdded();
12871
12873 }
12874
12875
12877 {
12878 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12879 {
12881 {
12882 float energy_0to1 = GetCompEM().GetEnergy0To1();
12884 }
12885 }
12886 }
12887
12888
12890 {
12891 return ConfigGetFloat("heatIsolation");
12892 }
12893
12895 {
12897 }
12898
12900 {
12901 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12902 if (
GetGame().ConfigIsExisting(paramPath))
12904
12905 return 0.0;
12906 }
12907
12909 {
12910 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12911 if (
GetGame().ConfigIsExisting(paramPath))
12913
12914 return 0.0;
12915 }
12916
12917 override void SetWet(
float value,
bool allow_client =
false)
12918 {
12919 if (!IsServerCheck(allow_client))
12920 return;
12921
12924
12926
12927 m_VarWet = Math.Clamp(value, min, max);
12928
12930 {
12933 }
12934 }
12935
12936 override void AddWet(
float value)
12937 {
12939 }
12940
12942 {
12944 }
12945
12947 {
12949 }
12950
12952 {
12954 }
12955
12957 {
12959 }
12960
12962 {
12964 }
12965
12966 override void OnWetChanged(
float newVal,
float oldVal)
12967 {
12970 if (newLevel != oldLevel)
12971 {
12973 }
12974 }
12975
12977 {
12978 SetWeightDirty();
12979 }
12980
12982 {
12983 return GetWetLevelInternal(
m_VarWet);
12984 }
12985
12986
12987
12989 {
12991 }
12992
12994 {
12996 }
12997
12999 {
13001 }
13002
13004 {
13006 }
13007
13008
13009
13011 {
13012 if (ConfigIsExisting("itemModelLength"))
13013 {
13014 return ConfigGetFloat("itemModelLength");
13015 }
13016 return 0;
13017 }
13018
13020 {
13021 if (ConfigIsExisting("itemAttachOffset"))
13022 {
13023 return ConfigGetFloat("itemAttachOffset");
13024 }
13025 return 0;
13026 }
13027
13028 override void SetCleanness(
int value,
bool allow_client =
false)
13029 {
13030 if (!IsServerCheck(allow_client))
13031 return;
13032
13034
13036
13039 }
13040
13042 {
13044 }
13045
13047 {
13048 return true;
13049 }
13050
13051
13052
13053
13055 {
13057 }
13058
13060 {
13062 }
13063
13064
13065
13066
13067 override void SetColor(
int r,
int g,
int b,
int a)
13068 {
13074 }
13076 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13077 {
13082 }
13083
13085 {
13087 }
13088
13091 {
13092 int r,g,b,a;
13094 r = r/255;
13095 g = g/255;
13096 b = b/255;
13097 a = a/255;
13098 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13099 }
13100
13101
13102
13103 override void SetLiquidType(
int value,
bool allow_client =
false)
13104 {
13105 if (!IsServerCheck(allow_client))
13106 return;
13107
13112 }
13113
13115 {
13116 return ConfigGetInt("varLiquidTypeInit");
13117 }
13118
13120 {
13122 }
13123
13125 {
13127 SetFrozen(false);
13128 }
13129
13132 {
13133 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13134 }
13135
13136
13139 {
13140 PlayerBase nplayer;
13141 if (PlayerBase.CastTo(nplayer, player))
13142 {
13144
13145 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13146 }
13147 }
13148
13149
13152 {
13153 PlayerBase nplayer;
13154 if (PlayerBase.CastTo(nplayer,player))
13155 {
13156
13157 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13158
13159 }
13160
13161
13162 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13163
13164
13165 if (HasEnergyManager())
13166 {
13167 GetCompEM().UpdatePlugState();
13168 }
13169 }
13170
13171
13173 {
13174 super.OnPlacementStarted(player);
13175
13177 }
13178
13179 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13180 {
13182 {
13183 m_AdminLog.OnPlacementComplete(player,
this);
13184 }
13185
13186 super.OnPlacementComplete(player, position, orientation);
13187 }
13188
13189
13190
13191
13192
13194 {
13196 {
13197 return true;
13198 }
13199 else
13200 {
13201 return false;
13202 }
13203 }
13204
13205
13207 {
13209 {
13211 }
13212 }
13213
13214
13216 {
13218 }
13219
13221 {
13223 }
13224
13225 override void InsertAgent(
int agent,
float count = 1)
13226 {
13227 if (count < 1)
13228 return;
13229
13231 }
13232
13235 {
13237 }
13238
13239
13241 {
13243 }
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13287 {
13289 return false;
13290 return true;
13291 }
13292
13294 {
13295
13297 }
13298
13299
13302 {
13303 super.CheckForRoofLimited(timeTresholdMS);
13304
13306 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13307 {
13308 m_PreviousRoofTestTime = time;
13309 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13310 }
13311 }
13312
13313
13315 {
13317 {
13318 return 0;
13319 }
13320
13321 if (GetInventory().GetAttachmentSlotsCount() != 0)
13322 {
13323 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13324 if (filter)
13325 return filter.GetProtectionLevel(type, false, system);
13326 else
13327 return 0;
13328 }
13329
13330 string subclassPath, entryName;
13331
13332 switch (type)
13333 {
13335 entryName = "biological";
13336 break;
13338 entryName = "chemical";
13339 break;
13340 default:
13341 entryName = "biological";
13342 break;
13343 }
13344
13345 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13346
13348 }
13349
13350
13351
13354 {
13355 if (!IsMagazine())
13357
13359 }
13360
13361
13362
13363
13364
13369 {
13370 return true;
13371 }
13372
13374 {
13376 }
13377
13378
13379
13380
13381
13383 {
13384 if (parent)
13385 {
13386 if (parent.IsInherited(DayZInfected))
13387 return true;
13388
13389 if (!parent.IsRuined())
13390 return true;
13391 }
13392
13393 return true;
13394 }
13395
13397 {
13398 if (!super.CanPutAsAttachment(parent))
13399 {
13400 return false;
13401 }
13402
13403 if (!IsRuined() && !parent.IsRuined())
13404 {
13405 return true;
13406 }
13407
13408 return false;
13409 }
13410
13412 {
13413
13414
13415
13416
13417 return super.CanReceiveItemIntoCargo(item);
13418 }
13419
13421 {
13422
13423
13424
13425
13426 GameInventory attachmentInv = attachment.GetInventory();
13428 {
13429 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13430 return false;
13431 }
13432
13433 InventoryLocation loc = new InventoryLocation();
13434 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13435 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13436 return false;
13437
13438 return super.CanReceiveAttachment(attachment, slotId);
13439 }
13440
13442 {
13443 if (!super.CanReleaseAttachment(attachment))
13444 return false;
13445
13446 return GetInventory().AreChildrenAccessible();
13447 }
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13470 {
13471 int id = muzzle_owner.GetMuzzleID();
13472 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13473
13474 if (WPOF_array)
13475 {
13476 for (int i = 0; i < WPOF_array.Count(); i++)
13477 {
13478 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13479
13480 if (WPOF)
13481 {
13482 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13483 }
13484 }
13485 }
13486 }
13487
13488
13490 {
13491 int id = muzzle_owner.GetMuzzleID();
13493
13494 if (WPOBE_array)
13495 {
13496 for (int i = 0; i < WPOBE_array.Count(); i++)
13497 {
13498 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13499
13500 if (WPOBE)
13501 {
13502 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13503 }
13504 }
13505 }
13506 }
13507
13508
13510 {
13511 int id = muzzle_owner.GetMuzzleID();
13512 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13513
13514 if (WPOOH_array)
13515 {
13516 for (int i = 0; i < WPOOH_array.Count(); i++)
13517 {
13518 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13519
13520 if (WPOOH)
13521 {
13522 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13523 }
13524 }
13525 }
13526 }
13527
13528
13530 {
13531 int id = muzzle_owner.GetMuzzleID();
13532 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13533
13534 if (WPOOH_array)
13535 {
13536 for (int i = 0; i < WPOOH_array.Count(); i++)
13537 {
13538 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13539
13540 if (WPOOH)
13541 {
13542 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13543 }
13544 }
13545 }
13546 }
13547
13548
13550 {
13551 int id = muzzle_owner.GetMuzzleID();
13552 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13553
13554 if (WPOOH_array)
13555 {
13556 for (int i = 0; i < WPOOH_array.Count(); i++)
13557 {
13558 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13559
13560 if (WPOOH)
13561 {
13562 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13563 }
13564 }
13565 }
13566 }
13567
13568
13569
13571 {
13573 {
13574 return true;
13575 }
13576
13577 return false;
13578 }
13579
13581 {
13583 {
13584 return true;
13585 }
13586
13587 return false;
13588 }
13589
13591 {
13593 {
13594 return true;
13595 }
13596
13597 return false;
13598 }
13599
13601 {
13602 return false;
13603 }
13604
13607 {
13608 return UATimeSpent.DEFAULT_DEPLOY;
13609 }
13610
13611
13612
13613
13615 {
13617 SetSynchDirty();
13618 }
13619
13621 {
13623 }
13624
13625
13627 {
13628 return false;
13629 }
13630
13633 {
13634 string att_type = "None";
13635
13636 if (ConfigIsExisting("soundAttType"))
13637 {
13638 att_type = ConfigGetString("soundAttType");
13639 }
13640
13642 }
13643
13645 {
13647 }
13648
13649
13650
13651
13652
13658
13660 {
13663
13665 }
13666
13667
13669 {
13671 return;
13672
13674
13677
13680
13681 SoundParameters params = new SoundParameters();
13685 }
13686
13687
13689 {
13691 return;
13692
13694 SetSynchDirty();
13695
13698 }
13699
13700
13702 {
13704 return;
13705
13707 SetSynchDirty();
13708
13711 }
13712
13714 {
13716 }
13717
13719 {
13721 }
13722
13725 {
13726 if (!
GetGame().IsDedicatedServer())
13727 {
13728 if (ConfigIsExisting("attachSoundSet"))
13729 {
13730 string cfg_path = "";
13731 string soundset = "";
13732 string type_name =
GetType();
13733
13736 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13737 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13738
13739 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13740 {
13741 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13742 {
13743 if (cfg_slot_array[i] == slot_type)
13744 {
13745 soundset = cfg_soundset_array[i];
13746 break;
13747 }
13748 }
13749 }
13750
13751 if (soundset != "")
13752 {
13753 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13755 }
13756 }
13757 }
13758 }
13759
13761 {
13762
13763 }
13764
13765 void OnApply(PlayerBase player);
13766
13768 {
13769 return 1.0;
13770 };
13771
13773 {
13775 }
13776
13778 {
13780 }
13781
13783
13785 {
13786 SetDynamicPhysicsLifeTime(0.01);
13788 }
13789
13791 {
13792 array<string> zone_names = new array<string>;
13793 GetDamageZones(zone_names);
13794 for (int i = 0; i < zone_names.Count(); i++)
13795 {
13796 SetHealthMax(zone_names.Get(i),"Health");
13797 }
13798 SetHealthMax("","Health");
13799 }
13800
13803 {
13804 float global_health = GetHealth01("","Health");
13805 array<string> zones = new array<string>;
13806 GetDamageZones(zones);
13807
13808 for (int i = 0; i < zones.Count(); i++)
13809 {
13810 SetHealth01(zones.Get(i),"Health",global_health);
13811 }
13812 }
13813
13816 {
13817 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13818 }
13819
13821 {
13822 if (!hasRootAsPlayer)
13823 {
13824 if (refParentIB)
13825 {
13826
13827 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13828 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13829
13830 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13831 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13832
13835 }
13836 else
13837 {
13838
13841 }
13842 }
13843 }
13844
13846 {
13848 {
13849 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13850 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13851 {
13852 float heatPermCoef = 1.0;
13854 while (ent)
13855 {
13856 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13857 ent = ent.GetHierarchyParent();
13858 }
13859
13860 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13861 }
13862 }
13863 }
13864
13866 {
13867
13868 EntityAI parent = GetHierarchyParent();
13869 if (!parent)
13870 {
13871 hasParent = false;
13872 hasRootAsPlayer = false;
13873 }
13874 else
13875 {
13876 hasParent = true;
13877 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13878 refParentIB =
ItemBase.Cast(parent);
13879 }
13880 }
13881
13882 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13883 {
13884
13885 }
13886
13888 {
13889
13890 return false;
13891 }
13892
13894 {
13895
13896
13897 return false;
13898 }
13899
13901 {
13902
13903 return false;
13904 }
13905
13908 {
13909 return !GetIsFrozen() &&
IsOpen();
13910 }
13911
13913 {
13914 bool hasParent = false, hasRootAsPlayer = false;
13916
13917 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13918 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13919
13920 if (wwtu || foodDecay)
13921 {
13925
13926 if (processWetness || processTemperature || processDecay)
13927 {
13929
13930 if (processWetness)
13931 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13932
13933 if (processTemperature)
13935
13936 if (processDecay)
13937 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13938 }
13939 }
13940 }
13941
13944 {
13946 }
13947
13949 {
13952
13953 return super.GetTemperatureFreezeThreshold();
13954 }
13955
13957 {
13960
13961 return super.GetTemperatureThawThreshold();
13962 }
13963
13965 {
13968
13969 return super.GetItemOverheatThreshold();
13970 }
13971
13973 {
13975 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13976
13977 return super.GetTemperatureFreezeTime();
13978 }
13979
13981 {
13983 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13984
13985 return super.GetTemperatureThawTime();
13986 }
13987
13992
13994 {
13995 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13996 }
13997
13999 {
14000 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14001 }
14002
14005 {
14007 }
14008
14010 {
14012 }
14013
14015 {
14017 }
14018
14021 {
14022 return null;
14023 }
14024
14027 {
14028 return false;
14029 }
14030
14032 {
14034 {
14037 if (!trg)
14038 {
14040 explosive = this;
14041 }
14042
14043 explosive.PairRemote(trg);
14045
14046 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14047 trg.SetPersistentPairID(persistentID);
14048 explosive.SetPersistentPairID(persistentID);
14049
14050 return true;
14051 }
14052 return false;
14053 }
14054
14057 {
14058 float ret = 1.0;
14061 ret *= GetHealth01();
14062
14063 return ret;
14064 }
14065
14066 #ifdef DEVELOPER
14067 override void SetDebugItem()
14068 {
14069 super.SetDebugItem();
14070 _itemBase = this;
14071 }
14072
14074 {
14075 string text = super.GetDebugText();
14076
14078 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14079
14080 return text;
14081 }
14082 #endif
14083
14085 {
14086 return true;
14087 }
14088
14090
14092
14094 {
14097 }
14098
14099
14107
14123}
14124
14126{
14128 if (entity)
14129 {
14130 bool is_item = entity.IsInherited(
ItemBase);
14131 if (is_item && full_quantity)
14132 {
14135 }
14136 }
14137 else
14138 {
14140 return NULL;
14141 }
14142 return entity;
14143}
14144
14146{
14147 if (item)
14148 {
14149 if (health > 0)
14150 item.SetHealth("", "", health);
14151
14152 if (item.CanHaveTemperature())
14153 {
14155 if (item.CanFreeze())
14156 item.SetFrozen(false);
14157 }
14158
14159 if (item.HasEnergyManager())
14160 {
14161 if (quantity >= 0)
14162 {
14163 item.GetCompEM().SetEnergy0To1(quantity);
14164 }
14165 else
14166 {
14168 }
14169 }
14170 else if (item.IsMagazine())
14171 {
14172 Magazine mag = Magazine.Cast(item);
14173 if (quantity >= 0)
14174 {
14175 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14176 }
14177 else
14178 {
14180 }
14181
14182 }
14183 else
14184 {
14185 if (quantity >= 0)
14186 {
14187 item.SetQuantityNormalized(quantity, false);
14188 }
14189 else
14190 {
14192 }
14193
14194 }
14195 }
14196}
14197
14198#ifdef DEVELOPER
14200#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.