9295{
9297 {
9298 return true;
9299 }
9300};
9301
9302
9303
9305{
9309
9311
9314
9315
9316
9317
9318
9327
9333
9338
9343
9364 protected bool m_IsResultOfSplit
9365
9367
9372
9373
9374
9376
9380
9381
9382
9384
9387
9388
9389
9395
9396
9404
9407
9408
9410
9411
9413
9414
9419
9420
9425
9426
9428
9429
9431 {
9436
9437 if (!
GetGame().IsDedicatedServer())
9438 {
9440 {
9442
9444 {
9446 }
9447 }
9448
9451 }
9452
9453 m_OldLocation = null;
9454
9456 {
9458 }
9459
9460 if (ConfigIsExisting("headSelectionsToHide"))
9461 {
9464 }
9465
9467 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9468 {
9470 }
9471
9473
9474 m_IsResultOfSplit = false;
9475
9477 }
9478
9480 {
9481 super.InitItemVariables();
9482
9488 m_Count = ConfigGetInt(
"count");
9489
9492
9497
9500
9505
9517
9521
9522
9525 if (ConfigIsExisting("canBeSplit"))
9526 {
9529 }
9530
9532 if (ConfigIsExisting("itemBehaviour"))
9534
9535
9538 RegisterNetSyncVariableInt("m_VarLiquidType");
9539 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9540
9541 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9542 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9543 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9544
9545 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9546 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9547 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9548 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9549
9550 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9551 RegisterNetSyncVariableBool("m_IsTakeable");
9552 RegisterNetSyncVariableBool("m_IsHologram");
9553
9556 {
9559 }
9560
9562
9564 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9566
9567 }
9568
9570 {
9572 }
9573
9575 {
9578 {
9583 }
9584 }
9585
9586 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9587 {
9589 {
9592 }
9593
9595 }
9596
9598 {
9604 }
9605
9607
9609 {
9611
9612 if (!action)
9613 {
9614 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9615 return;
9616 }
9617
9619 if (!ai)
9620 {
9622 return;
9623 }
9624
9626 if (!action_array)
9627 {
9628 action_array = new array<ActionBase_Basic>;
9630 }
9631 if (LogManager.IsActionLogEnable())
9632 {
9633 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9634 }
9635
9636 if (action_array.Find(action) != -1)
9637 {
9638 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9639 }
9640 else
9641 {
9642 action_array.Insert(action);
9643 }
9644 }
9645
9647 {
9649 ActionBase action = player.GetActionManager().GetAction(actionName);
9652
9653 if (action_array)
9654 {
9655 action_array.RemoveItem(action);
9656 }
9657 }
9658
9659
9660
9662 {
9663 ActionOverrideData overrideData = new ActionOverrideData();
9667
9669 if (!actionMap)
9670 {
9673 }
9674
9675 actionMap.Insert(this.
Type(), overrideData);
9676
9677 }
9678
9680
9682
9683
9685 {
9688
9691
9692 string config_to_search = "CfgVehicles";
9693 string muzzle_owner_config;
9694
9696 {
9697 if (IsInherited(Weapon))
9698 config_to_search = "CfgWeapons";
9699
9700 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9701
9702 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9703
9705
9706 if (config_OnFire_subclass_count > 0)
9707 {
9708 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9709
9710 for (int i = 0; i < config_OnFire_subclass_count; i++)
9711 {
9712 string particle_class = "";
9714 string config_OnFire_entry = config_OnFire_class + particle_class;
9715 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9716 WPOF_array.Insert(WPOF);
9717 }
9718
9719
9721 }
9722 }
9723
9725 {
9726 config_to_search = "CfgWeapons";
9727 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9728
9729 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9730
9732
9733 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9734 {
9735 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9736
9737 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9738 {
9739 string particle_class2 = "";
9741 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9742 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9743 WPOBE_array.Insert(WPOBE);
9744 }
9745
9746
9748 }
9749 }
9750 }
9751
9752
9754 {
9757
9759 {
9760 string config_to_search = "CfgVehicles";
9761
9762 if (IsInherited(Weapon))
9763 config_to_search = "CfgWeapons";
9764
9765 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9766 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9767
9768 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9769 {
9770
9772
9774 {
9776 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9778 return;
9779 }
9780
9783
9784
9785
9787 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9788
9789 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9790 {
9791 string particle_class = "";
9793 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9795
9796 if (entry_type == CT_CLASS)
9797 {
9798 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9799 WPOOH_array.Insert(WPOF);
9800 }
9801 }
9802
9803
9805 }
9806 }
9807 }
9808
9810 {
9812 }
9813
9815 {
9817 {
9819
9822
9825
9826 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9827 }
9828 }
9829
9831 {
9833 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9834
9836 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9837
9839 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9840
9842 {
9844 }
9845 }
9846
9848 {
9850 }
9851
9853 {
9856 else
9858
9860 {
9863 }
9864 else
9865 {
9868
9871 }
9872
9874 }
9875
9877 {
9879 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9880 }
9881
9883 {
9885 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9887 }
9888
9890 {
9892 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9893 }
9894
9896 {
9899
9900 OverheatingParticle OP = new OverheatingParticle();
9905
9907 }
9908
9910 {
9913
9914 return -1;
9915 }
9916
9918 {
9920 {
9923
9924 for (int i = count; i > 0; --i)
9925 {
9926 int id = i - 1;
9929
9932
9933 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9934 {
9935 if (p)
9936 {
9939 }
9940 }
9941 }
9942 }
9943 }
9944
9946 {
9948 {
9950 {
9951 int id = i - 1;
9953
9954 if (OP)
9955 {
9957
9958 if (p)
9959 {
9961 }
9962
9963 delete OP;
9964 }
9965 }
9966
9969 }
9970 }
9971
9974 {
9975 return 0.0;
9976 }
9977
9978
9980 {
9981 return 250;
9982 }
9983
9985 {
9986 return 0;
9987 }
9988
9991 {
9993 return true;
9994
9995 return false;
9996 }
9997
10000 {
10003
10005 {
10007 }
10008 else
10009 {
10010
10012 }
10013
10015 }
10016
10023 {
10024 return -1;
10025 }
10026
10027
10028
10029
10031 {
10033 {
10035 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10036
10037 if (r_index >= 0)
10038 {
10039 InventoryLocation r_il = new InventoryLocation;
10040 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10041
10042 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10045 {
10046 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10047 }
10049 {
10050 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10051 }
10052
10053 }
10054
10055 player.GetHumanInventory().ClearUserReservedLocation(this);
10056 }
10057
10060 }
10061
10062
10063
10064
10066 {
10067 return ItemBase.m_DebugActionsMask;
10068 }
10069
10071 {
10072 return ItemBase.m_DebugActionsMask & mask;
10073 }
10074
10076 {
10077 ItemBase.m_DebugActionsMask = mask;
10078 }
10079
10081 {
10082 ItemBase.m_DebugActionsMask |= mask;
10083 }
10084
10086 {
10087 ItemBase.m_DebugActionsMask &= ~mask;
10088 }
10089
10091 {
10093 {
10095 }
10096 else
10097 {
10099 }
10100 }
10101
10102
10104 {
10105 if (GetEconomyProfile())
10106 {
10107 float q_max = GetEconomyProfile().GetQuantityMax();
10108 if (q_max > 0)
10109 {
10110 float q_min = GetEconomyProfile().GetQuantityMin();
10111 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10112
10114 {
10115 ComponentEnergyManager comp = GetCompEM();
10117 {
10119 }
10120 }
10122 {
10124
10125 }
10126
10127 }
10128 }
10129 }
10130
10133 {
10134 EntityAI parent = GetHierarchyParent();
10135
10136 if (parent)
10137 {
10138 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10139 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10140 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10141 }
10142 }
10143
10146 {
10147 EntityAI parent = GetHierarchyParent();
10148
10149 if (parent)
10150 {
10151 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10152 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10153 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10154 }
10155 }
10156
10158 {
10159
10160
10161
10162
10164
10166 {
10167 if (ScriptInputUserData.CanStoreInputUserData())
10168 {
10169 ScriptInputUserData ctx = new ScriptInputUserData;
10175 ctx.
Write(use_stack_max);
10178
10180 {
10181 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10182 }
10183 }
10184 }
10185 else if (!
GetGame().IsMultiplayer())
10186 {
10188 }
10189 }
10190
10192 {
10194 }
10195
10197 {
10199 }
10200
10202 {
10204 }
10205
10207 {
10208
10209 return false;
10210 }
10211
10213 {
10214 return false;
10215 }
10216
10220 {
10221 return false;
10222 }
10223
10225 {
10226 return "";
10227 }
10228
10230
10232 {
10233 return false;
10234 }
10235
10237 {
10238 return true;
10239 }
10240
10241
10242
10244 {
10245 return true;
10246 }
10247
10249 {
10250 return true;
10251 }
10252
10254 {
10255 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10257 }
10258
10260 {
10262 }
10263
10265 {
10267 if (!is_being_placed)
10269 SetSynchDirty();
10270 }
10271
10272
10274
10276 {
10278 }
10279
10281 {
10283 }
10284
10286 {
10287 return 1;
10288 }
10289
10291 {
10292 return false;
10293 }
10294
10296 {
10298 SetSynchDirty();
10299 }
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10336 {
10337 super.OnMovedInsideCargo(container);
10338
10339 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10340 }
10341
10342 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10343 {
10344 super.EEItemLocationChanged(oldLoc,newLoc);
10345
10346 PlayerBase new_player = null;
10347 PlayerBase old_player = null;
10348
10349 if (newLoc.GetParent())
10350 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10351
10352 if (oldLoc.GetParent())
10353 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10354
10356 {
10357 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10358
10359 if (r_index >= 0)
10360 {
10361 InventoryLocation r_il = new InventoryLocation;
10362 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10363
10364 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10367 {
10368 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10369 }
10371 {
10372 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10373 }
10374
10375 }
10376 }
10377
10379 {
10380 if (new_player)
10381 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10382
10383 if (new_player == old_player)
10384 {
10385
10386 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10387 {
10389 {
10390 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10391 {
10392 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10393 }
10394 }
10395 else
10396 {
10397 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10398 }
10399 }
10400
10401 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10402 {
10403 int type = oldLoc.GetType();
10405 {
10406 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10407 }
10409 {
10410 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10411 }
10412 }
10413 if (!m_OldLocation)
10414 {
10415 m_OldLocation = new InventoryLocation;
10416 }
10417 m_OldLocation.Copy(oldLoc);
10418 }
10419 else
10420 {
10421 if (m_OldLocation)
10422 {
10423 m_OldLocation.Reset();
10424 }
10425 }
10426
10428 }
10429 else
10430 {
10431 if (new_player)
10432 {
10433 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10434 if (res_index >= 0)
10435 {
10436 InventoryLocation il = new InventoryLocation;
10437 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10439 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10442 {
10443 il.
GetParent().GetOnReleaseLock().Invoke(it);
10444 }
10446 {
10448 }
10449
10450 }
10451 }
10453 {
10454
10456 }
10457
10458 if (m_OldLocation)
10459 {
10460 m_OldLocation.Reset();
10461 }
10462 }
10463 }
10464
10465 override void EOnContact(IEntity other, Contact extra)
10466 {
10468 {
10469 int liquidType = -1;
10471 if (impactSpeed > 0.0)
10472 {
10474 #ifndef SERVER
10476 #else
10478 SetSynchDirty();
10479 #endif
10481 }
10482 }
10483
10484 #ifdef SERVER
10485 if (GetCompEM() && GetCompEM().IsPlugged())
10486 {
10487 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10488 GetCompEM().UnplugThis();
10489 }
10490 #endif
10491 }
10492
10494
10496 {
10498 }
10499
10501 {
10502
10503 }
10504
10506 {
10507 super.OnItemLocationChanged(old_owner, new_owner);
10508
10509 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10510 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10511
10512 if (!relatedPlayer && playerNew)
10513 relatedPlayer = playerNew;
10514
10515 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10516 {
10518 if (actionMgr)
10519 {
10520 ActionBase currentAction = actionMgr.GetRunningAction();
10521 if (currentAction)
10523 }
10524 }
10525
10526 Man ownerPlayerOld = null;
10527 Man ownerPlayerNew = null;
10528
10529 if (old_owner)
10530 {
10531 if (old_owner.
IsMan())
10532 {
10533 ownerPlayerOld = Man.Cast(old_owner);
10534 }
10535 else
10536 {
10537 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10538 }
10539 }
10540 else
10541 {
10543 {
10545
10546 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10547 {
10548 GetCompEM().UnplugThis();
10549 }
10550 }
10551 }
10552
10553 if (new_owner)
10554 {
10555 if (new_owner.
IsMan())
10556 {
10557 ownerPlayerNew = Man.Cast(new_owner);
10558 }
10559 else
10560 {
10561 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10562 }
10563 }
10564
10565 if (ownerPlayerOld != ownerPlayerNew)
10566 {
10567 if (ownerPlayerOld)
10568 {
10569 array<EntityAI> subItemsExit = new array<EntityAI>;
10571 for (int i = 0; i < subItemsExit.Count(); i++)
10572 {
10575 }
10576 }
10577
10578 if (ownerPlayerNew)
10579 {
10580 array<EntityAI> subItemsEnter = new array<EntityAI>;
10582 for (int j = 0; j < subItemsEnter.Count(); j++)
10583 {
10586 }
10587 }
10588 }
10589 else if (ownerPlayerNew != null)
10590 {
10591 PlayerBase nplayer;
10592 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10593 {
10594 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10596 for (int k = 0; k < subItemsUpdate.Count(); k++)
10597 {
10599 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10600 }
10601 }
10602 }
10603
10604 if (old_owner)
10605 old_owner.OnChildItemRemoved(this);
10606 if (new_owner)
10607 new_owner.OnChildItemReceived(this);
10608 }
10609
10610
10612 {
10613 super.EEDelete(parent);
10614 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10615 if (player)
10616 {
10618
10619 if (player.IsAlive())
10620 {
10621 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10622 if (r_index >= 0)
10623 {
10624 InventoryLocation r_il = new InventoryLocation;
10625 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10626
10627 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10630 {
10631 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10632 }
10634 {
10635 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10636 }
10637
10638 }
10639
10640 player.RemoveQuickBarEntityShortcut(this);
10641 }
10642 }
10643 }
10644
10646 {
10647 super.EEKilled(killer);
10648
10651 {
10652 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10653 {
10654 if (IsMagazine())
10655 {
10656 if (Magazine.Cast(this).GetAmmoCount() > 0)
10657 {
10659 }
10660 }
10661 else
10662 {
10664 }
10665 }
10666 }
10667 }
10668
10670 {
10671 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10672
10673 super.OnWasAttached(parent, slot_id);
10674
10677
10679 }
10680
10682 {
10683 super.OnWasDetached(parent, slot_id);
10684
10687 }
10688
10690 {
10691 int idx;
10694
10695 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10696 if (inventory_slots.Count() < 1)
10697 {
10698 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10699 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10700 }
10701 else
10702 {
10703 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10704 }
10705
10706 idx = inventory_slots.Find(slot);
10707 if (idx < 0)
10708 return "";
10709
10710 return attach_types.Get(idx);
10711 }
10712
10714 {
10715 int idx = -1;
10716 string slot;
10717
10720
10721 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10722 if (inventory_slots.Count() < 1)
10723 {
10724 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10725 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10726 }
10727 else
10728 {
10729 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10730 if (detach_types.Count() < 1)
10731 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10732 }
10733
10734 for (int i = 0; i < inventory_slots.Count(); i++)
10735 {
10736 slot = inventory_slots.Get(i);
10737 }
10738
10739 if (slot != "")
10740 {
10741 if (detach_types.Count() == 1)
10742 idx = 0;
10743 else
10744 idx = inventory_slots.Find(slot);
10745 }
10746 if (idx < 0)
10747 return "";
10748
10749 return detach_types.Get(idx);
10750 }
10751
10753 {
10754
10756
10757
10758 float min_time = 1;
10759 float max_time = 3;
10760 float delay = Math.RandomFloat(min_time, max_time);
10761
10762 explode_timer.Run(delay, this, "DoAmmoExplosion");
10763 }
10764
10766 {
10767 Magazine magazine = Magazine.Cast(this);
10768 int pop_sounds_count = 6;
10769 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10770
10771
10772 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10773 string sound_name = pop_sounds[ sound_idx ];
10775
10776
10777 magazine.ServerAddAmmoCount(-1);
10778
10779
10780 float min_temp_to_explode = 100;
10781
10782 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10783 {
10785 }
10786 }
10787
10788
10789 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10790 {
10791 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10792
10793 const int CHANCE_DAMAGE_CARGO = 4;
10794 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10795 const int CHANCE_DAMAGE_NOTHING = 2;
10796
10798 {
10799 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10800 int chances;
10801 int rnd;
10802
10803 if (GetInventory().GetCargo())
10804 {
10805 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10806 rnd = Math.RandomInt(0,chances);
10807
10808 if (rnd < CHANCE_DAMAGE_CARGO)
10809 {
10811 }
10812 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10813 {
10815 }
10816 }
10817 else
10818 {
10819 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10820 rnd = Math.RandomInt(0,chances);
10821
10822 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10823 {
10825 }
10826 }
10827 }
10828 }
10829
10831 {
10832 if (GetInventory().GetCargo())
10833 {
10834 int item_count = GetInventory().GetCargo().GetItemCount();
10835 if (item_count > 0)
10836 {
10837 int random_pick = Math.RandomInt(0, item_count);
10839 if (!item.IsExplosive())
10840 {
10841 item.AddHealth("","",damage);
10842 return true;
10843 }
10844 }
10845 }
10846 return false;
10847 }
10848
10850 {
10851 int attachment_count = GetInventory().AttachmentCount();
10852 if (attachment_count > 0)
10853 {
10854 int random_pick = Math.RandomInt(0, attachment_count);
10855 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10856 if (!attachment.IsExplosive())
10857 {
10858 attachment.AddHealth("","",damage);
10859 return true;
10860 }
10861 }
10862 return false;
10863 }
10864
10866 {
10868 }
10869
10871 {
10873 return GetInventory().CanRemoveEntity();
10874
10875 return false;
10876 }
10877
10879 {
10881 return;
10882
10884 {
10885 if (ScriptInputUserData.CanStoreInputUserData())
10886 {
10887 ScriptInputUserData ctx = new ScriptInputUserData;
10892 ctx.
Write(destination_entity);
10894 ctx.
Write(slot_id);
10896 }
10897 }
10898 else if (!
GetGame().IsMultiplayer())
10899 {
10901 }
10902 }
10903
10905 {
10907 return;
10908
10909 float split_quantity_new;
10913 InventoryLocation loc = new InventoryLocation;
10914
10915 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10916 {
10918 split_quantity_new = stack_max;
10919 else
10921
10922 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10923 if (new_item)
10924 {
10925 new_item.SetResultOfSplit(true);
10926 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10928 new_item.SetQuantity(split_quantity_new);
10929 }
10930 }
10931 else if (destination_entity && slot_id == -1)
10932 {
10933 if (quantity > stack_max)
10934 split_quantity_new = stack_max;
10935 else
10936 split_quantity_new = quantity;
10937
10939 {
10942 }
10943
10944 if (new_item)
10945 {
10946 new_item.SetResultOfSplit(true);
10947 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10949 new_item.SetQuantity(split_quantity_new);
10950 }
10951 }
10952 else
10953 {
10954 if (stack_max != 0)
10955 {
10957 {
10959 }
10960
10961 if (split_quantity_new == 0)
10962 {
10963 if (!
GetGame().IsMultiplayer())
10964 player.PhysicalPredictiveDropItem(this);
10965 else
10966 player.ServerDropEntity(this);
10967 return;
10968 }
10969
10971
10972 if (new_item)
10973 {
10974 new_item.SetResultOfSplit(true);
10975 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10977 new_item.SetQuantity(stack_max);
10978 new_item.PlaceOnSurface();
10979 }
10980 }
10981 }
10982 }
10983
10985 {
10987 return;
10988
10989 float split_quantity_new;
10993 InventoryLocation loc = new InventoryLocation;
10994
10995 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10996 {
10998 split_quantity_new = stack_max;
10999 else
11001
11002 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11003 if (new_item)
11004 {
11005 new_item.SetResultOfSplit(true);
11006 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11008 new_item.SetQuantity(split_quantity_new);
11009 }
11010 }
11011 else if (destination_entity && slot_id == -1)
11012 {
11013 if (quantity > stack_max)
11014 split_quantity_new = stack_max;
11015 else
11016 split_quantity_new = quantity;
11017
11019 {
11022 }
11023
11024 if (new_item)
11025 {
11026 new_item.SetResultOfSplit(true);
11027 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11029 new_item.SetQuantity(split_quantity_new);
11030 }
11031 }
11032 else
11033 {
11034 if (stack_max != 0)
11035 {
11037 {
11039 }
11040
11042
11043 if (new_item)
11044 {
11045 new_item.SetResultOfSplit(true);
11046 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11048 new_item.SetQuantity(stack_max);
11049 new_item.PlaceOnSurface();
11050 }
11051 }
11052 }
11053 }
11054
11056 {
11058 return;
11059
11061 {
11062 if (ScriptInputUserData.CanStoreInputUserData())
11063 {
11064 ScriptInputUserData ctx = new ScriptInputUserData;
11069 dst.WriteToContext(ctx);
11071 }
11072 }
11073 else if (!
GetGame().IsMultiplayer())
11074 {
11076 }
11077 }
11078
11080 {
11082 return;
11083
11085 {
11086 if (ScriptInputUserData.CanStoreInputUserData())
11087 {
11088 ScriptInputUserData ctx = new ScriptInputUserData;
11093 ctx.
Write(destination_entity);
11099 }
11100 }
11101 else if (!
GetGame().IsMultiplayer())
11102 {
11104 }
11105 }
11106
11108 {
11110 }
11111
11113 {
11115 return this;
11116
11118 float split_quantity_new;
11120 if (dst.IsValid())
11121 {
11122 int slot_id = dst.GetSlot();
11124
11125 if (quantity > stack_max)
11126 split_quantity_new = stack_max;
11127 else
11128 split_quantity_new = quantity;
11129
11131
11132 if (new_item)
11133 {
11134 new_item.SetResultOfSplit(true);
11135 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11138 }
11139
11140 return new_item;
11141 }
11142
11143 return null;
11144 }
11145
11147 {
11149 return;
11150
11152 float split_quantity_new;
11154 if (destination_entity)
11155 {
11157 if (quantity > stackable)
11158 split_quantity_new = stackable;
11159 else
11160 split_quantity_new = quantity;
11161
11162 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11163 if (new_item)
11164 {
11165 new_item.SetResultOfSplit(true);
11166 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11168 new_item.SetQuantity(split_quantity_new);
11169 }
11170 }
11171 }
11172
11174 {
11176 return;
11177
11179 {
11180 if (ScriptInputUserData.CanStoreInputUserData())
11181 {
11182 ScriptInputUserData ctx = new ScriptInputUserData;
11187 ItemBase destination_entity =
this;
11188 ctx.
Write(destination_entity);
11192 }
11193 }
11194 else if (!
GetGame().IsMultiplayer())
11195 {
11197 }
11198 }
11199
11201 {
11203 return;
11204
11206 float split_quantity_new;
11208 if (player)
11209 {
11211 if (quantity > stackable)
11212 split_quantity_new = stackable;
11213 else
11214 split_quantity_new = quantity;
11215
11216 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11217 new_item =
ItemBase.Cast(in_hands);
11218 if (new_item)
11219 {
11220 new_item.SetResultOfSplit(true);
11221 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11223 new_item.SetQuantity(split_quantity_new);
11224 }
11225 }
11226 }
11227
11229 {
11231 return;
11232
11234 float split_quantity_new = Math.Floor(quantity * 0.5);
11235
11237
11238 if (new_item)
11239 {
11240 if (new_item.GetQuantityMax() < split_quantity_new)
11241 {
11242 split_quantity_new = new_item.GetQuantityMax();
11243 }
11244
11245 new_item.SetResultOfSplit(true);
11246 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11247
11249 {
11252 }
11253 else
11254 {
11257 }
11258 }
11259 }
11260
11262 {
11264 return;
11265
11267 float split_quantity_new = Math.Floor(quantity / 2);
11268
11269 InventoryLocation invloc = new InventoryLocation;
11271
11273 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11274
11275 if (new_item)
11276 {
11277 if (new_item.GetQuantityMax() < split_quantity_new)
11278 {
11279 split_quantity_new = new_item.GetQuantityMax();
11280 }
11282 {
11285 }
11286 else
11287 {
11290 }
11291 }
11292 }
11293
11296 {
11297 SetWeightDirty();
11299
11300 if (parent)
11301 parent.OnAttachmentQuantityChangedEx(this, delta);
11302
11304 {
11306 {
11308 }
11310 {
11311 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11313 }
11314 }
11315
11316 }
11317
11320 {
11321
11322 }
11323
11326 {
11328 }
11329
11331 {
11332 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11333
11335 {
11336 if (newLevel == GameConstants.STATE_RUINED)
11337 {
11339 EntityAI parent = GetHierarchyParent();
11340 if (parent && parent.IsFireplace())
11341 {
11342 CargoBase cargo = GetInventory().GetCargo();
11343 if (cargo)
11344 {
11346 {
11348 }
11349 }
11350 }
11351 }
11352
11354 {
11355
11357 return;
11358 }
11359
11360 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11361 {
11363 }
11364 }
11365 }
11366
11367
11369 {
11370 super.OnRightClick();
11371
11373 {
11375 {
11376 if (ScriptInputUserData.CanStoreInputUserData())
11377 {
11378 vector m4[4];
11380
11381 EntityAI root = GetHierarchyRoot();
11382
11383 InventoryLocation dst = new InventoryLocation;
11385 {
11386 if (root)
11387 {
11388 root.GetTransform(m4);
11390 }
11391 else
11392 GetInventory().GetCurrentInventoryLocation(dst);
11393 }
11394 else
11395 {
11397
11398
11399 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11400 {
11401 if (root)
11402 {
11403 root.GetTransform(m4);
11405 }
11406 else
11407 GetInventory().GetCurrentInventoryLocation(dst);
11408 }
11409 else
11410 {
11411 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11412 }
11413 }
11414
11415 ScriptInputUserData ctx = new ScriptInputUserData;
11423 }
11424 }
11425 else if (!
GetGame().IsMultiplayer())
11426 {
11428 }
11429 }
11430 }
11431
11432 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11433 {
11434
11435 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11436 return false;
11437
11438 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11439 return false;
11440
11441
11443 return false;
11444
11445
11446 Magazine mag = Magazine.Cast(this);
11447 if (mag)
11448 {
11449 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11450 return false;
11451
11452 if (stack_max_limit)
11453 {
11454 Magazine other_mag = Magazine.Cast(other_item);
11455 if (other_item)
11456 {
11457 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11458 return false;
11459 }
11460
11461 }
11462 }
11463 else
11464 {
11465
11467 return false;
11468
11470 return false;
11471 }
11472
11473 PlayerBase player = null;
11474 if (CastTo(player, GetHierarchyRootPlayer()))
11475 {
11476 if (player.GetInventory().HasAttachment(this))
11477 return false;
11478
11479 if (player.IsItemsToDelete())
11480 return false;
11481 }
11482
11483 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11484 return false;
11485
11486 int slotID;
11488 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11489 return false;
11490
11491 return true;
11492 }
11493
11495 {
11497 }
11498
11500 {
11501 return m_IsResultOfSplit;
11502 }
11503
11505 {
11506 m_IsResultOfSplit = value;
11507 }
11508
11510 {
11512 }
11513
11515 {
11516 float other_item_quantity = other_item.GetQuantity();
11517 float this_free_space;
11518
11520
11522
11523 if (other_item_quantity > this_free_space)
11524 {
11525 return this_free_space;
11526 }
11527 else
11528 {
11529 return other_item_quantity;
11530 }
11531 }
11532
11534 {
11536 }
11537
11539 {
11541 return;
11542
11543 if (!IsMagazine() && other_item)
11544 {
11546 if (quantity_used != 0)
11547 {
11548 float hp1 = GetHealth01("","");
11549 float hp2 = other_item.GetHealth01("","");
11550 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11551 hpResult = hpResult / (
GetQuantity() + quantity_used);
11552
11553 hpResult *= GetMaxHealth();
11554 Math.Round(hpResult);
11555 SetHealth("", "Health", hpResult);
11556
11558 other_item.AddQuantity(-quantity_used);
11559 }
11560 }
11562 }
11563
11565 {
11566 #ifdef SERVER
11567 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11568 GetHierarchyParent().IncreaseLifetimeUp();
11569 #endif
11570 };
11571
11573 {
11574 PlayerBase p = PlayerBase.Cast(player);
11575
11576 array<int> recipesIds = p.m_Recipes;
11577 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11578 if (moduleRecipesManager)
11579 {
11580 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11581 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11582 }
11583
11584 for (int i = 0;i < recipesIds.Count(); i++)
11585 {
11586 int key = recipesIds.Get(i);
11587 string recipeName = moduleRecipesManager.GetRecipeName(key);
11589 }
11590 }
11591
11592
11593 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11594 {
11595 super.GetDebugActions(outputList);
11596
11597
11602
11603
11607
11611
11612
11615
11616
11618 {
11621 }
11622
11624
11627
11631 }
11632
11633
11634
11635
11637 {
11638 super.OnAction(action_id, player, ctx);
11639 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11640 {
11641 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11642 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11643 PlayerBase p = PlayerBase.Cast(player);
11644 if (
EActions.RECIPES_RANGE_START < 1000)
11645 {
11646 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11647 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11648 }
11649 }
11650 #ifndef SERVER
11651 else if (action_id ==
EActions.WATCH_PLAYER)
11652 {
11653 PluginDeveloper.SetDeveloperItemClientEx(player);
11654 }
11655 #endif
11657 {
11658 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11659 {
11660 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11661 OnDebugButtonPressServer(id + 1);
11662 }
11663
11664 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11665 {
11666 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11668 }
11669
11670 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11671 {
11672 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11674 }
11675
11676 else if (action_id ==
EActions.ADD_QUANTITY)
11677 {
11678 if (IsMagazine())
11679 {
11680 Magazine mag = Magazine.Cast(this);
11681 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11682 }
11683 else
11684 {
11686 }
11687
11688 if (m_EM)
11689 {
11690 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11691 }
11692
11693 }
11694
11695 else if (action_id ==
EActions.REMOVE_QUANTITY)
11696 {
11697 if (IsMagazine())
11698 {
11699 Magazine mag2 = Magazine.Cast(this);
11700 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11701 }
11702 else
11703 {
11705 }
11706 if (m_EM)
11707 {
11708 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11709 }
11710
11711 }
11712
11713 else if (action_id ==
EActions.SET_QUANTITY_0)
11714 {
11716
11717 if (m_EM)
11718 {
11719 m_EM.SetEnergy(0);
11720 }
11721 }
11722
11723 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11724 {
11726
11727 if (m_EM)
11728 {
11729 m_EM.SetEnergy(m_EM.GetEnergyMax());
11730 }
11731 }
11732
11733 else if (action_id ==
EActions.ADD_HEALTH)
11734 {
11735 AddHealth("","",GetMaxHealth("","Health")/5);
11736 }
11737 else if (action_id ==
EActions.REMOVE_HEALTH)
11738 {
11739 AddHealth("","",-GetMaxHealth("","Health")/5);
11740 }
11741 else if (action_id ==
EActions.DESTROY_HEALTH)
11742 {
11743 SetHealth01("","",0);
11744 }
11745 else if (action_id ==
EActions.WATCH_ITEM)
11746 {
11748 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11749 #ifdef DEVELOPER
11750 SetDebugDeveloper_item(this);
11751 #endif
11752 }
11753
11754 else if (action_id ==
EActions.ADD_TEMPERATURE)
11755 {
11756 AddTemperature(20);
11757
11758 }
11759
11760 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11761 {
11762 AddTemperature(-20);
11763
11764 }
11765
11766 else if (action_id ==
EActions.FLIP_FROZEN)
11767 {
11768 SetFrozen(!GetIsFrozen());
11769
11770 }
11771
11772 else if (action_id ==
EActions.ADD_WETNESS)
11773 {
11775
11776 }
11777
11778 else if (action_id ==
EActions.REMOVE_WETNESS)
11779 {
11781
11782 }
11783
11784 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11785 {
11788
11789
11790 }
11791
11792 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11793 {
11796 }
11797
11798 else if (action_id ==
EActions.MAKE_SPECIAL)
11799 {
11800 auto debugParams = DebugSpawnParams.WithPlayer(player);
11801 OnDebugSpawnEx(debugParams);
11802 }
11803
11804 else if (action_id ==
EActions.DELETE)
11805 {
11806 Delete();
11807 }
11808
11809 }
11810
11811
11812 return false;
11813 }
11814
11815
11816
11817
11821
11824
11825
11826
11828 {
11829 return false;
11830 }
11831
11832
11834 {
11835 return true;
11836 }
11837
11838
11840 {
11841 return true;
11842 }
11843
11844
11845
11847 {
11848 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11850 }
11851
11854 {
11855 return null;
11856 }
11857
11859 {
11860 return false;
11861 }
11862
11864 {
11865 return false;
11866 }
11867
11871
11872
11874 {
11875 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11876 return module_repairing.CanRepair(this, item_repair_kit);
11877 }
11878
11879
11880 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11881 {
11882 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11883 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11884 }
11885
11886
11888 {
11889
11890
11891
11892
11893
11894
11895
11896
11897 return 1;
11898 }
11899
11900
11901
11903 {
11905 }
11906
11907
11908
11910 {
11912 }
11913
11914
11923 {
11924 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11925
11926 if (player)
11927 {
11928 player.MessageStatus(text);
11929 }
11930 }
11931
11932
11941 {
11942 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11943
11944 if (player)
11945 {
11946 player.MessageAction(text);
11947 }
11948 }
11949
11950
11959 {
11960 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11961
11962 if (player)
11963 {
11964 player.MessageFriendly(text);
11965 }
11966 }
11967
11968
11977 {
11978 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11979
11980 if (player)
11981 {
11982 player.MessageImportant(text);
11983 }
11984 }
11985
11987 {
11988 return true;
11989 }
11990
11991
11992 override bool KindOf(
string tag)
11993 {
11994 bool found = false;
11995 string item_name = this.
GetType();
11998
11999 int array_size = item_tag_array.Count();
12000 for (int i = 0; i < array_size; i++)
12001 {
12002 if (item_tag_array.Get(i) == tag)
12003 {
12004 found = true;
12005 break;
12006 }
12007 }
12008 return found;
12009 }
12010
12011
12013 {
12014
12015 super.OnRPC(sender, rpc_type,ctx);
12016
12017
12018 switch (rpc_type)
12019 {
12020 #ifndef SERVER
12021 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12022 Param2<bool, string> p = new Param2<bool, string>(false, "");
12023
12025 return;
12026
12027 bool play = p.param1;
12028 string soundSet = p.param2;
12029
12030 if (play)
12031 {
12033 {
12035 {
12037 }
12038 }
12039 else
12040 {
12042 }
12043 }
12044 else
12045 {
12047 }
12048
12049 break;
12050 #endif
12051
12052 }
12053
12055 {
12057 }
12058 }
12059
12060
12061
12062
12064 {
12065 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12066 return plugin.GetID(
name);
12067 }
12068
12070 {
12071 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12072 return plugin.GetName(id);
12073 }
12074
12077 {
12078
12079
12080 int varFlags;
12081 if (!ctx.
Read(varFlags))
12082 return;
12083
12084 if (varFlags & ItemVariableFlags.FLOAT)
12085 {
12087 }
12088 }
12089
12091 {
12092
12093 super.SerializeNumericalVars(floats_out);
12094
12095
12096
12098 {
12100 }
12101
12103 {
12105 }
12106
12108 {
12110 }
12111
12113 {
12118 }
12119
12121 {
12123 }
12124 }
12125
12127 {
12128
12129 super.DeSerializeNumericalVars(floats);
12130
12131
12132 int index = 0;
12133 int mask = Math.Round(floats.Get(index));
12134
12135 index++;
12136
12138 {
12140 {
12142 }
12143 else
12144 {
12145 float quantity = floats.Get(index);
12146 SetQuantity(quantity,
true,
false,
false,
false);
12147 }
12148 index++;
12149 }
12150
12152 {
12153 float wet = floats.Get(index);
12155 index++;
12156 }
12157
12159 {
12160 int liquidtype = Math.Round(floats.Get(index));
12162 index++;
12163 }
12164
12166 {
12168 index++;
12170 index++;
12172 index++;
12174 index++;
12175 }
12176
12178 {
12179 int cleanness = Math.Round(floats.Get(index));
12181 index++;
12182 }
12183 }
12184
12186 {
12187 super.WriteVarsToCTX(ctx);
12188
12189
12191 {
12193 }
12194
12196 {
12198 }
12199
12201 {
12203 }
12204
12206 {
12207 int r,g,b,a;
12213 }
12214
12216 {
12218 }
12219 }
12220
12222 {
12223 if (!super.ReadVarsFromCTX(ctx,version))
12224 return false;
12225
12226 int intValue;
12227 float value;
12228
12229 if (version < 140)
12230 {
12231 if (!ctx.
Read(intValue))
12232 return false;
12233
12234 m_VariablesMask = intValue;
12235 }
12236
12238 {
12239 if (!ctx.
Read(value))
12240 return false;
12241
12243 {
12245 }
12246 else
12247 {
12249 }
12250 }
12251
12252 if (version < 140)
12253 {
12255 {
12256 if (!ctx.
Read(value))
12257 return false;
12258 SetTemperatureDirect(value);
12259 }
12260 }
12261
12263 {
12264 if (!ctx.
Read(value))
12265 return false;
12267 }
12268
12270 {
12271 if (!ctx.
Read(intValue))
12272 return false;
12274 }
12275
12277 {
12278 int r,g,b,a;
12280 return false;
12282 return false;
12284 return false;
12286 return false;
12287
12289 }
12290
12292 {
12293 if (!ctx.
Read(intValue))
12294 return false;
12296 }
12297
12298 if (version >= 138 && version < 140)
12299 {
12301 {
12302 if (!ctx.
Read(intValue))
12303 return false;
12304 SetFrozen(intValue);
12305 }
12306 }
12307
12308 return true;
12309 }
12310
12311
12313 {
12316 {
12318 }
12319
12320 if (!super.OnStoreLoad(ctx, version))
12321 {
12323 return false;
12324 }
12325
12326 if (version >= 114)
12327 {
12328 bool hasQuickBarIndexSaved;
12329
12330 if (!ctx.
Read(hasQuickBarIndexSaved))
12331 {
12333 return false;
12334 }
12335
12336 if (hasQuickBarIndexSaved)
12337 {
12338 int itmQBIndex;
12339
12340
12341 if (!ctx.
Read(itmQBIndex))
12342 {
12344 return false;
12345 }
12346
12347 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12348 if (itmQBIndex != -1 && parentPlayer)
12349 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12350 }
12351 }
12352 else
12353 {
12354
12355 PlayerBase player;
12356 int itemQBIndex;
12357 if (version ==
int.
MAX)
12358 {
12359 if (!ctx.
Read(itemQBIndex))
12360 {
12362 return false;
12363 }
12364 }
12365 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12366 {
12367
12368 if (!ctx.
Read(itemQBIndex))
12369 {
12371 return false;
12372 }
12373 if (itemQBIndex != -1 && player)
12374 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12375 }
12376 }
12377
12378 if (version < 140)
12379 {
12380
12381 if (!LoadVariables(ctx, version))
12382 {
12384 return false;
12385 }
12386 }
12387
12388
12390 {
12392 return false;
12393 }
12394 if (version >= 132)
12395 {
12397 if (raib)
12398 {
12400 {
12402 return false;
12403 }
12404 }
12405 }
12406
12408 return true;
12409 }
12410
12411
12412
12414 {
12415 super.OnStoreSave(ctx);
12416
12417 PlayerBase player;
12418 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12419 {
12421
12422 int itemQBIndex = -1;
12423 itemQBIndex = player.FindQuickBarEntityIndex(this);
12424 ctx.
Write(itemQBIndex);
12425 }
12426 else
12427 {
12429 }
12430
12432
12434 if (raib)
12435 {
12437 }
12438 }
12439
12440
12442 {
12443 super.AfterStoreLoad();
12444
12446 {
12448 }
12449
12451 {
12454 }
12455 }
12456
12458 {
12459 super.EEOnAfterLoad();
12460
12462 {
12464 }
12465
12468 }
12469
12471 {
12472 return false;
12473 }
12474
12475
12476
12478 {
12480 {
12481 #ifdef PLATFORM_CONSOLE
12482
12484 {
12486 if (menu)
12487 {
12489 }
12490 }
12491 #endif
12492 }
12493
12495 {
12498 }
12499
12501 {
12502 SetWeightDirty();
12504 }
12506 {
12509 }
12510
12512 {
12515 }
12517 {
12520 }
12521
12522 super.OnVariablesSynchronized();
12523 }
12524
12525
12526
12528 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12529 {
12530 if (!IsServerCheck(allow_client))
12531 return false;
12532
12534 return false;
12535
12538
12539 if (value <= (min + 0.001))
12540 value = min;
12541
12542 if (value == min)
12543 {
12544 if (destroy_config)
12545 {
12546 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12547 if (dstr)
12548 {
12550 this.Delete();
12551 return true;
12552 }
12553 }
12554 else if (destroy_forced)
12555 {
12557 this.Delete();
12558 return true;
12559 }
12560
12562 }
12563
12566
12568 {
12570
12571 if (delta)
12573 }
12574
12576
12577 return false;
12578 }
12579
12580
12582 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12583 {
12585 }
12586
12588 {
12591 }
12592
12594 {
12597 }
12598
12601 {
12602 float value_clamped = Math.Clamp(value, 0, 1);
12604 SetQuantity(result, destroy_config, destroy_forced);
12605 }
12606
12607
12610 {
12612 }
12613
12615 {
12617 }
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12629 {
12630 int slot = -1;
12631 if (GetInventory())
12632 {
12633 InventoryLocation il = new InventoryLocation;
12634 GetInventory().GetCurrentInventoryLocation(il);
12636 }
12637
12639 }
12640
12642 {
12643 float quantity_max = 0;
12644
12646 {
12647 if (attSlotID != -1)
12648 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12649
12650 if (quantity_max <= 0)
12652 }
12653
12654 if (quantity_max <= 0)
12656
12657 return quantity_max;
12658 }
12659
12661 {
12663 }
12664
12666 {
12668 }
12669
12670
12672 {
12674 }
12675
12677 {
12679 }
12680
12682 {
12684 }
12685
12686
12688 {
12689
12690 float weightEx = GetWeightEx();
12691 float special = GetInventoryAndCargoWeight();
12692 return weightEx - special;
12693 }
12694
12695
12697 {
12699 }
12700
12702 {
12704 {
12705 #ifdef DEVELOPER
12706 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12707 {
12708 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12710 }
12711 #endif
12712
12713 return GetQuantity() * GetConfigWeightModified();
12714 }
12715 else if (HasEnergyManager())
12716 {
12717 #ifdef DEVELOPER
12718 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12719 {
12720 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12721 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12722 }
12723 #endif
12724 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12725 }
12726 else
12727 {
12728 #ifdef DEVELOPER
12729 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12730 {
12731 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12732 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12733 }
12734 #endif
12735 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12736 }
12737 }
12738
12741 {
12742 int item_count = 0;
12744
12745 if (GetInventory().GetCargo() != NULL)
12746 {
12747 item_count = GetInventory().GetCargo().GetItemCount();
12748 }
12749
12750 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12751 {
12752 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12753 if (item)
12754 item_count += item.GetNumberOfItems();
12755 }
12756 return item_count;
12757 }
12758
12761 {
12762 float weight = 0;
12763 float wetness = 1;
12764 if (include_wetness)
12767 {
12768 weight = wetness * m_ConfigWeight;
12769 }
12771 {
12772 weight = 1;
12773 }
12774 return weight;
12775 }
12776
12777
12778
12780 {
12781 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12782 {
12783 GameInventory inv = GetInventory();
12784 array<EntityAI> items = new array<EntityAI>;
12786 for (int i = 0; i < items.Count(); i++)
12787 {
12789 if (item)
12790 {
12792 }
12793 }
12794 }
12795 }
12796
12797
12798
12799
12801 {
12802 float energy = 0;
12803 if (HasEnergyManager())
12804 {
12805 energy = GetCompEM().GetEnergy();
12806 }
12807 return energy;
12808 }
12809
12810
12812 {
12813 super.OnEnergyConsumed();
12814
12816 }
12817
12819 {
12820 super.OnEnergyAdded();
12821
12823 }
12824
12825
12827 {
12828 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12829 {
12831 {
12832 float energy_0to1 = GetCompEM().GetEnergy0To1();
12834 }
12835 }
12836 }
12837
12838
12840 {
12841 return ConfigGetFloat("heatIsolation");
12842 }
12843
12845 {
12847 }
12848
12850 {
12851 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12852 if (
GetGame().ConfigIsExisting(paramPath))
12854
12855 return 0.0;
12856 }
12857
12859 {
12860 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12861 if (
GetGame().ConfigIsExisting(paramPath))
12863
12864 return 0.0;
12865 }
12866
12867 override void SetWet(
float value,
bool allow_client =
false)
12868 {
12869 if (!IsServerCheck(allow_client))
12870 return;
12871
12874
12876
12877 m_VarWet = Math.Clamp(value, min, max);
12878
12880 {
12883 }
12884 }
12885
12886 override void AddWet(
float value)
12887 {
12889 }
12890
12892 {
12894 }
12895
12897 {
12899 }
12900
12902 {
12904 }
12905
12907 {
12909 }
12910
12912 {
12914 }
12915
12916 override void OnWetChanged(
float newVal,
float oldVal)
12917 {
12920 if (newLevel != oldLevel)
12921 {
12923 }
12924 }
12925
12927 {
12928 SetWeightDirty();
12929 }
12930
12932 {
12933 return GetWetLevelInternal(
m_VarWet);
12934 }
12935
12936
12937
12939 {
12941 }
12942
12944 {
12946 }
12947
12949 {
12951 }
12952
12954 {
12956 }
12957
12958
12959
12961 {
12962 if (ConfigIsExisting("itemModelLength"))
12963 {
12964 return ConfigGetFloat("itemModelLength");
12965 }
12966 return 0;
12967 }
12968
12970 {
12971 if (ConfigIsExisting("itemAttachOffset"))
12972 {
12973 return ConfigGetFloat("itemAttachOffset");
12974 }
12975 return 0;
12976 }
12977
12978 override void SetCleanness(
int value,
bool allow_client =
false)
12979 {
12980 if (!IsServerCheck(allow_client))
12981 return;
12982
12984
12986
12989 }
12990
12992 {
12994 }
12995
12997 {
12998 return true;
12999 }
13000
13001
13002
13003
13005 {
13007 }
13008
13010 {
13012 }
13013
13014
13015
13016
13017 override void SetColor(
int r,
int g,
int b,
int a)
13018 {
13024 }
13026 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13027 {
13032 }
13033
13035 {
13037 }
13038
13041 {
13042 int r,g,b,a;
13044 r = r/255;
13045 g = g/255;
13046 b = b/255;
13047 a = a/255;
13048 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13049 }
13050
13051
13052
13053 override void SetLiquidType(
int value,
bool allow_client =
false)
13054 {
13055 if (!IsServerCheck(allow_client))
13056 return;
13057
13062 }
13063
13065 {
13066 return ConfigGetInt("varLiquidTypeInit");
13067 }
13068
13070 {
13072 }
13073
13075 {
13077 SetFrozen(false);
13078 }
13079
13082 {
13083 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13084 }
13085
13086
13089 {
13090 PlayerBase nplayer;
13091 if (PlayerBase.CastTo(nplayer, player))
13092 {
13094
13095 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13096 }
13097 }
13098
13099
13102 {
13103 PlayerBase nplayer;
13104 if (PlayerBase.CastTo(nplayer,player))
13105 {
13106
13107 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13108
13109 }
13110
13111
13112 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13113
13114
13115 if (HasEnergyManager())
13116 {
13117 GetCompEM().UpdatePlugState();
13118 }
13119 }
13120
13121
13123 {
13124 super.OnPlacementStarted(player);
13125
13127 }
13128
13129 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13130 {
13132 {
13133 m_AdminLog.OnPlacementComplete(player,
this);
13134 }
13135
13136 super.OnPlacementComplete(player, position, orientation);
13137 }
13138
13139
13140
13141
13142
13144 {
13146 {
13147 return true;
13148 }
13149 else
13150 {
13151 return false;
13152 }
13153 }
13154
13155
13157 {
13159 {
13161 }
13162 }
13163
13164
13166 {
13168 }
13169
13171 {
13173 }
13174
13175 override void InsertAgent(
int agent,
float count = 1)
13176 {
13177 if (count < 1)
13178 return;
13179
13181 }
13182
13185 {
13187 }
13188
13189
13191 {
13193 }
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13237 {
13239 return false;
13240 return true;
13241 }
13242
13244 {
13245
13247 }
13248
13249
13252 {
13253 super.CheckForRoofLimited(timeTresholdMS);
13254
13256 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13257 {
13258 m_PreviousRoofTestTime = time;
13259 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13260 }
13261 }
13262
13263
13265 {
13267 {
13268 return 0;
13269 }
13270
13271 if (GetInventory().GetAttachmentSlotsCount() != 0)
13272 {
13273 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13274 if (filter)
13275 return filter.GetProtectionLevel(type, false, system);
13276 else
13277 return 0;
13278 }
13279
13280 string subclassPath, entryName;
13281
13282 switch (type)
13283 {
13285 entryName = "biological";
13286 break;
13288 entryName = "chemical";
13289 break;
13290 default:
13291 entryName = "biological";
13292 break;
13293 }
13294
13295 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13296
13298 }
13299
13300
13301
13304 {
13305 if (!IsMagazine())
13307
13309 }
13310
13311
13312
13313
13314
13319 {
13320 return true;
13321 }
13322
13324 {
13326 }
13327
13328
13329
13330
13331
13333 {
13334 if (parent)
13335 {
13336 if (parent.IsInherited(DayZInfected))
13337 return true;
13338
13339 if (!parent.IsRuined())
13340 return true;
13341 }
13342
13343 return true;
13344 }
13345
13347 {
13348 if (!super.CanPutAsAttachment(parent))
13349 {
13350 return false;
13351 }
13352
13353 if (!IsRuined() && !parent.IsRuined())
13354 {
13355 return true;
13356 }
13357
13358 return false;
13359 }
13360
13362 {
13363
13364
13365
13366
13367 return super.CanReceiveItemIntoCargo(item);
13368 }
13369
13371 {
13372
13373
13374
13375
13376 GameInventory attachmentInv = attachment.GetInventory();
13378 {
13379 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13380 return false;
13381 }
13382
13383 InventoryLocation loc = new InventoryLocation();
13384 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13385 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13386 return false;
13387
13388 return super.CanReceiveAttachment(attachment, slotId);
13389 }
13390
13392 {
13393 if (!super.CanReleaseAttachment(attachment))
13394 return false;
13395
13396 return GetInventory().AreChildrenAccessible();
13397 }
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13420 {
13421 int id = muzzle_owner.GetMuzzleID();
13422 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13423
13424 if (WPOF_array)
13425 {
13426 for (int i = 0; i < WPOF_array.Count(); i++)
13427 {
13428 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13429
13430 if (WPOF)
13431 {
13432 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13433 }
13434 }
13435 }
13436 }
13437
13438
13440 {
13441 int id = muzzle_owner.GetMuzzleID();
13443
13444 if (WPOBE_array)
13445 {
13446 for (int i = 0; i < WPOBE_array.Count(); i++)
13447 {
13448 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13449
13450 if (WPOBE)
13451 {
13452 WPOBE.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.OnActivate(weapon, 0, 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.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13493 }
13494 }
13495 }
13496 }
13497
13498
13500 {
13501 int id = muzzle_owner.GetMuzzleID();
13502 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13503
13504 if (WPOOH_array)
13505 {
13506 for (int i = 0; i < WPOOH_array.Count(); i++)
13507 {
13508 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13509
13510 if (WPOOH)
13511 {
13512 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13513 }
13514 }
13515 }
13516 }
13517
13518
13519
13521 {
13523 {
13524 return true;
13525 }
13526
13527 return false;
13528 }
13529
13531 {
13533 {
13534 return true;
13535 }
13536
13537 return false;
13538 }
13539
13541 {
13543 {
13544 return true;
13545 }
13546
13547 return false;
13548 }
13549
13551 {
13552 return false;
13553 }
13554
13557 {
13558 return UATimeSpent.DEFAULT_DEPLOY;
13559 }
13560
13561
13562
13563
13565 {
13567 SetSynchDirty();
13568 }
13569
13571 {
13573 }
13574
13575
13577 {
13578 return false;
13579 }
13580
13583 {
13584 string att_type = "None";
13585
13586 if (ConfigIsExisting("soundAttType"))
13587 {
13588 att_type = ConfigGetString("soundAttType");
13589 }
13590
13592 }
13593
13595 {
13597 }
13598
13599
13600
13601
13602
13606
13608 {
13611
13613 }
13614
13615
13617 {
13619 return;
13620
13622
13625
13628
13629 SoundParameters params = new SoundParameters();
13633 }
13634
13635
13637 {
13639 return;
13640
13642 SetSynchDirty();
13643
13646 }
13647
13648
13650 {
13652 return;
13653
13655 SetSynchDirty();
13656
13659 }
13660
13662 {
13664 }
13665
13667 {
13669 }
13670
13673 {
13674 if (!
GetGame().IsDedicatedServer())
13675 {
13676 if (ConfigIsExisting("attachSoundSet"))
13677 {
13678 string cfg_path = "";
13679 string soundset = "";
13680 string type_name =
GetType();
13681
13684 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13685 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13686
13687 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13688 {
13689 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13690 {
13691 if (cfg_slot_array[i] == slot_type)
13692 {
13693 soundset = cfg_soundset_array[i];
13694 break;
13695 }
13696 }
13697 }
13698
13699 if (soundset != "")
13700 {
13701 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13703 }
13704 }
13705 }
13706 }
13707
13709 {
13710
13711 }
13712
13713 void OnApply(PlayerBase player);
13714
13716 {
13717 return 1.0;
13718 };
13719
13721 {
13723 }
13724
13726 {
13728 }
13729
13731
13733 {
13734 SetDynamicPhysicsLifeTime(0.01);
13736 }
13737
13739 {
13740 array<string> zone_names = new array<string>;
13741 GetDamageZones(zone_names);
13742 for (int i = 0; i < zone_names.Count(); i++)
13743 {
13744 SetHealthMax(zone_names.Get(i),"Health");
13745 }
13746 SetHealthMax("","Health");
13747 }
13748
13751 {
13752 float global_health = GetHealth01("","Health");
13753 array<string> zones = new array<string>;
13754 GetDamageZones(zones);
13755
13756 for (int i = 0; i < zones.Count(); i++)
13757 {
13758 SetHealth01(zones.Get(i),"Health",global_health);
13759 }
13760 }
13761
13764 {
13765 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13766 }
13767
13769 {
13770 if (!hasRootAsPlayer)
13771 {
13772 if (refParentIB)
13773 {
13774
13775 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13776 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13777
13778 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13779 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13780
13783 }
13784 else
13785 {
13786
13789 }
13790 }
13791 }
13792
13794 {
13796 {
13797 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13798 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13799 {
13800 float heatPermCoef = 1.0;
13802 while (ent)
13803 {
13804 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13805 ent = ent.GetHierarchyParent();
13806 }
13807
13808 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13809 }
13810 }
13811 }
13812
13814 {
13815
13816 EntityAI parent = GetHierarchyParent();
13817 if (!parent)
13818 {
13819 hasParent = false;
13820 hasRootAsPlayer = false;
13821 }
13822 else
13823 {
13824 hasParent = true;
13825 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13826 refParentIB =
ItemBase.Cast(parent);
13827 }
13828 }
13829
13830 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13831 {
13832
13833 }
13834
13836 {
13837
13838 return false;
13839 }
13840
13842 {
13843
13844
13845 return false;
13846 }
13847
13849 {
13850
13851 return false;
13852 }
13853
13856 {
13857 return !GetIsFrozen() &&
IsOpen();
13858 }
13859
13861 {
13862 bool hasParent = false, hasRootAsPlayer = false;
13864
13865 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13866 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13867
13868 if (wwtu || foodDecay)
13869 {
13873
13874 if (processWetness || processTemperature || processDecay)
13875 {
13877
13878 if (processWetness)
13879 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13880
13881 if (processTemperature)
13883
13884 if (processDecay)
13885 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13886 }
13887 }
13888 }
13889
13892 {
13894 }
13895
13897 {
13900
13901 return super.GetTemperatureFreezeThreshold();
13902 }
13903
13905 {
13908
13909 return super.GetTemperatureThawThreshold();
13910 }
13911
13913 {
13916
13917 return super.GetItemOverheatThreshold();
13918 }
13919
13921 {
13923 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13924
13925 return super.GetTemperatureFreezeTime();
13926 }
13927
13929 {
13931 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13932
13933 return super.GetTemperatureThawTime();
13934 }
13935
13940
13942 {
13943 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13944 }
13945
13947 {
13948 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13949 }
13950
13953 {
13955 }
13956
13958 {
13960 }
13961
13963 {
13965 }
13966
13969 {
13970 return null;
13971 }
13972
13975 {
13976 return false;
13977 }
13978
13980 {
13982 {
13985 if (!trg)
13986 {
13988 explosive = this;
13989 }
13990
13991 explosive.PairRemote(trg);
13993
13994 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13995 trg.SetPersistentPairID(persistentID);
13996 explosive.SetPersistentPairID(persistentID);
13997
13998 return true;
13999 }
14000 return false;
14001 }
14002
14005 {
14006 float ret = 1.0;
14009 ret *= GetHealth01();
14010
14011 return ret;
14012 }
14013
14014 #ifdef DEVELOPER
14015 override void SetDebugItem()
14016 {
14017 super.SetDebugItem();
14018 _itemBase = this;
14019 }
14020
14022 {
14023 string text = super.GetDebugText();
14024
14026 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14027
14028 return text;
14029 }
14030 #endif
14031
14033 {
14034 return true;
14035 }
14036
14038
14040
14042 {
14045 }
14046
14047
14055
14071}
14072
14074{
14076 if (entity)
14077 {
14078 bool is_item = entity.IsInherited(
ItemBase);
14079 if (is_item && full_quantity)
14080 {
14083 }
14084 }
14085 else
14086 {
14088 return NULL;
14089 }
14090 return entity;
14091}
14092
14094{
14095 if (item)
14096 {
14097 if (health > 0)
14098 item.SetHealth("", "", health);
14099
14100 if (item.CanHaveTemperature())
14101 {
14103 if (item.CanFreeze())
14104 item.SetFrozen(false);
14105 }
14106
14107 if (item.HasEnergyManager())
14108 {
14109 if (quantity >= 0)
14110 {
14111 item.GetCompEM().SetEnergy0To1(quantity);
14112 }
14113 else
14114 {
14116 }
14117 }
14118 else if (item.IsMagazine())
14119 {
14120 Magazine mag = Magazine.Cast(item);
14121 if (quantity >= 0)
14122 {
14123 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14124 }
14125 else
14126 {
14128 }
14129
14130 }
14131 else
14132 {
14133 if (quantity >= 0)
14134 {
14135 item.SetQuantityNormalized(quantity, false);
14136 }
14137 else
14138 {
14140 }
14141
14142 }
14143 }
14144}
14145
14146#ifdef DEVELOPER
14148#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.