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 {
10861 return;
10862
10864 {
10865 if (ScriptInputUserData.CanStoreInputUserData())
10866 {
10867 ScriptInputUserData ctx = new ScriptInputUserData;
10872 ctx.
Write(destination_entity);
10874 ctx.
Write(slot_id);
10876 }
10877 }
10878 else if (!
GetGame().IsMultiplayer())
10879 {
10881 }
10882 }
10883
10885 {
10887 return;
10888
10889 float split_quantity_new;
10893 InventoryLocation loc = new InventoryLocation;
10894
10895 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10896 {
10898 split_quantity_new = stack_max;
10899 else
10901
10902 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10903 if (new_item)
10904 {
10905 new_item.SetResultOfSplit(true);
10906 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10908 new_item.SetQuantity(split_quantity_new);
10909 }
10910 }
10911 else if (destination_entity && slot_id == -1)
10912 {
10913 if (quantity > stack_max)
10914 split_quantity_new = stack_max;
10915 else
10916 split_quantity_new = quantity;
10917
10919 {
10922 }
10923
10924 if (new_item)
10925 {
10926 new_item.SetResultOfSplit(true);
10927 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10929 new_item.SetQuantity(split_quantity_new);
10930 }
10931 }
10932 else
10933 {
10934 if (stack_max != 0)
10935 {
10937 {
10939 }
10940
10941 if (split_quantity_new == 0)
10942 {
10943 if (!
GetGame().IsMultiplayer())
10944 player.PhysicalPredictiveDropItem(this);
10945 else
10946 player.ServerDropEntity(this);
10947 return;
10948 }
10949
10951
10952 if (new_item)
10953 {
10954 new_item.SetResultOfSplit(true);
10955 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10957 new_item.SetQuantity(stack_max);
10958 new_item.PlaceOnSurface();
10959 }
10960 }
10961 }
10962 }
10963
10965 {
10967 return;
10968
10969 float split_quantity_new;
10973 InventoryLocation loc = new InventoryLocation;
10974
10975 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10976 {
10978 split_quantity_new = stack_max;
10979 else
10981
10982 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10983 if (new_item)
10984 {
10985 new_item.SetResultOfSplit(true);
10986 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10988 new_item.SetQuantity(split_quantity_new);
10989 }
10990 }
10991 else if (destination_entity && slot_id == -1)
10992 {
10993 if (quantity > stack_max)
10994 split_quantity_new = stack_max;
10995 else
10996 split_quantity_new = quantity;
10997
10999 {
11002 }
11003
11004 if (new_item)
11005 {
11006 new_item.SetResultOfSplit(true);
11007 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11009 new_item.SetQuantity(split_quantity_new);
11010 }
11011 }
11012 else
11013 {
11014 if (stack_max != 0)
11015 {
11017 {
11019 }
11020
11022
11023 if (new_item)
11024 {
11025 new_item.SetResultOfSplit(true);
11026 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11028 new_item.SetQuantity(stack_max);
11029 new_item.PlaceOnSurface();
11030 }
11031 }
11032 }
11033 }
11034
11036 {
11038 return;
11039
11041 {
11042 if (ScriptInputUserData.CanStoreInputUserData())
11043 {
11044 ScriptInputUserData ctx = new ScriptInputUserData;
11049 dst.WriteToContext(ctx);
11051 }
11052 }
11053 else if (!
GetGame().IsMultiplayer())
11054 {
11056 }
11057 }
11058
11060 {
11062 return;
11063
11065 {
11066 if (ScriptInputUserData.CanStoreInputUserData())
11067 {
11068 ScriptInputUserData ctx = new ScriptInputUserData;
11073 ctx.
Write(destination_entity);
11079 }
11080 }
11081 else if (!
GetGame().IsMultiplayer())
11082 {
11084 }
11085 }
11086
11088 {
11090 }
11091
11093 {
11095 return this;
11096
11098 float split_quantity_new;
11100 if (dst.IsValid())
11101 {
11102 int slot_id = dst.GetSlot();
11104
11105 if (quantity > stack_max)
11106 split_quantity_new = stack_max;
11107 else
11108 split_quantity_new = quantity;
11109
11111
11112 if (new_item)
11113 {
11114 new_item.SetResultOfSplit(true);
11115 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11118 }
11119
11120 return new_item;
11121 }
11122
11123 return null;
11124 }
11125
11127 {
11129 return;
11130
11132 float split_quantity_new;
11134 if (destination_entity)
11135 {
11137 if (quantity > stackable)
11138 split_quantity_new = stackable;
11139 else
11140 split_quantity_new = quantity;
11141
11142 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11143 if (new_item)
11144 {
11145 new_item.SetResultOfSplit(true);
11146 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11148 new_item.SetQuantity(split_quantity_new);
11149 }
11150 }
11151 }
11152
11154 {
11156 return;
11157
11159 {
11160 if (ScriptInputUserData.CanStoreInputUserData())
11161 {
11162 ScriptInputUserData ctx = new ScriptInputUserData;
11167 ItemBase destination_entity =
this;
11168 ctx.
Write(destination_entity);
11172 }
11173 }
11174 else if (!
GetGame().IsMultiplayer())
11175 {
11177 }
11178 }
11179
11181 {
11183 return;
11184
11186 float split_quantity_new;
11188 if (player)
11189 {
11191 if (quantity > stackable)
11192 split_quantity_new = stackable;
11193 else
11194 split_quantity_new = quantity;
11195
11196 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11197 new_item =
ItemBase.Cast(in_hands);
11198 if (new_item)
11199 {
11200 new_item.SetResultOfSplit(true);
11201 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11203 new_item.SetQuantity(split_quantity_new);
11204 }
11205 }
11206 }
11207
11209 {
11211 return;
11212
11214 float split_quantity_new = Math.Floor(quantity * 0.5);
11215
11217
11218 if (new_item)
11219 {
11220 if (new_item.GetQuantityMax() < split_quantity_new)
11221 {
11222 split_quantity_new = new_item.GetQuantityMax();
11223 }
11224
11225 new_item.SetResultOfSplit(true);
11226 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11227
11229 {
11232 }
11233 else
11234 {
11237 }
11238 }
11239 }
11240
11242 {
11244 return;
11245
11247 float split_quantity_new = Math.Floor(quantity / 2);
11248
11249 InventoryLocation invloc = new InventoryLocation;
11251
11253 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11254
11255 if (new_item)
11256 {
11257 if (new_item.GetQuantityMax() < split_quantity_new)
11258 {
11259 split_quantity_new = new_item.GetQuantityMax();
11260 }
11262 {
11265 }
11266 else
11267 {
11270 }
11271 }
11272 }
11273
11276 {
11277 SetWeightDirty();
11279
11280 if (parent)
11281 parent.OnAttachmentQuantityChangedEx(this, delta);
11282
11284 {
11286 {
11288 }
11290 {
11291 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11293 }
11294 }
11295
11296 }
11297
11300 {
11301
11302 }
11303
11306 {
11308 }
11309
11311 {
11312 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11313
11315 {
11316 if (newLevel == GameConstants.STATE_RUINED)
11317 {
11319 EntityAI parent = GetHierarchyParent();
11320 if (parent && parent.IsFireplace())
11321 {
11322 CargoBase cargo = GetInventory().GetCargo();
11323 if (cargo)
11324 {
11326 {
11328 }
11329 }
11330 }
11331 }
11332
11334 {
11335
11337 return;
11338 }
11339
11340 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11341 {
11343 }
11344 }
11345 }
11346
11347
11349 {
11350 super.OnRightClick();
11351
11353 {
11355 {
11356 if (ScriptInputUserData.CanStoreInputUserData())
11357 {
11358 vector m4[4];
11360
11361 EntityAI root = GetHierarchyRoot();
11362
11363 InventoryLocation dst = new InventoryLocation;
11365 {
11366 if (root)
11367 {
11368 root.GetTransform(m4);
11370 }
11371 else
11372 GetInventory().GetCurrentInventoryLocation(dst);
11373 }
11374 else
11375 {
11377
11378
11379 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11380 {
11381 if (root)
11382 {
11383 root.GetTransform(m4);
11385 }
11386 else
11387 GetInventory().GetCurrentInventoryLocation(dst);
11388 }
11389 else
11390 {
11391 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11392 }
11393 }
11394
11395 ScriptInputUserData ctx = new ScriptInputUserData;
11403 }
11404 }
11405 else if (!
GetGame().IsMultiplayer())
11406 {
11408 }
11409 }
11410 }
11411
11412 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11413 {
11414
11415 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11416 return false;
11417
11418 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11419 return false;
11420
11421
11423 return false;
11424
11425
11426 Magazine mag = Magazine.Cast(this);
11427 if (mag)
11428 {
11429 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11430 return false;
11431
11432 if (stack_max_limit)
11433 {
11434 Magazine other_mag = Magazine.Cast(other_item);
11435 if (other_item)
11436 {
11437 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11438 return false;
11439 }
11440
11441 }
11442 }
11443 else
11444 {
11445
11447 return false;
11448
11450 return false;
11451 }
11452
11453 PlayerBase player = null;
11454 if (CastTo(player, GetHierarchyRootPlayer()))
11455 {
11456 if (player.GetInventory().HasAttachment(this))
11457 return false;
11458
11459 if (player.IsItemsToDelete())
11460 return false;
11461 }
11462
11463 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11464 return false;
11465
11466 int slotID;
11468 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11469 return false;
11470
11471 return true;
11472 }
11473
11475 {
11477 }
11478
11480 {
11481 return m_IsResultOfSplit;
11482 }
11483
11485 {
11486 m_IsResultOfSplit = value;
11487 }
11488
11490 {
11492 }
11493
11495 {
11496 float other_item_quantity = other_item.GetQuantity();
11497 float this_free_space;
11498
11500
11502
11503 if (other_item_quantity > this_free_space)
11504 {
11505 return this_free_space;
11506 }
11507 else
11508 {
11509 return other_item_quantity;
11510 }
11511 }
11512
11514 {
11516 }
11517
11519 {
11521 return;
11522
11523 if (!IsMagazine() && other_item)
11524 {
11526 if (quantity_used != 0)
11527 {
11528 float hp1 = GetHealth01("","");
11529 float hp2 = other_item.GetHealth01("","");
11530 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11531 hpResult = hpResult / (
GetQuantity() + quantity_used);
11532
11533 hpResult *= GetMaxHealth();
11534 Math.Round(hpResult);
11535 SetHealth("", "Health", hpResult);
11536
11538 other_item.AddQuantity(-quantity_used);
11539 }
11540 }
11542 }
11543
11545 {
11546 #ifdef SERVER
11547 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11548 GetHierarchyParent().IncreaseLifetimeUp();
11549 #endif
11550 };
11551
11553 {
11554 PlayerBase p = PlayerBase.Cast(player);
11555
11556 array<int> recipesIds = p.m_Recipes;
11557 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11558 if (moduleRecipesManager)
11559 {
11560 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11561 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11562 }
11563
11564 for (int i = 0;i < recipesIds.Count(); i++)
11565 {
11566 int key = recipesIds.Get(i);
11567 string recipeName = moduleRecipesManager.GetRecipeName(key);
11569 }
11570 }
11571
11572
11573 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11574 {
11575 super.GetDebugActions(outputList);
11576
11577
11582
11583
11587
11591
11592
11595
11596
11598 {
11601 }
11602
11604
11607
11611 }
11612
11613
11614
11615
11617 {
11618 super.OnAction(action_id, player, ctx);
11619 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11620 {
11621 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11622 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11623 PlayerBase p = PlayerBase.Cast(player);
11624 if (
EActions.RECIPES_RANGE_START < 1000)
11625 {
11626 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11627 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11628 }
11629 }
11630 #ifndef SERVER
11631 else if (action_id ==
EActions.WATCH_PLAYER)
11632 {
11633 PluginDeveloper.SetDeveloperItemClientEx(player);
11634 }
11635 #endif
11637 {
11638 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11639 {
11640 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11641 OnDebugButtonPressServer(id + 1);
11642 }
11643
11644 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11645 {
11646 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11648 }
11649
11650 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11651 {
11652 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11654 }
11655
11656 else if (action_id ==
EActions.ADD_QUANTITY)
11657 {
11658 if (IsMagazine())
11659 {
11660 Magazine mag = Magazine.Cast(this);
11661 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11662 }
11663 else
11664 {
11666 }
11667
11668 if (m_EM)
11669 {
11670 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11671 }
11672
11673 }
11674
11675 else if (action_id ==
EActions.REMOVE_QUANTITY)
11676 {
11677 if (IsMagazine())
11678 {
11679 Magazine mag2 = Magazine.Cast(this);
11680 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11681 }
11682 else
11683 {
11685 }
11686 if (m_EM)
11687 {
11688 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11689 }
11690
11691 }
11692
11693 else if (action_id ==
EActions.SET_QUANTITY_0)
11694 {
11696
11697 if (m_EM)
11698 {
11699 m_EM.SetEnergy(0);
11700 }
11701 }
11702
11703 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11704 {
11706
11707 if (m_EM)
11708 {
11709 m_EM.SetEnergy(m_EM.GetEnergyMax());
11710 }
11711 }
11712
11713 else if (action_id ==
EActions.ADD_HEALTH)
11714 {
11715 AddHealth("","",GetMaxHealth("","Health")/5);
11716 }
11717 else if (action_id ==
EActions.REMOVE_HEALTH)
11718 {
11719 AddHealth("","",-GetMaxHealth("","Health")/5);
11720 }
11721 else if (action_id ==
EActions.DESTROY_HEALTH)
11722 {
11723 SetHealth01("","",0);
11724 }
11725 else if (action_id ==
EActions.WATCH_ITEM)
11726 {
11728 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11729 #ifdef DEVELOPER
11730 SetDebugDeveloper_item(this);
11731 #endif
11732 }
11733
11734 else if (action_id ==
EActions.ADD_TEMPERATURE)
11735 {
11736 AddTemperature(20);
11737
11738 }
11739
11740 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11741 {
11742 AddTemperature(-20);
11743
11744 }
11745
11746 else if (action_id ==
EActions.FLIP_FROZEN)
11747 {
11748 SetFrozen(!GetIsFrozen());
11749
11750 }
11751
11752 else if (action_id ==
EActions.ADD_WETNESS)
11753 {
11755
11756 }
11757
11758 else if (action_id ==
EActions.REMOVE_WETNESS)
11759 {
11761
11762 }
11763
11764 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11765 {
11768
11769
11770 }
11771
11772 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11773 {
11776 }
11777
11778 else if (action_id ==
EActions.MAKE_SPECIAL)
11779 {
11780 auto debugParams = DebugSpawnParams.WithPlayer(player);
11781 OnDebugSpawnEx(debugParams);
11782 }
11783
11784 else if (action_id ==
EActions.DELETE)
11785 {
11786 Delete();
11787 }
11788
11789 }
11790
11791
11792 return false;
11793 }
11794
11795
11796
11797
11801
11804
11805
11806
11808 {
11809 return false;
11810 }
11811
11812
11814 {
11815 return true;
11816 }
11817
11818
11820 {
11821 return true;
11822 }
11823
11824
11825
11827 {
11828 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11830 }
11831
11834 {
11835 return null;
11836 }
11837
11839 {
11840 return false;
11841 }
11842
11844 {
11845 return false;
11846 }
11847
11851
11852
11854 {
11855 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11856 return module_repairing.CanRepair(this, item_repair_kit);
11857 }
11858
11859
11860 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11861 {
11862 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11863 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11864 }
11865
11866
11868 {
11869
11870
11871
11872
11873
11874
11875
11876
11877 return 1;
11878 }
11879
11880
11881
11883 {
11885 }
11886
11887
11888
11890 {
11892 }
11893
11894
11903 {
11904 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11905
11906 if (player)
11907 {
11908 player.MessageStatus(text);
11909 }
11910 }
11911
11912
11921 {
11922 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11923
11924 if (player)
11925 {
11926 player.MessageAction(text);
11927 }
11928 }
11929
11930
11939 {
11940 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11941
11942 if (player)
11943 {
11944 player.MessageFriendly(text);
11945 }
11946 }
11947
11948
11957 {
11958 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11959
11960 if (player)
11961 {
11962 player.MessageImportant(text);
11963 }
11964 }
11965
11967 {
11968 return true;
11969 }
11970
11971
11972 override bool KindOf(
string tag)
11973 {
11974 bool found = false;
11975 string item_name = this.
GetType();
11978
11979 int array_size = item_tag_array.Count();
11980 for (int i = 0; i < array_size; i++)
11981 {
11982 if (item_tag_array.Get(i) == tag)
11983 {
11984 found = true;
11985 break;
11986 }
11987 }
11988 return found;
11989 }
11990
11991
11993 {
11994
11995 super.OnRPC(sender, rpc_type,ctx);
11996
11997
11998 switch (rpc_type)
11999 {
12000 #ifndef SERVER
12001 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12002 Param2<bool, string> p = new Param2<bool, string>(false, "");
12003
12005 return;
12006
12007 bool play = p.param1;
12008 string soundSet = p.param2;
12009
12010 if (play)
12011 {
12013 {
12015 {
12017 }
12018 }
12019 else
12020 {
12022 }
12023 }
12024 else
12025 {
12027 }
12028
12029 break;
12030 #endif
12031
12032 }
12033
12035 {
12037 }
12038 }
12039
12040
12041
12042
12044 {
12045 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12046 return plugin.GetID(
name);
12047 }
12048
12050 {
12051 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12052 return plugin.GetName(id);
12053 }
12054
12057 {
12058
12059
12060 int varFlags;
12061 if (!ctx.
Read(varFlags))
12062 return;
12063
12064 if (varFlags & ItemVariableFlags.FLOAT)
12065 {
12067 }
12068 }
12069
12071 {
12072
12073 super.SerializeNumericalVars(floats_out);
12074
12075
12076
12078 {
12080 }
12081
12083 {
12085 }
12086
12088 {
12090 }
12091
12093 {
12098 }
12099
12101 {
12103 }
12104 }
12105
12107 {
12108
12109 super.DeSerializeNumericalVars(floats);
12110
12111
12112 int index = 0;
12113 int mask = Math.Round(floats.Get(index));
12114
12115 index++;
12116
12118 {
12120 {
12122 }
12123 else
12124 {
12125 float quantity = floats.Get(index);
12126 SetQuantity(quantity,
true,
false,
false,
false);
12127 }
12128 index++;
12129 }
12130
12132 {
12133 float wet = floats.Get(index);
12135 index++;
12136 }
12137
12139 {
12140 int liquidtype = Math.Round(floats.Get(index));
12142 index++;
12143 }
12144
12146 {
12148 index++;
12150 index++;
12152 index++;
12154 index++;
12155 }
12156
12158 {
12159 int cleanness = Math.Round(floats.Get(index));
12161 index++;
12162 }
12163 }
12164
12166 {
12167 super.WriteVarsToCTX(ctx);
12168
12169
12171 {
12173 }
12174
12176 {
12178 }
12179
12181 {
12183 }
12184
12186 {
12187 int r,g,b,a;
12193 }
12194
12196 {
12198 }
12199 }
12200
12202 {
12203 if (!super.ReadVarsFromCTX(ctx,version))
12204 return false;
12205
12206 int intValue;
12207 float value;
12208
12209 if (version < 140)
12210 {
12211 if (!ctx.
Read(intValue))
12212 return false;
12213
12214 m_VariablesMask = intValue;
12215 }
12216
12218 {
12219 if (!ctx.
Read(value))
12220 return false;
12221
12223 {
12225 }
12226 else
12227 {
12229 }
12230 }
12231
12232 if (version < 140)
12233 {
12235 {
12236 if (!ctx.
Read(value))
12237 return false;
12238 SetTemperatureDirect(value);
12239 }
12240 }
12241
12243 {
12244 if (!ctx.
Read(value))
12245 return false;
12247 }
12248
12250 {
12251 if (!ctx.
Read(intValue))
12252 return false;
12254 }
12255
12257 {
12258 int r,g,b,a;
12260 return false;
12262 return false;
12264 return false;
12266 return false;
12267
12269 }
12270
12272 {
12273 if (!ctx.
Read(intValue))
12274 return false;
12276 }
12277
12278 if (version >= 138 && version < 140)
12279 {
12281 {
12282 if (!ctx.
Read(intValue))
12283 return false;
12284 SetFrozen(intValue);
12285 }
12286 }
12287
12288 return true;
12289 }
12290
12291
12293 {
12296 {
12298 }
12299
12300 if (!super.OnStoreLoad(ctx, version))
12301 {
12303 return false;
12304 }
12305
12306 if (version >= 114)
12307 {
12308 bool hasQuickBarIndexSaved;
12309
12310 if (!ctx.
Read(hasQuickBarIndexSaved))
12311 {
12313 return false;
12314 }
12315
12316 if (hasQuickBarIndexSaved)
12317 {
12318 int itmQBIndex;
12319
12320
12321 if (!ctx.
Read(itmQBIndex))
12322 {
12324 return false;
12325 }
12326
12327 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12328 if (itmQBIndex != -1 && parentPlayer)
12329 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12330 }
12331 }
12332 else
12333 {
12334
12335 PlayerBase player;
12336 int itemQBIndex;
12337 if (version ==
int.
MAX)
12338 {
12339 if (!ctx.
Read(itemQBIndex))
12340 {
12342 return false;
12343 }
12344 }
12345 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12346 {
12347
12348 if (!ctx.
Read(itemQBIndex))
12349 {
12351 return false;
12352 }
12353 if (itemQBIndex != -1 && player)
12354 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12355 }
12356 }
12357
12358 if (version < 140)
12359 {
12360
12361 if (!LoadVariables(ctx, version))
12362 {
12364 return false;
12365 }
12366 }
12367
12368
12370 {
12372 return false;
12373 }
12374 if (version >= 132)
12375 {
12377 if (raib)
12378 {
12380 {
12382 return false;
12383 }
12384 }
12385 }
12386
12388 return true;
12389 }
12390
12391
12392
12394 {
12395 super.OnStoreSave(ctx);
12396
12397 PlayerBase player;
12398 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12399 {
12401
12402 int itemQBIndex = -1;
12403 itemQBIndex = player.FindQuickBarEntityIndex(this);
12404 ctx.
Write(itemQBIndex);
12405 }
12406 else
12407 {
12409 }
12410
12412
12414 if (raib)
12415 {
12417 }
12418 }
12419
12420
12422 {
12423 super.AfterStoreLoad();
12424
12426 {
12428 }
12429
12431 {
12434 }
12435 }
12436
12438 {
12439 super.EEOnAfterLoad();
12440
12442 {
12444 }
12445
12448 }
12449
12451 {
12452 return false;
12453 }
12454
12455
12456
12458 {
12460 {
12461 #ifdef PLATFORM_CONSOLE
12462
12464 {
12466 if (menu)
12467 {
12469 }
12470 }
12471 #endif
12472 }
12473
12475 {
12478 }
12479
12481 {
12482 SetWeightDirty();
12484 }
12486 {
12489 }
12490
12492 {
12495 }
12497 {
12500 }
12501
12502 super.OnVariablesSynchronized();
12503 }
12504
12505
12506
12508 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12509 {
12510 if (!IsServerCheck(allow_client))
12511 return false;
12512
12514 return false;
12515
12518
12519 if (value <= (min + 0.001))
12520 value = min;
12521
12522 if (value == min)
12523 {
12524 if (destroy_config)
12525 {
12526 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12527 if (dstr)
12528 {
12530 this.Delete();
12531 return true;
12532 }
12533 }
12534 else if (destroy_forced)
12535 {
12537 this.Delete();
12538 return true;
12539 }
12540
12542 }
12543
12546
12548 {
12550
12551 if (delta)
12553 }
12554
12556
12557 return false;
12558 }
12559
12560
12562 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12563 {
12565 }
12566
12568 {
12571 }
12572
12574 {
12577 }
12578
12581 {
12582 float value_clamped = Math.Clamp(value, 0, 1);
12584 SetQuantity(result, destroy_config, destroy_forced);
12585 }
12586
12587
12590 {
12592 }
12593
12595 {
12597 }
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12609 {
12610 int slot = -1;
12611 if (GetInventory())
12612 {
12613 InventoryLocation il = new InventoryLocation;
12614 GetInventory().GetCurrentInventoryLocation(il);
12616 }
12617
12619 }
12620
12622 {
12623 float quantity_max = 0;
12624
12626 {
12627 if (attSlotID != -1)
12628 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12629
12630 if (quantity_max <= 0)
12632 }
12633
12634 if (quantity_max <= 0)
12636
12637 return quantity_max;
12638 }
12639
12641 {
12643 }
12644
12646 {
12648 }
12649
12650
12652 {
12654 }
12655
12657 {
12659 }
12660
12662 {
12664 }
12665
12666
12668 {
12669
12670 float weightEx = GetWeightEx();
12671 float special = GetInventoryAndCargoWeight();
12672 return weightEx - special;
12673 }
12674
12675
12677 {
12679 }
12680
12682 {
12684 {
12685 #ifdef DEVELOPER
12686 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12687 {
12688 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12690 }
12691 #endif
12692
12693 return GetQuantity() * GetConfigWeightModified();
12694 }
12695 else if (HasEnergyManager())
12696 {
12697 #ifdef DEVELOPER
12698 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12699 {
12700 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12701 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12702 }
12703 #endif
12704 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12705 }
12706 else
12707 {
12708 #ifdef DEVELOPER
12709 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12710 {
12711 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12712 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12713 }
12714 #endif
12715 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12716 }
12717 }
12718
12721 {
12722 int item_count = 0;
12724
12725 if (GetInventory().GetCargo() != NULL)
12726 {
12727 item_count = GetInventory().GetCargo().GetItemCount();
12728 }
12729
12730 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12731 {
12732 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12733 if (item)
12734 item_count += item.GetNumberOfItems();
12735 }
12736 return item_count;
12737 }
12738
12741 {
12742 float weight = 0;
12743 float wetness = 1;
12744 if (include_wetness)
12747 {
12748 weight = wetness * m_ConfigWeight;
12749 }
12751 {
12752 weight = 1;
12753 }
12754 return weight;
12755 }
12756
12757
12758
12760 {
12761 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12762 {
12763 GameInventory inv = GetInventory();
12764 array<EntityAI> items = new array<EntityAI>;
12766 for (int i = 0; i < items.Count(); i++)
12767 {
12769 if (item)
12770 {
12772 }
12773 }
12774 }
12775 }
12776
12777
12778
12779
12781 {
12782 float energy = 0;
12783 if (HasEnergyManager())
12784 {
12785 energy = GetCompEM().GetEnergy();
12786 }
12787 return energy;
12788 }
12789
12790
12792 {
12793 super.OnEnergyConsumed();
12794
12796 }
12797
12799 {
12800 super.OnEnergyAdded();
12801
12803 }
12804
12805
12807 {
12808 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12809 {
12811 {
12812 float energy_0to1 = GetCompEM().GetEnergy0To1();
12814 }
12815 }
12816 }
12817
12818
12820 {
12821 return ConfigGetFloat("heatIsolation");
12822 }
12823
12825 {
12827 }
12828
12830 {
12831 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12832 if (
GetGame().ConfigIsExisting(paramPath))
12834
12835 return 0.0;
12836 }
12837
12839 {
12840 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12841 if (
GetGame().ConfigIsExisting(paramPath))
12843
12844 return 0.0;
12845 }
12846
12847 override void SetWet(
float value,
bool allow_client =
false)
12848 {
12849 if (!IsServerCheck(allow_client))
12850 return;
12851
12854
12856
12857 m_VarWet = Math.Clamp(value, min, max);
12858
12860 {
12863 }
12864 }
12865
12866 override void AddWet(
float value)
12867 {
12869 }
12870
12872 {
12874 }
12875
12877 {
12879 }
12880
12882 {
12884 }
12885
12887 {
12889 }
12890
12892 {
12894 }
12895
12896 override void OnWetChanged(
float newVal,
float oldVal)
12897 {
12900 if (newLevel != oldLevel)
12901 {
12903 }
12904 }
12905
12907 {
12908 SetWeightDirty();
12909 }
12910
12912 {
12913 return GetWetLevelInternal(
m_VarWet);
12914 }
12915
12916
12917
12919 {
12921 }
12922
12924 {
12926 }
12927
12929 {
12931 }
12932
12934 {
12936 }
12937
12938
12939
12941 {
12942 if (ConfigIsExisting("itemModelLength"))
12943 {
12944 return ConfigGetFloat("itemModelLength");
12945 }
12946 return 0;
12947 }
12948
12950 {
12951 if (ConfigIsExisting("itemAttachOffset"))
12952 {
12953 return ConfigGetFloat("itemAttachOffset");
12954 }
12955 return 0;
12956 }
12957
12958 override void SetCleanness(
int value,
bool allow_client =
false)
12959 {
12960 if (!IsServerCheck(allow_client))
12961 return;
12962
12964
12966
12969 }
12970
12972 {
12974 }
12975
12977 {
12978 return true;
12979 }
12980
12981
12982
12983
12985 {
12987 }
12988
12990 {
12992 }
12993
12994
12995
12996
12997 override void SetColor(
int r,
int g,
int b,
int a)
12998 {
13004 }
13006 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13007 {
13012 }
13013
13015 {
13017 }
13018
13021 {
13022 int r,g,b,a;
13024 r = r/255;
13025 g = g/255;
13026 b = b/255;
13027 a = a/255;
13028 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13029 }
13030
13031
13032
13033 override void SetLiquidType(
int value,
bool allow_client =
false)
13034 {
13035 if (!IsServerCheck(allow_client))
13036 return;
13037
13042 }
13043
13045 {
13046 return ConfigGetInt("varLiquidTypeInit");
13047 }
13048
13050 {
13052 }
13053
13055 {
13057 SetFrozen(false);
13058 }
13059
13062 {
13063 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13064 }
13065
13066
13069 {
13070 PlayerBase nplayer;
13071 if (PlayerBase.CastTo(nplayer, player))
13072 {
13074
13075 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13076 }
13077 }
13078
13079
13082 {
13083 PlayerBase nplayer;
13084 if (PlayerBase.CastTo(nplayer,player))
13085 {
13086
13087 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13088
13089 }
13090
13091
13092 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13093
13094
13095 if (HasEnergyManager())
13096 {
13097 GetCompEM().UpdatePlugState();
13098 }
13099 }
13100
13101
13103 {
13104 super.OnPlacementStarted(player);
13105
13107 }
13108
13109 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13110 {
13112 {
13113 m_AdminLog.OnPlacementComplete(player,
this);
13114 }
13115
13116 super.OnPlacementComplete(player, position, orientation);
13117 }
13118
13119
13120
13121
13122
13124 {
13126 {
13127 return true;
13128 }
13129 else
13130 {
13131 return false;
13132 }
13133 }
13134
13135
13137 {
13139 {
13141 }
13142 }
13143
13144
13146 {
13148 }
13149
13151 {
13153 }
13154
13155 override void InsertAgent(
int agent,
float count = 1)
13156 {
13157 if (count < 1)
13158 return;
13159
13161 }
13162
13165 {
13167 }
13168
13169
13171 {
13173 }
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13217 {
13219 return false;
13220 return true;
13221 }
13222
13224 {
13225
13227 }
13228
13229
13232 {
13233 super.CheckForRoofLimited(timeTresholdMS);
13234
13236 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13237 {
13238 m_PreviousRoofTestTime = time;
13239 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13240 }
13241 }
13242
13243
13245 {
13247 {
13248 return 0;
13249 }
13250
13251 if (GetInventory().GetAttachmentSlotsCount() != 0)
13252 {
13253 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13254 if (filter)
13255 return filter.GetProtectionLevel(type, false, system);
13256 else
13257 return 0;
13258 }
13259
13260 string subclassPath, entryName;
13261
13262 switch (type)
13263 {
13265 entryName = "biological";
13266 break;
13268 entryName = "chemical";
13269 break;
13270 default:
13271 entryName = "biological";
13272 break;
13273 }
13274
13275 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13276
13278 }
13279
13280
13281
13284 {
13285 if (!IsMagazine())
13287
13289 }
13290
13291
13292
13293
13294
13299 {
13300 return true;
13301 }
13302
13304 {
13306 }
13307
13308
13309
13310
13311
13313 {
13314 if (parent)
13315 {
13316 if (parent.IsInherited(DayZInfected))
13317 return true;
13318
13319 if (!parent.IsRuined())
13320 return true;
13321 }
13322
13323 return true;
13324 }
13325
13327 {
13328 if (!super.CanPutAsAttachment(parent))
13329 {
13330 return false;
13331 }
13332
13333 if (!IsRuined() && !parent.IsRuined())
13334 {
13335 return true;
13336 }
13337
13338 return false;
13339 }
13340
13342 {
13343
13344
13345
13346
13347 return super.CanReceiveItemIntoCargo(item);
13348 }
13349
13351 {
13352
13353
13354
13355
13356 GameInventory attachmentInv = attachment.GetInventory();
13358 {
13359 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13360 return false;
13361 }
13362
13363 InventoryLocation loc = new InventoryLocation();
13364 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13365 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13366 return false;
13367
13368 return super.CanReceiveAttachment(attachment, slotId);
13369 }
13370
13372 {
13373 if (!super.CanReleaseAttachment(attachment))
13374 return false;
13375
13376 return GetInventory().AreChildrenAccessible();
13377 }
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13400 {
13401 int id = muzzle_owner.GetMuzzleID();
13402 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13403
13404 if (WPOF_array)
13405 {
13406 for (int i = 0; i < WPOF_array.Count(); i++)
13407 {
13408 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13409
13410 if (WPOF)
13411 {
13412 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13413 }
13414 }
13415 }
13416 }
13417
13418
13420 {
13421 int id = muzzle_owner.GetMuzzleID();
13423
13424 if (WPOBE_array)
13425 {
13426 for (int i = 0; i < WPOBE_array.Count(); i++)
13427 {
13428 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13429
13430 if (WPOBE)
13431 {
13432 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13433 }
13434 }
13435 }
13436 }
13437
13438
13440 {
13441 int id = muzzle_owner.GetMuzzleID();
13442 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13443
13444 if (WPOOH_array)
13445 {
13446 for (int i = 0; i < WPOOH_array.Count(); i++)
13447 {
13448 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13449
13450 if (WPOOH)
13451 {
13452 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13453 }
13454 }
13455 }
13456 }
13457
13458
13460 {
13461 int id = muzzle_owner.GetMuzzleID();
13462 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13463
13464 if (WPOOH_array)
13465 {
13466 for (int i = 0; i < WPOOH_array.Count(); i++)
13467 {
13468 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13469
13470 if (WPOOH)
13471 {
13472 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13473 }
13474 }
13475 }
13476 }
13477
13478
13480 {
13481 int id = muzzle_owner.GetMuzzleID();
13482 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13483
13484 if (WPOOH_array)
13485 {
13486 for (int i = 0; i < WPOOH_array.Count(); i++)
13487 {
13488 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13489
13490 if (WPOOH)
13491 {
13492 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13493 }
13494 }
13495 }
13496 }
13497
13498
13499
13501 {
13503 {
13504 return true;
13505 }
13506
13507 return false;
13508 }
13509
13511 {
13513 {
13514 return true;
13515 }
13516
13517 return false;
13518 }
13519
13521 {
13523 {
13524 return true;
13525 }
13526
13527 return false;
13528 }
13529
13531 {
13532 return false;
13533 }
13534
13537 {
13538 return UATimeSpent.DEFAULT_DEPLOY;
13539 }
13540
13541
13542
13543
13545 {
13547 SetSynchDirty();
13548 }
13549
13551 {
13553 }
13554
13555
13557 {
13558 return false;
13559 }
13560
13563 {
13564 string att_type = "None";
13565
13566 if (ConfigIsExisting("soundAttType"))
13567 {
13568 att_type = ConfigGetString("soundAttType");
13569 }
13570
13572 }
13573
13575 {
13577 }
13578
13579
13580
13581
13582
13586
13588 {
13591
13593 }
13594
13595
13597 {
13599 return;
13600
13602
13605
13608
13609 SoundParameters params = new SoundParameters();
13613 }
13614
13615
13617 {
13619 return;
13620
13622 SetSynchDirty();
13623
13626 }
13627
13628
13630 {
13632 return;
13633
13635 SetSynchDirty();
13636
13639 }
13640
13642 {
13644 }
13645
13647 {
13649 }
13650
13653 {
13654 if (!
GetGame().IsDedicatedServer())
13655 {
13656 if (ConfigIsExisting("attachSoundSet"))
13657 {
13658 string cfg_path = "";
13659 string soundset = "";
13660 string type_name =
GetType();
13661
13664 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13665 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13666
13667 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13668 {
13669 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13670 {
13671 if (cfg_slot_array[i] == slot_type)
13672 {
13673 soundset = cfg_soundset_array[i];
13674 break;
13675 }
13676 }
13677 }
13678
13679 if (soundset != "")
13680 {
13681 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13683 }
13684 }
13685 }
13686 }
13687
13689 {
13690
13691 }
13692
13693 void OnApply(PlayerBase player);
13694
13696 {
13697 return 1.0;
13698 };
13699
13701 {
13703 }
13704
13706 {
13708 }
13709
13711
13713 {
13714 SetDynamicPhysicsLifeTime(0.01);
13716 }
13717
13719 {
13720 array<string> zone_names = new array<string>;
13721 GetDamageZones(zone_names);
13722 for (int i = 0; i < zone_names.Count(); i++)
13723 {
13724 SetHealthMax(zone_names.Get(i),"Health");
13725 }
13726 SetHealthMax("","Health");
13727 }
13728
13731 {
13732 float global_health = GetHealth01("","Health");
13733 array<string> zones = new array<string>;
13734 GetDamageZones(zones);
13735
13736 for (int i = 0; i < zones.Count(); i++)
13737 {
13738 SetHealth01(zones.Get(i),"Health",global_health);
13739 }
13740 }
13741
13744 {
13745 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13746 }
13747
13749 {
13750 if (!hasRootAsPlayer)
13751 {
13752 if (refParentIB)
13753 {
13754
13755 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13756 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13757
13758 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13759 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13760
13763 }
13764 else
13765 {
13766
13769 }
13770 }
13771 }
13772
13774 {
13776 {
13777 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13778 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13779 {
13780 float heatPermCoef = 1.0;
13782 while (ent)
13783 {
13784 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13785 ent = ent.GetHierarchyParent();
13786 }
13787
13788 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13789 }
13790 }
13791 }
13792
13794 {
13795
13796 EntityAI parent = GetHierarchyParent();
13797 if (!parent)
13798 {
13799 hasParent = false;
13800 hasRootAsPlayer = false;
13801 }
13802 else
13803 {
13804 hasParent = true;
13805 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13806 refParentIB =
ItemBase.Cast(parent);
13807 }
13808 }
13809
13810 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13811 {
13812
13813 }
13814
13816 {
13817
13818 return false;
13819 }
13820
13822 {
13823
13824
13825 return false;
13826 }
13827
13829 {
13830
13831 return false;
13832 }
13833
13836 {
13837 return !GetIsFrozen() &&
IsOpen();
13838 }
13839
13841 {
13842 bool hasParent = false, hasRootAsPlayer = false;
13844
13845 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13846 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13847
13848 if (wwtu || foodDecay)
13849 {
13853
13854 if (processWetness || processTemperature || processDecay)
13855 {
13857
13858 if (processWetness)
13859 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13860
13861 if (processTemperature)
13863
13864 if (processDecay)
13865 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13866 }
13867 }
13868 }
13869
13872 {
13874 }
13875
13877 {
13880
13881 return super.GetTemperatureFreezeThreshold();
13882 }
13883
13885 {
13888
13889 return super.GetTemperatureThawThreshold();
13890 }
13891
13893 {
13896
13897 return super.GetItemOverheatThreshold();
13898 }
13899
13901 {
13903 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13904
13905 return super.GetTemperatureFreezeTime();
13906 }
13907
13909 {
13911 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13912
13913 return super.GetTemperatureThawTime();
13914 }
13915
13920
13922 {
13923 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13924 }
13925
13927 {
13928 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13929 }
13930
13933 {
13935 }
13936
13938 {
13940 }
13941
13943 {
13945 }
13946
13949 {
13950 return null;
13951 }
13952
13955 {
13956 return false;
13957 }
13958
13960 {
13962 {
13965 if (!trg)
13966 {
13968 explosive = this;
13969 }
13970
13971 explosive.PairRemote(trg);
13973
13974 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13975 trg.SetPersistentPairID(persistentID);
13976 explosive.SetPersistentPairID(persistentID);
13977
13978 return true;
13979 }
13980 return false;
13981 }
13982
13985 {
13986 float ret = 1.0;
13989 ret *= GetHealth01();
13990
13991 return ret;
13992 }
13993
13994 #ifdef DEVELOPER
13995 override void SetDebugItem()
13996 {
13997 super.SetDebugItem();
13998 _itemBase = this;
13999 }
14000
14002 {
14003 string text = super.GetDebugText();
14004
14006 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14007
14008 return text;
14009 }
14010 #endif
14011
14013 {
14014 return true;
14015 }
14016
14018
14020
14022 {
14025 }
14026
14027
14035
14051}
14052
14054{
14056 if (entity)
14057 {
14058 bool is_item = entity.IsInherited(
ItemBase);
14059 if (is_item && full_quantity)
14060 {
14063 }
14064 }
14065 else
14066 {
14068 return NULL;
14069 }
14070 return entity;
14071}
14072
14074{
14075 if (item)
14076 {
14077 if (health > 0)
14078 item.SetHealth("", "", health);
14079
14080 if (item.CanHaveTemperature())
14081 {
14083 if (item.CanFreeze())
14084 item.SetFrozen(false);
14085 }
14086
14087 if (item.HasEnergyManager())
14088 {
14089 if (quantity >= 0)
14090 {
14091 item.GetCompEM().SetEnergy0To1(quantity);
14092 }
14093 else
14094 {
14096 }
14097 }
14098 else if (item.IsMagazine())
14099 {
14100 Magazine mag = Magazine.Cast(item);
14101 if (quantity >= 0)
14102 {
14103 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14104 }
14105 else
14106 {
14108 }
14109
14110 }
14111 else
14112 {
14113 if (quantity >= 0)
14114 {
14115 item.SetQuantityNormalized(quantity, false);
14116 }
14117 else
14118 {
14120 }
14121
14122 }
14123 }
14124}
14125
14126#ifdef DEVELOPER
14128#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.