9410{
9412 {
9413 return true;
9414 }
9415};
9416
9417
9418
9420{
9424
9426
9429
9430
9431
9432
9433
9442
9448
9453
9458
9479 protected bool m_IsResultOfSplit
9480
9482
9487
9488
9489
9491
9495
9496
9497
9499
9502
9503
9504
9510
9511
9519
9522
9523
9525
9526
9528
9529
9534
9535
9540
9541
9543
9544
9546 {
9551
9552 if (!
GetGame().IsDedicatedServer())
9553 {
9555 {
9557
9559 {
9561 }
9562 }
9563
9566 }
9567
9568 m_OldLocation = null;
9569
9571 {
9573 }
9574
9575 if (ConfigIsExisting("headSelectionsToHide"))
9576 {
9579 }
9580
9582 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9583 {
9585 }
9586
9588
9589 m_IsResultOfSplit = false;
9590
9592 }
9593
9595 {
9596 super.InitItemVariables();
9597
9603 m_Count = ConfigGetInt(
"count");
9604
9607
9612
9615
9620
9632
9636
9637
9640 if (ConfigIsExisting("canBeSplit"))
9641 {
9644 }
9645
9647 if (ConfigIsExisting("itemBehaviour"))
9649
9650
9653 RegisterNetSyncVariableInt("m_VarLiquidType");
9654 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9655
9656 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9657 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9658 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9659
9660 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9661 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9662 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9663 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9664
9665 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9666 RegisterNetSyncVariableBool("m_IsTakeable");
9667 RegisterNetSyncVariableBool("m_IsHologram");
9668
9671 {
9674 }
9675
9677
9679 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9681
9682 }
9683
9685 {
9687 }
9688
9690 {
9693 {
9698 }
9699 }
9700
9701 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9702 {
9704 {
9707 }
9708
9710 }
9711
9713 {
9719 }
9720
9722
9724 {
9726
9727 if (!action)
9728 {
9729 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9730 return;
9731 }
9732
9734 if (!ai)
9735 {
9737 return;
9738 }
9739
9741 if (!action_array)
9742 {
9743 action_array = new array<ActionBase_Basic>;
9745 }
9746 if (LogManager.IsActionLogEnable())
9747 {
9748 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9749 }
9750
9751 if (action_array.Find(action) != -1)
9752 {
9753 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9754 }
9755 else
9756 {
9757 action_array.Insert(action);
9758 }
9759 }
9760
9762 {
9764 ActionBase action = player.GetActionManager().GetAction(actionName);
9767
9768 if (action_array)
9769 {
9770 action_array.RemoveItem(action);
9771 }
9772 }
9773
9774
9775
9777 {
9778 ActionOverrideData overrideData = new ActionOverrideData();
9782
9784 if (!actionMap)
9785 {
9788 }
9789
9790 actionMap.Insert(this.
Type(), overrideData);
9791
9792 }
9793
9795
9797
9798
9800 {
9803
9806
9807 string config_to_search = "CfgVehicles";
9808 string muzzle_owner_config;
9809
9811 {
9812 if (IsInherited(Weapon))
9813 config_to_search = "CfgWeapons";
9814
9815 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9816
9817 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9818
9820
9821 if (config_OnFire_subclass_count > 0)
9822 {
9823 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9824
9825 for (int i = 0; i < config_OnFire_subclass_count; i++)
9826 {
9827 string particle_class = "";
9829 string config_OnFire_entry = config_OnFire_class + particle_class;
9830 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9831 WPOF_array.Insert(WPOF);
9832 }
9833
9834
9836 }
9837 }
9838
9840 {
9841 config_to_search = "CfgWeapons";
9842 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9843
9844 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9845
9847
9848 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9849 {
9850 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9851
9852 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9853 {
9854 string particle_class2 = "";
9856 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9857 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9858 WPOBE_array.Insert(WPOBE);
9859 }
9860
9861
9863 }
9864 }
9865 }
9866
9867
9869 {
9872
9874 {
9875 string config_to_search = "CfgVehicles";
9876
9877 if (IsInherited(Weapon))
9878 config_to_search = "CfgWeapons";
9879
9880 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9881 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9882
9883 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9884 {
9885
9887
9889 {
9891 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9893 return;
9894 }
9895
9898
9899
9900
9902 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9903
9904 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9905 {
9906 string particle_class = "";
9908 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9910
9911 if (entry_type == CT_CLASS)
9912 {
9913 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9914 WPOOH_array.Insert(WPOF);
9915 }
9916 }
9917
9918
9920 }
9921 }
9922 }
9923
9925 {
9927 }
9928
9930 {
9932 {
9934
9937
9940
9941 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9942 }
9943 }
9944
9946 {
9948 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9949
9951 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9952
9954 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9955
9957 {
9959 }
9960 }
9961
9963 {
9965 }
9966
9968 {
9971 else
9973
9975 {
9978 }
9979 else
9980 {
9983
9986 }
9987
9989 }
9990
9992 {
9994 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9995 }
9996
9998 {
10000 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10002 }
10003
10005 {
10007 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10008 }
10009
10011 {
10014
10015 OverheatingParticle OP = new OverheatingParticle();
10020
10022 }
10023
10025 {
10028
10029 return -1;
10030 }
10031
10033 {
10035 {
10038
10039 for (int i = count; i > 0; --i)
10040 {
10041 int id = i - 1;
10044
10047
10048 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10049 {
10050 if (p)
10051 {
10054 }
10055 }
10056 }
10057 }
10058 }
10059
10061 {
10063 {
10065 {
10066 int id = i - 1;
10068
10069 if (OP)
10070 {
10072
10073 if (p)
10074 {
10076 }
10077
10078 delete OP;
10079 }
10080 }
10081
10084 }
10085 }
10086
10089 {
10090 return 0.0;
10091 }
10092
10093
10095 {
10096 return 250;
10097 }
10098
10100 {
10101 return 0;
10102 }
10103
10106 {
10108 return true;
10109
10110 return false;
10111 }
10112
10115 {
10118
10120 {
10122 }
10123 else
10124 {
10125
10127 }
10128
10130 }
10131
10138 {
10139 return -1;
10140 }
10141
10142
10143
10144
10146 {
10148 {
10150 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10151
10152 if (r_index >= 0)
10153 {
10154 InventoryLocation r_il = new InventoryLocation;
10155 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10156
10157 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10160 {
10161 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10162 }
10164 {
10165 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10166 }
10167
10168 }
10169
10170 player.GetHumanInventory().ClearUserReservedLocation(this);
10171 }
10172
10175 }
10176
10177
10178
10179
10181 {
10182 return ItemBase.m_DebugActionsMask;
10183 }
10184
10186 {
10187 return ItemBase.m_DebugActionsMask & mask;
10188 }
10189
10191 {
10192 ItemBase.m_DebugActionsMask = mask;
10193 }
10194
10196 {
10197 ItemBase.m_DebugActionsMask |= mask;
10198 }
10199
10201 {
10202 ItemBase.m_DebugActionsMask &= ~mask;
10203 }
10204
10206 {
10208 {
10210 }
10211 else
10212 {
10214 }
10215 }
10216
10217
10219 {
10220 if (GetEconomyProfile())
10221 {
10222 float q_max = GetEconomyProfile().GetQuantityMax();
10223 if (q_max > 0)
10224 {
10225 float q_min = GetEconomyProfile().GetQuantityMin();
10226 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10227
10229 {
10230 ComponentEnergyManager comp = GetCompEM();
10232 {
10234 }
10235 }
10237 {
10239
10240 }
10241
10242 }
10243 }
10244 }
10245
10248 {
10249 EntityAI parent = GetHierarchyParent();
10250
10251 if (parent)
10252 {
10253 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10254 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10255 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10256 }
10257 }
10258
10261 {
10262 EntityAI parent = GetHierarchyParent();
10263
10264 if (parent)
10265 {
10266 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10267 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10268 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10269 }
10270 }
10271
10273 {
10274
10275
10276
10277
10279
10281 {
10282 if (ScriptInputUserData.CanStoreInputUserData())
10283 {
10284 ScriptInputUserData ctx = new ScriptInputUserData;
10290 ctx.
Write(use_stack_max);
10293
10295 {
10296 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10297 }
10298 }
10299 }
10300 else if (!
GetGame().IsMultiplayer())
10301 {
10303 }
10304 }
10305
10307 {
10309 }
10310
10312 {
10314 }
10315
10317 {
10319 }
10320
10322 {
10323
10324 return false;
10325 }
10326
10328 {
10329 return false;
10330 }
10331
10335 {
10336 return false;
10337 }
10338
10340 {
10341 return "";
10342 }
10343
10345
10347 {
10348 return false;
10349 }
10350
10352 {
10353 return true;
10354 }
10355
10356
10357
10359 {
10360 return true;
10361 }
10362
10364 {
10365 return true;
10366 }
10367
10369 {
10370 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10372 }
10373
10375 {
10377 }
10378
10380 {
10382 if (!is_being_placed)
10384 SetSynchDirty();
10385 }
10386
10387
10389
10391 {
10393 }
10394
10396 {
10398 }
10399
10401 {
10402 return 1;
10403 }
10404
10406 {
10407 return false;
10408 }
10409
10411 {
10413 SetSynchDirty();
10414 }
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10451 {
10452 super.OnMovedInsideCargo(container);
10453
10454 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10455 }
10456
10457 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10458 {
10459 super.EEItemLocationChanged(oldLoc,newLoc);
10460
10461 PlayerBase new_player = null;
10462 PlayerBase old_player = null;
10463
10464 if (newLoc.GetParent())
10465 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10466
10467 if (oldLoc.GetParent())
10468 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10469
10471 {
10472 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10473
10474 if (r_index >= 0)
10475 {
10476 InventoryLocation r_il = new InventoryLocation;
10477 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10478
10479 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10482 {
10483 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10484 }
10486 {
10487 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10488 }
10489
10490 }
10491 }
10492
10494 {
10495 if (new_player)
10496 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10497
10498 if (new_player == old_player)
10499 {
10500
10501 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10502 {
10504 {
10505 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10506 {
10507 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10508 }
10509 }
10510 else
10511 {
10512 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10513 }
10514 }
10515
10516 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10517 {
10518 int type = oldLoc.GetType();
10520 {
10521 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10522 }
10524 {
10525 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10526 }
10527 }
10528 if (!m_OldLocation)
10529 {
10530 m_OldLocation = new InventoryLocation;
10531 }
10532 m_OldLocation.Copy(oldLoc);
10533 }
10534 else
10535 {
10536 if (m_OldLocation)
10537 {
10538 m_OldLocation.Reset();
10539 }
10540 }
10541
10543 }
10544 else
10545 {
10546 if (new_player)
10547 {
10548 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10549 if (res_index >= 0)
10550 {
10551 InventoryLocation il = new InventoryLocation;
10552 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10554 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10557 {
10558 il.
GetParent().GetOnReleaseLock().Invoke(it);
10559 }
10561 {
10563 }
10564
10565 }
10566 }
10568 {
10569
10571 }
10572
10573 if (m_OldLocation)
10574 {
10575 m_OldLocation.Reset();
10576 }
10577 }
10578 }
10579
10580 override void EOnContact(IEntity other, Contact extra)
10581 {
10583 {
10584 int liquidType = -1;
10586 if (impactSpeed > 0.0)
10587 {
10589 #ifndef SERVER
10591 #else
10593 SetSynchDirty();
10594 #endif
10596 }
10597 }
10598
10599 #ifdef SERVER
10600 if (GetCompEM() && GetCompEM().IsPlugged())
10601 {
10602 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10603 GetCompEM().UnplugThis();
10604 }
10605 #endif
10606 }
10607
10609
10611 {
10613 }
10614
10616 {
10617
10618 }
10619
10621 {
10622 super.OnItemLocationChanged(old_owner, new_owner);
10623
10624 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10625 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10626
10627 if (!relatedPlayer && playerNew)
10628 relatedPlayer = playerNew;
10629
10630 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10631 {
10633 if (actionMgr)
10634 {
10635 ActionBase currentAction = actionMgr.GetRunningAction();
10636 if (currentAction)
10638 }
10639 }
10640
10641 Man ownerPlayerOld = null;
10642 Man ownerPlayerNew = null;
10643
10644 if (old_owner)
10645 {
10646 if (old_owner.
IsMan())
10647 {
10648 ownerPlayerOld = Man.Cast(old_owner);
10649 }
10650 else
10651 {
10652 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10653 }
10654 }
10655 else
10656 {
10658 {
10660
10661 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10662 {
10663 GetCompEM().UnplugThis();
10664 }
10665 }
10666 }
10667
10668 if (new_owner)
10669 {
10670 if (new_owner.
IsMan())
10671 {
10672 ownerPlayerNew = Man.Cast(new_owner);
10673 }
10674 else
10675 {
10676 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10677 }
10678 }
10679
10680 if (ownerPlayerOld != ownerPlayerNew)
10681 {
10682 if (ownerPlayerOld)
10683 {
10684 array<EntityAI> subItemsExit = new array<EntityAI>;
10686 for (int i = 0; i < subItemsExit.Count(); i++)
10687 {
10690 }
10691 }
10692
10693 if (ownerPlayerNew)
10694 {
10695 array<EntityAI> subItemsEnter = new array<EntityAI>;
10697 for (int j = 0; j < subItemsEnter.Count(); j++)
10698 {
10701 }
10702 }
10703 }
10704 else if (ownerPlayerNew != null)
10705 {
10706 PlayerBase nplayer;
10707 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10708 {
10709 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10711 for (int k = 0; k < subItemsUpdate.Count(); k++)
10712 {
10714 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10715 }
10716 }
10717 }
10718
10719 if (old_owner)
10720 old_owner.OnChildItemRemoved(this);
10721 if (new_owner)
10722 new_owner.OnChildItemReceived(this);
10723 }
10724
10725
10727 {
10728 super.EEDelete(parent);
10729 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10730 if (player)
10731 {
10733
10734 if (player.IsAlive())
10735 {
10736 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10737 if (r_index >= 0)
10738 {
10739 InventoryLocation r_il = new InventoryLocation;
10740 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10741
10742 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10745 {
10746 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10747 }
10749 {
10750 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10751 }
10752
10753 }
10754
10755 player.RemoveQuickBarEntityShortcut(this);
10756 }
10757 }
10758 }
10759
10761 {
10762 super.EEKilled(killer);
10763
10766 {
10767 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10768 {
10769 if (IsMagazine())
10770 {
10771 if (Magazine.Cast(this).GetAmmoCount() > 0)
10772 {
10774 }
10775 }
10776 else
10777 {
10779 }
10780 }
10781 }
10782 }
10783
10785 {
10786 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10787
10788 super.OnWasAttached(parent, slot_id);
10789
10792
10794 }
10795
10797 {
10798 super.OnWasDetached(parent, slot_id);
10799
10802 }
10803
10805 {
10806 int idx;
10809
10810 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10811 if (inventory_slots.Count() < 1)
10812 {
10813 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10814 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10815 }
10816 else
10817 {
10818 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10819 }
10820
10821 idx = inventory_slots.Find(slot);
10822 if (idx < 0)
10823 return "";
10824
10825 return attach_types.Get(idx);
10826 }
10827
10829 {
10830 int idx = -1;
10831 string slot;
10832
10835
10836 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10837 if (inventory_slots.Count() < 1)
10838 {
10839 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10840 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10841 }
10842 else
10843 {
10844 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10845 if (detach_types.Count() < 1)
10846 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10847 }
10848
10849 for (int i = 0; i < inventory_slots.Count(); i++)
10850 {
10851 slot = inventory_slots.Get(i);
10852 }
10853
10854 if (slot != "")
10855 {
10856 if (detach_types.Count() == 1)
10857 idx = 0;
10858 else
10859 idx = inventory_slots.Find(slot);
10860 }
10861 if (idx < 0)
10862 return "";
10863
10864 return detach_types.Get(idx);
10865 }
10866
10868 {
10869
10871
10872
10873 float min_time = 1;
10874 float max_time = 3;
10875 float delay = Math.RandomFloat(min_time, max_time);
10876
10877 explode_timer.Run(delay, this, "DoAmmoExplosion");
10878 }
10879
10881 {
10882 Magazine magazine = Magazine.Cast(this);
10883 int pop_sounds_count = 6;
10884 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10885
10886
10887 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10888 string sound_name = pop_sounds[ sound_idx ];
10890
10891
10892 magazine.ServerAddAmmoCount(-1);
10893
10894
10895 float min_temp_to_explode = 100;
10896
10897 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10898 {
10900 }
10901 }
10902
10903
10904 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10905 {
10906 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10907
10908 const int CHANCE_DAMAGE_CARGO = 4;
10909 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10910 const int CHANCE_DAMAGE_NOTHING = 2;
10911
10913 {
10914 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10915 int chances;
10916 int rnd;
10917
10918 if (GetInventory().GetCargo())
10919 {
10920 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10921 rnd = Math.RandomInt(0,chances);
10922
10923 if (rnd < CHANCE_DAMAGE_CARGO)
10924 {
10926 }
10927 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10928 {
10930 }
10931 }
10932 else
10933 {
10934 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10935 rnd = Math.RandomInt(0,chances);
10936
10937 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10938 {
10940 }
10941 }
10942 }
10943 }
10944
10946 {
10947 if (GetInventory().GetCargo())
10948 {
10949 int item_count = GetInventory().GetCargo().GetItemCount();
10950 if (item_count > 0)
10951 {
10952 int random_pick = Math.RandomInt(0, item_count);
10954 if (!item.IsExplosive())
10955 {
10956 item.AddHealth("","",damage);
10957 return true;
10958 }
10959 }
10960 }
10961 return false;
10962 }
10963
10965 {
10966 int attachment_count = GetInventory().AttachmentCount();
10967 if (attachment_count > 0)
10968 {
10969 int random_pick = Math.RandomInt(0, attachment_count);
10970 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10971 if (!attachment.IsExplosive())
10972 {
10973 attachment.AddHealth("","",damage);
10974 return true;
10975 }
10976 }
10977 return false;
10978 }
10979
10981 {
10983 }
10984
10986 {
10988 return GetInventory().CanRemoveEntity();
10989
10990 return false;
10991 }
10992
10994 {
10996 return;
10997
10999 {
11000 if (ScriptInputUserData.CanStoreInputUserData())
11001 {
11002 ScriptInputUserData ctx = new ScriptInputUserData;
11007 ctx.
Write(destination_entity);
11009 ctx.
Write(slot_id);
11011 }
11012 }
11013 else if (!
GetGame().IsMultiplayer())
11014 {
11016 }
11017 }
11018
11020 {
11022 return;
11023
11024 float split_quantity_new;
11028 InventoryLocation loc = new InventoryLocation;
11029
11030 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11031 {
11033 split_quantity_new = stack_max;
11034 else
11036
11037 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11038 if (new_item)
11039 {
11040 new_item.SetResultOfSplit(true);
11041 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11043 new_item.SetQuantity(split_quantity_new);
11044 }
11045 }
11046 else if (destination_entity && slot_id == -1)
11047 {
11048 if (quantity > stack_max)
11049 split_quantity_new = stack_max;
11050 else
11051 split_quantity_new = quantity;
11052
11054 {
11057 }
11058
11059 if (new_item)
11060 {
11061 new_item.SetResultOfSplit(true);
11062 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11064 new_item.SetQuantity(split_quantity_new);
11065 }
11066 }
11067 else
11068 {
11069 if (stack_max != 0)
11070 {
11072 {
11074 }
11075
11076 if (split_quantity_new == 0)
11077 {
11078 if (!
GetGame().IsMultiplayer())
11079 player.PhysicalPredictiveDropItem(this);
11080 else
11081 player.ServerDropEntity(this);
11082 return;
11083 }
11084
11086
11087 if (new_item)
11088 {
11089 new_item.SetResultOfSplit(true);
11090 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11092 new_item.SetQuantity(stack_max);
11093 new_item.PlaceOnSurface();
11094 }
11095 }
11096 }
11097 }
11098
11100 {
11102 return;
11103
11104 float split_quantity_new;
11108 InventoryLocation loc = new InventoryLocation;
11109
11110 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11111 {
11113 split_quantity_new = stack_max;
11114 else
11116
11117 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11118 if (new_item)
11119 {
11120 new_item.SetResultOfSplit(true);
11121 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11123 new_item.SetQuantity(split_quantity_new);
11124 }
11125 }
11126 else if (destination_entity && slot_id == -1)
11127 {
11128 if (quantity > stack_max)
11129 split_quantity_new = stack_max;
11130 else
11131 split_quantity_new = quantity;
11132
11134 {
11137 }
11138
11139 if (new_item)
11140 {
11141 new_item.SetResultOfSplit(true);
11142 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11144 new_item.SetQuantity(split_quantity_new);
11145 }
11146 }
11147 else
11148 {
11149 if (stack_max != 0)
11150 {
11152 {
11154 }
11155
11157
11158 if (new_item)
11159 {
11160 new_item.SetResultOfSplit(true);
11161 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11163 new_item.SetQuantity(stack_max);
11164 new_item.PlaceOnSurface();
11165 }
11166 }
11167 }
11168 }
11169
11171 {
11173 return;
11174
11176 {
11177 if (ScriptInputUserData.CanStoreInputUserData())
11178 {
11179 ScriptInputUserData ctx = new ScriptInputUserData;
11184 dst.WriteToContext(ctx);
11186 }
11187 }
11188 else if (!
GetGame().IsMultiplayer())
11189 {
11191 }
11192 }
11193
11195 {
11197 return;
11198
11200 {
11201 if (ScriptInputUserData.CanStoreInputUserData())
11202 {
11203 ScriptInputUserData ctx = new ScriptInputUserData;
11208 ctx.
Write(destination_entity);
11214 }
11215 }
11216 else if (!
GetGame().IsMultiplayer())
11217 {
11219 }
11220 }
11221
11223 {
11225 }
11226
11228 {
11230 return this;
11231
11233 float split_quantity_new;
11235 if (dst.IsValid())
11236 {
11237 int slot_id = dst.GetSlot();
11239
11240 if (quantity > stack_max)
11241 split_quantity_new = stack_max;
11242 else
11243 split_quantity_new = quantity;
11244
11246
11247 if (new_item)
11248 {
11249 new_item.SetResultOfSplit(true);
11250 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11253 }
11254
11255 return new_item;
11256 }
11257
11258 return null;
11259 }
11260
11262 {
11264 return;
11265
11267 float split_quantity_new;
11269 if (destination_entity)
11270 {
11272 if (quantity > stackable)
11273 split_quantity_new = stackable;
11274 else
11275 split_quantity_new = quantity;
11276
11277 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11278 if (new_item)
11279 {
11280 new_item.SetResultOfSplit(true);
11281 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11283 new_item.SetQuantity(split_quantity_new);
11284 }
11285 }
11286 }
11287
11289 {
11291 return;
11292
11294 {
11295 if (ScriptInputUserData.CanStoreInputUserData())
11296 {
11297 ScriptInputUserData ctx = new ScriptInputUserData;
11302 ItemBase destination_entity =
this;
11303 ctx.
Write(destination_entity);
11307 }
11308 }
11309 else if (!
GetGame().IsMultiplayer())
11310 {
11312 }
11313 }
11314
11316 {
11318 return;
11319
11321 float split_quantity_new;
11323 if (player)
11324 {
11326 if (quantity > stackable)
11327 split_quantity_new = stackable;
11328 else
11329 split_quantity_new = quantity;
11330
11331 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11332 new_item =
ItemBase.Cast(in_hands);
11333 if (new_item)
11334 {
11335 new_item.SetResultOfSplit(true);
11336 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11338 new_item.SetQuantity(split_quantity_new);
11339 }
11340 }
11341 }
11342
11344 {
11346 return;
11347
11349 float split_quantity_new = Math.Floor(quantity * 0.5);
11350
11352
11353 if (new_item)
11354 {
11355 if (new_item.GetQuantityMax() < split_quantity_new)
11356 {
11357 split_quantity_new = new_item.GetQuantityMax();
11358 }
11359
11360 new_item.SetResultOfSplit(true);
11361 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11362
11364 {
11367 }
11368 else
11369 {
11372 }
11373 }
11374 }
11375
11377 {
11379 return;
11380
11382 float split_quantity_new = Math.Floor(quantity / 2);
11383
11384 InventoryLocation invloc = new InventoryLocation;
11386
11388 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11389
11390 if (new_item)
11391 {
11392 if (new_item.GetQuantityMax() < split_quantity_new)
11393 {
11394 split_quantity_new = new_item.GetQuantityMax();
11395 }
11397 {
11400 }
11401 else
11402 {
11405 }
11406 }
11407 }
11408
11411 {
11412 SetWeightDirty();
11414
11415 if (parent)
11416 parent.OnAttachmentQuantityChangedEx(this, delta);
11417
11419 {
11421 {
11423 }
11425 {
11426 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11428 }
11429 }
11430
11431 }
11432
11435 {
11436
11437 }
11438
11441 {
11443 }
11444
11446 {
11447 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11448
11450 {
11451 if (newLevel == GameConstants.STATE_RUINED)
11452 {
11454 EntityAI parent = GetHierarchyParent();
11455 if (parent && parent.IsFireplace())
11456 {
11457 CargoBase cargo = GetInventory().GetCargo();
11458 if (cargo)
11459 {
11461 {
11463 }
11464 }
11465 }
11466 }
11467
11469 {
11470
11472 return;
11473 }
11474
11475 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11476 {
11478 }
11479 }
11480 }
11481
11482
11484 {
11485 super.OnRightClick();
11486
11488 {
11490 {
11491 if (ScriptInputUserData.CanStoreInputUserData())
11492 {
11493 vector m4[4];
11495
11496 EntityAI root = GetHierarchyRoot();
11497
11498 InventoryLocation dst = new InventoryLocation;
11500 {
11501 if (root)
11502 {
11503 root.GetTransform(m4);
11505 }
11506 else
11507 GetInventory().GetCurrentInventoryLocation(dst);
11508 }
11509 else
11510 {
11512
11513
11514 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11515 {
11516 if (root)
11517 {
11518 root.GetTransform(m4);
11520 }
11521 else
11522 GetInventory().GetCurrentInventoryLocation(dst);
11523 }
11524 else
11525 {
11526 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11527 }
11528 }
11529
11530 ScriptInputUserData ctx = new ScriptInputUserData;
11538 }
11539 }
11540 else if (!
GetGame().IsMultiplayer())
11541 {
11543 }
11544 }
11545 }
11546
11547 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11548 {
11549
11550 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11551 return false;
11552
11553 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11554 return false;
11555
11556
11558 return false;
11559
11560
11561 Magazine mag = Magazine.Cast(this);
11562 if (mag)
11563 {
11564 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11565 return false;
11566
11567 if (stack_max_limit)
11568 {
11569 Magazine other_mag = Magazine.Cast(other_item);
11570 if (other_item)
11571 {
11572 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11573 return false;
11574 }
11575
11576 }
11577 }
11578 else
11579 {
11580
11582 return false;
11583
11585 return false;
11586 }
11587
11588 PlayerBase player = null;
11589 if (CastTo(player, GetHierarchyRootPlayer()))
11590 {
11591 if (player.GetInventory().HasAttachment(this))
11592 return false;
11593
11594 if (player.IsItemsToDelete())
11595 return false;
11596 }
11597
11598 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11599 return false;
11600
11601 int slotID;
11603 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11604 return false;
11605
11606 return true;
11607 }
11608
11610 {
11612 }
11613
11615 {
11616 return m_IsResultOfSplit;
11617 }
11618
11620 {
11621 m_IsResultOfSplit = value;
11622 }
11623
11625 {
11627 }
11628
11630 {
11631 float other_item_quantity = other_item.GetQuantity();
11632 float this_free_space;
11633
11635
11637
11638 if (other_item_quantity > this_free_space)
11639 {
11640 return this_free_space;
11641 }
11642 else
11643 {
11644 return other_item_quantity;
11645 }
11646 }
11647
11649 {
11651 }
11652
11654 {
11656 return;
11657
11658 if (!IsMagazine() && other_item)
11659 {
11661 if (quantity_used != 0)
11662 {
11663 float hp1 = GetHealth01("","");
11664 float hp2 = other_item.GetHealth01("","");
11665 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11666 hpResult = hpResult / (
GetQuantity() + quantity_used);
11667
11668 hpResult *= GetMaxHealth();
11669 Math.Round(hpResult);
11670 SetHealth("", "Health", hpResult);
11671
11673 other_item.AddQuantity(-quantity_used);
11674 }
11675 }
11677 }
11678
11680 {
11681 #ifdef SERVER
11682 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11683 GetHierarchyParent().IncreaseLifetimeUp();
11684 #endif
11685 };
11686
11688 {
11689 PlayerBase p = PlayerBase.Cast(player);
11690
11691 array<int> recipesIds = p.m_Recipes;
11692 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11693 if (moduleRecipesManager)
11694 {
11695 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11696 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11697 }
11698
11699 for (int i = 0;i < recipesIds.Count(); i++)
11700 {
11701 int key = recipesIds.Get(i);
11702 string recipeName = moduleRecipesManager.GetRecipeName(key);
11704 }
11705 }
11706
11707
11708 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11709 {
11710 super.GetDebugActions(outputList);
11711
11712
11717
11718
11722
11726
11727
11730
11731
11733 {
11736 }
11737
11739
11742
11746 }
11747
11748
11749
11750
11752 {
11753 super.OnAction(action_id, player, ctx);
11754 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11755 {
11756 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11757 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11758 PlayerBase p = PlayerBase.Cast(player);
11759 if (
EActions.RECIPES_RANGE_START < 1000)
11760 {
11761 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11762 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11763 }
11764 }
11765 #ifndef SERVER
11766 else if (action_id ==
EActions.WATCH_PLAYER)
11767 {
11768 PluginDeveloper.SetDeveloperItemClientEx(player);
11769 }
11770 #endif
11772 {
11773 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11774 {
11775 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11776 OnDebugButtonPressServer(id + 1);
11777 }
11778
11779 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11780 {
11781 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11783 }
11784
11785 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11786 {
11787 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11789 }
11790
11791 else if (action_id ==
EActions.ADD_QUANTITY)
11792 {
11793 if (IsMagazine())
11794 {
11795 Magazine mag = Magazine.Cast(this);
11796 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11797 }
11798 else
11799 {
11801 }
11802
11803 if (m_EM)
11804 {
11805 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11806 }
11807
11808 }
11809
11810 else if (action_id ==
EActions.REMOVE_QUANTITY)
11811 {
11812 if (IsMagazine())
11813 {
11814 Magazine mag2 = Magazine.Cast(this);
11815 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11816 }
11817 else
11818 {
11820 }
11821 if (m_EM)
11822 {
11823 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11824 }
11825
11826 }
11827
11828 else if (action_id ==
EActions.SET_QUANTITY_0)
11829 {
11831
11832 if (m_EM)
11833 {
11834 m_EM.SetEnergy(0);
11835 }
11836 }
11837
11838 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11839 {
11841
11842 if (m_EM)
11843 {
11844 m_EM.SetEnergy(m_EM.GetEnergyMax());
11845 }
11846 }
11847
11848 else if (action_id ==
EActions.ADD_HEALTH)
11849 {
11850 AddHealth("","",GetMaxHealth("","Health")/5);
11851 }
11852 else if (action_id ==
EActions.REMOVE_HEALTH)
11853 {
11854 AddHealth("","",-GetMaxHealth("","Health")/5);
11855 }
11856 else if (action_id ==
EActions.DESTROY_HEALTH)
11857 {
11858 SetHealth01("","",0);
11859 }
11860 else if (action_id ==
EActions.WATCH_ITEM)
11861 {
11863 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11864 #ifdef DEVELOPER
11865 SetDebugDeveloper_item(this);
11866 #endif
11867 }
11868
11869 else if (action_id ==
EActions.ADD_TEMPERATURE)
11870 {
11871 AddTemperature(20);
11872
11873 }
11874
11875 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11876 {
11877 AddTemperature(-20);
11878
11879 }
11880
11881 else if (action_id ==
EActions.FLIP_FROZEN)
11882 {
11883 SetFrozen(!GetIsFrozen());
11884
11885 }
11886
11887 else if (action_id ==
EActions.ADD_WETNESS)
11888 {
11890
11891 }
11892
11893 else if (action_id ==
EActions.REMOVE_WETNESS)
11894 {
11896
11897 }
11898
11899 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11900 {
11903
11904
11905 }
11906
11907 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11908 {
11911 }
11912
11913 else if (action_id ==
EActions.MAKE_SPECIAL)
11914 {
11915 auto debugParams = DebugSpawnParams.WithPlayer(player);
11916 OnDebugSpawnEx(debugParams);
11917 }
11918
11919 else if (action_id ==
EActions.DELETE)
11920 {
11921 Delete();
11922 }
11923
11924 }
11925
11926
11927 return false;
11928 }
11929
11930
11931
11932
11936
11939
11940
11941
11943 {
11944 return false;
11945 }
11946
11947
11949 {
11950 return true;
11951 }
11952
11953
11955 {
11956 return true;
11957 }
11958
11959
11960
11962 {
11963 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11965 }
11966
11969 {
11970 return null;
11971 }
11972
11974 {
11975 return false;
11976 }
11977
11979 {
11980 return false;
11981 }
11982
11986
11987
11989 {
11990 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11991 return module_repairing.CanRepair(this, item_repair_kit);
11992 }
11993
11994
11995 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11996 {
11997 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11998 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11999 }
12000
12001
12003 {
12004
12005
12006
12007
12008
12009
12010
12011
12012 return 1;
12013 }
12014
12015
12016
12018 {
12020 }
12021
12022
12023
12025 {
12027 }
12028
12029
12038 {
12039 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12040
12041 if (player)
12042 {
12043 player.MessageStatus(text);
12044 }
12045 }
12046
12047
12056 {
12057 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12058
12059 if (player)
12060 {
12061 player.MessageAction(text);
12062 }
12063 }
12064
12065
12074 {
12075 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12076
12077 if (player)
12078 {
12079 player.MessageFriendly(text);
12080 }
12081 }
12082
12083
12092 {
12093 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12094
12095 if (player)
12096 {
12097 player.MessageImportant(text);
12098 }
12099 }
12100
12102 {
12103 return true;
12104 }
12105
12106
12107 override bool KindOf(
string tag)
12108 {
12109 bool found = false;
12110 string item_name = this.
GetType();
12113
12114 int array_size = item_tag_array.Count();
12115 for (int i = 0; i < array_size; i++)
12116 {
12117 if (item_tag_array.Get(i) == tag)
12118 {
12119 found = true;
12120 break;
12121 }
12122 }
12123 return found;
12124 }
12125
12126
12128 {
12129
12130 super.OnRPC(sender, rpc_type,ctx);
12131
12132
12133 switch (rpc_type)
12134 {
12135 #ifndef SERVER
12136 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12137 Param2<bool, string> p = new Param2<bool, string>(false, "");
12138
12140 return;
12141
12142 bool play = p.param1;
12143 string soundSet = p.param2;
12144
12145 if (play)
12146 {
12148 {
12150 {
12152 }
12153 }
12154 else
12155 {
12157 }
12158 }
12159 else
12160 {
12162 }
12163
12164 break;
12165 #endif
12166
12167 }
12168
12170 {
12172 }
12173 }
12174
12175
12176
12177
12179 {
12180 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12181 return plugin.GetID(
name);
12182 }
12183
12185 {
12186 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12187 return plugin.GetName(id);
12188 }
12189
12192 {
12193
12194
12195 int varFlags;
12196 if (!ctx.
Read(varFlags))
12197 return;
12198
12199 if (varFlags & ItemVariableFlags.FLOAT)
12200 {
12202 }
12203 }
12204
12206 {
12207
12208 super.SerializeNumericalVars(floats_out);
12209
12210
12211
12213 {
12215 }
12216
12218 {
12220 }
12221
12223 {
12225 }
12226
12228 {
12233 }
12234
12236 {
12238 }
12239 }
12240
12242 {
12243
12244 super.DeSerializeNumericalVars(floats);
12245
12246
12247 int index = 0;
12248 int mask = Math.Round(floats.Get(index));
12249
12250 index++;
12251
12253 {
12255 {
12257 }
12258 else
12259 {
12260 float quantity = floats.Get(index);
12261 SetQuantity(quantity,
true,
false,
false,
false);
12262 }
12263 index++;
12264 }
12265
12267 {
12268 float wet = floats.Get(index);
12270 index++;
12271 }
12272
12274 {
12275 int liquidtype = Math.Round(floats.Get(index));
12277 index++;
12278 }
12279
12281 {
12283 index++;
12285 index++;
12287 index++;
12289 index++;
12290 }
12291
12293 {
12294 int cleanness = Math.Round(floats.Get(index));
12296 index++;
12297 }
12298 }
12299
12301 {
12302 super.WriteVarsToCTX(ctx);
12303
12304
12306 {
12308 }
12309
12311 {
12313 }
12314
12316 {
12318 }
12319
12321 {
12322 int r,g,b,a;
12328 }
12329
12331 {
12333 }
12334 }
12335
12337 {
12338 if (!super.ReadVarsFromCTX(ctx,version))
12339 return false;
12340
12341 int intValue;
12342 float value;
12343
12344 if (version < 140)
12345 {
12346 if (!ctx.
Read(intValue))
12347 return false;
12348
12349 m_VariablesMask = intValue;
12350 }
12351
12353 {
12354 if (!ctx.
Read(value))
12355 return false;
12356
12358 {
12360 }
12361 else
12362 {
12364 }
12365 }
12366
12367 if (version < 140)
12368 {
12370 {
12371 if (!ctx.
Read(value))
12372 return false;
12373 SetTemperatureDirect(value);
12374 }
12375 }
12376
12378 {
12379 if (!ctx.
Read(value))
12380 return false;
12382 }
12383
12385 {
12386 if (!ctx.
Read(intValue))
12387 return false;
12389 }
12390
12392 {
12393 int r,g,b,a;
12395 return false;
12397 return false;
12399 return false;
12401 return false;
12402
12404 }
12405
12407 {
12408 if (!ctx.
Read(intValue))
12409 return false;
12411 }
12412
12413 if (version >= 138 && version < 140)
12414 {
12416 {
12417 if (!ctx.
Read(intValue))
12418 return false;
12419 SetFrozen(intValue);
12420 }
12421 }
12422
12423 return true;
12424 }
12425
12426
12428 {
12431 {
12433 }
12434
12435 if (!super.OnStoreLoad(ctx, version))
12436 {
12438 return false;
12439 }
12440
12441 if (version >= 114)
12442 {
12443 bool hasQuickBarIndexSaved;
12444
12445 if (!ctx.
Read(hasQuickBarIndexSaved))
12446 {
12448 return false;
12449 }
12450
12451 if (hasQuickBarIndexSaved)
12452 {
12453 int itmQBIndex;
12454
12455
12456 if (!ctx.
Read(itmQBIndex))
12457 {
12459 return false;
12460 }
12461
12462 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12463 if (itmQBIndex != -1 && parentPlayer)
12464 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12465 }
12466 }
12467 else
12468 {
12469
12470 PlayerBase player;
12471 int itemQBIndex;
12472 if (version ==
int.
MAX)
12473 {
12474 if (!ctx.
Read(itemQBIndex))
12475 {
12477 return false;
12478 }
12479 }
12480 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12481 {
12482
12483 if (!ctx.
Read(itemQBIndex))
12484 {
12486 return false;
12487 }
12488 if (itemQBIndex != -1 && player)
12489 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12490 }
12491 }
12492
12493 if (version < 140)
12494 {
12495
12496 if (!LoadVariables(ctx, version))
12497 {
12499 return false;
12500 }
12501 }
12502
12503
12505 {
12507 return false;
12508 }
12509 if (version >= 132)
12510 {
12512 if (raib)
12513 {
12515 {
12517 return false;
12518 }
12519 }
12520 }
12521
12523 return true;
12524 }
12525
12526
12527
12529 {
12530 super.OnStoreSave(ctx);
12531
12532 PlayerBase player;
12533 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12534 {
12536
12537 int itemQBIndex = -1;
12538 itemQBIndex = player.FindQuickBarEntityIndex(this);
12539 ctx.
Write(itemQBIndex);
12540 }
12541 else
12542 {
12544 }
12545
12547
12549 if (raib)
12550 {
12552 }
12553 }
12554
12555
12557 {
12558 super.AfterStoreLoad();
12559
12561 {
12563 }
12564
12566 {
12569 }
12570 }
12571
12573 {
12574 super.EEOnAfterLoad();
12575
12577 {
12579 }
12580
12583 }
12584
12586 {
12587 return false;
12588 }
12589
12590
12591
12593 {
12595 {
12596 #ifdef PLATFORM_CONSOLE
12597
12599 {
12601 if (menu)
12602 {
12604 }
12605 }
12606 #endif
12607 }
12608
12610 {
12613 }
12614
12616 {
12617 SetWeightDirty();
12619 }
12621 {
12624 }
12625
12627 {
12630 }
12632 {
12635 }
12636
12637 super.OnVariablesSynchronized();
12638 }
12639
12640
12641
12643 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12644 {
12645 if (!IsServerCheck(allow_client))
12646 return false;
12647
12649 return false;
12650
12653
12654 if (value <= (min + 0.001))
12655 value = min;
12656
12657 if (value == min)
12658 {
12659 if (destroy_config)
12660 {
12661 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12662 if (dstr)
12663 {
12665 this.Delete();
12666 return true;
12667 }
12668 }
12669 else if (destroy_forced)
12670 {
12672 this.Delete();
12673 return true;
12674 }
12675
12677 }
12678
12681
12683 {
12685
12686 if (delta)
12688 }
12689
12691
12692 return false;
12693 }
12694
12695
12697 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12698 {
12700 }
12701
12703 {
12706 }
12707
12709 {
12712 }
12713
12716 {
12717 float value_clamped = Math.Clamp(value, 0, 1);
12719 SetQuantity(result, destroy_config, destroy_forced);
12720 }
12721
12722
12725 {
12727 }
12728
12730 {
12732 }
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12744 {
12745 int slot = -1;
12746 if (GetInventory())
12747 {
12748 InventoryLocation il = new InventoryLocation;
12749 GetInventory().GetCurrentInventoryLocation(il);
12751 }
12752
12754 }
12755
12757 {
12758 float quantity_max = 0;
12759
12761 {
12762 if (attSlotID != -1)
12763 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12764
12765 if (quantity_max <= 0)
12767 }
12768
12769 if (quantity_max <= 0)
12771
12772 return quantity_max;
12773 }
12774
12776 {
12778 }
12779
12781 {
12783 }
12784
12785
12787 {
12789 }
12790
12792 {
12794 }
12795
12797 {
12799 }
12800
12801
12803 {
12804
12805 float weightEx = GetWeightEx();
12806 float special = GetInventoryAndCargoWeight();
12807 return weightEx - special;
12808 }
12809
12810
12812 {
12814 }
12815
12817 {
12819 {
12820 #ifdef DEVELOPER
12821 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12822 {
12823 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12825 }
12826 #endif
12827
12828 return GetQuantity() * GetConfigWeightModified();
12829 }
12830 else if (HasEnergyManager())
12831 {
12832 #ifdef DEVELOPER
12833 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12834 {
12835 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12836 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12837 }
12838 #endif
12839 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12840 }
12841 else
12842 {
12843 #ifdef DEVELOPER
12844 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12845 {
12846 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12847 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12848 }
12849 #endif
12850 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12851 }
12852 }
12853
12856 {
12857 int item_count = 0;
12859
12860 if (GetInventory().GetCargo() != NULL)
12861 {
12862 item_count = GetInventory().GetCargo().GetItemCount();
12863 }
12864
12865 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12866 {
12867 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12868 if (item)
12869 item_count += item.GetNumberOfItems();
12870 }
12871 return item_count;
12872 }
12873
12876 {
12877 float weight = 0;
12878 float wetness = 1;
12879 if (include_wetness)
12882 {
12883 weight = wetness * m_ConfigWeight;
12884 }
12886 {
12887 weight = 1;
12888 }
12889 return weight;
12890 }
12891
12892
12893
12895 {
12896 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12897 {
12898 GameInventory inv = GetInventory();
12899 array<EntityAI> items = new array<EntityAI>;
12901 for (int i = 0; i < items.Count(); i++)
12902 {
12904 if (item)
12905 {
12907 }
12908 }
12909 }
12910 }
12911
12912
12913
12914
12916 {
12917 float energy = 0;
12918 if (HasEnergyManager())
12919 {
12920 energy = GetCompEM().GetEnergy();
12921 }
12922 return energy;
12923 }
12924
12925
12927 {
12928 super.OnEnergyConsumed();
12929
12931 }
12932
12934 {
12935 super.OnEnergyAdded();
12936
12938 }
12939
12940
12942 {
12943 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12944 {
12946 {
12947 float energy_0to1 = GetCompEM().GetEnergy0To1();
12949 }
12950 }
12951 }
12952
12953
12955 {
12956 return ConfigGetFloat("heatIsolation");
12957 }
12958
12960 {
12962 }
12963
12965 {
12966 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12967 if (
GetGame().ConfigIsExisting(paramPath))
12969
12970 return 0.0;
12971 }
12972
12974 {
12975 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12976 if (
GetGame().ConfigIsExisting(paramPath))
12978
12979 return 0.0;
12980 }
12981
12982 override void SetWet(
float value,
bool allow_client =
false)
12983 {
12984 if (!IsServerCheck(allow_client))
12985 return;
12986
12989
12991
12992 m_VarWet = Math.Clamp(value, min, max);
12993
12995 {
12998 }
12999 }
13000
13001 override void AddWet(
float value)
13002 {
13004 }
13005
13007 {
13009 }
13010
13012 {
13014 }
13015
13017 {
13019 }
13020
13022 {
13024 }
13025
13027 {
13029 }
13030
13031 override void OnWetChanged(
float newVal,
float oldVal)
13032 {
13035 if (newLevel != oldLevel)
13036 {
13038 }
13039 }
13040
13042 {
13043 SetWeightDirty();
13044 }
13045
13047 {
13048 return GetWetLevelInternal(
m_VarWet);
13049 }
13050
13051
13052
13054 {
13056 }
13057
13059 {
13061 }
13062
13064 {
13066 }
13067
13069 {
13071 }
13072
13073
13074
13076 {
13077 if (ConfigIsExisting("itemModelLength"))
13078 {
13079 return ConfigGetFloat("itemModelLength");
13080 }
13081 return 0;
13082 }
13083
13085 {
13086 if (ConfigIsExisting("itemAttachOffset"))
13087 {
13088 return ConfigGetFloat("itemAttachOffset");
13089 }
13090 return 0;
13091 }
13092
13093 override void SetCleanness(
int value,
bool allow_client =
false)
13094 {
13095 if (!IsServerCheck(allow_client))
13096 return;
13097
13099
13101
13104 }
13105
13107 {
13109 }
13110
13112 {
13113 return true;
13114 }
13115
13116
13117
13118
13120 {
13122 }
13123
13125 {
13127 }
13128
13129
13130
13131
13132 override void SetColor(
int r,
int g,
int b,
int a)
13133 {
13139 }
13141 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13142 {
13147 }
13148
13150 {
13152 }
13153
13156 {
13157 int r,g,b,a;
13159 r = r/255;
13160 g = g/255;
13161 b = b/255;
13162 a = a/255;
13163 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13164 }
13165
13166
13167
13168 override void SetLiquidType(
int value,
bool allow_client =
false)
13169 {
13170 if (!IsServerCheck(allow_client))
13171 return;
13172
13177 }
13178
13180 {
13181 return ConfigGetInt("varLiquidTypeInit");
13182 }
13183
13185 {
13187 }
13188
13190 {
13192 SetFrozen(false);
13193 }
13194
13197 {
13198 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13199 }
13200
13201
13204 {
13205 PlayerBase nplayer;
13206 if (PlayerBase.CastTo(nplayer, player))
13207 {
13209
13210 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13211 }
13212 }
13213
13214
13217 {
13218 PlayerBase nplayer;
13219 if (PlayerBase.CastTo(nplayer,player))
13220 {
13221
13222 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13223
13224 }
13225
13226
13227 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13228
13229
13230 if (HasEnergyManager())
13231 {
13232 GetCompEM().UpdatePlugState();
13233 }
13234 }
13235
13236
13238 {
13239 super.OnPlacementStarted(player);
13240
13242 }
13243
13244 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13245 {
13247 {
13248 m_AdminLog.OnPlacementComplete(player,
this);
13249 }
13250
13251 super.OnPlacementComplete(player, position, orientation);
13252 }
13253
13254
13255
13256
13257
13259 {
13261 {
13262 return true;
13263 }
13264 else
13265 {
13266 return false;
13267 }
13268 }
13269
13270
13272 {
13274 {
13276 }
13277 }
13278
13279
13281 {
13283 }
13284
13286 {
13288 }
13289
13290 override void InsertAgent(
int agent,
float count = 1)
13291 {
13292 if (count < 1)
13293 return;
13294
13296 }
13297
13300 {
13302 }
13303
13304
13306 {
13308 }
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13352 {
13354 return false;
13355 return true;
13356 }
13357
13359 {
13360
13362 }
13363
13364
13367 {
13368 super.CheckForRoofLimited(timeTresholdMS);
13369
13371 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13372 {
13373 m_PreviousRoofTestTime = time;
13374 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13375 }
13376 }
13377
13378
13380 {
13382 {
13383 return 0;
13384 }
13385
13386 if (GetInventory().GetAttachmentSlotsCount() != 0)
13387 {
13388 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13389 if (filter)
13390 return filter.GetProtectionLevel(type, false, system);
13391 else
13392 return 0;
13393 }
13394
13395 string subclassPath, entryName;
13396
13397 switch (type)
13398 {
13400 entryName = "biological";
13401 break;
13403 entryName = "chemical";
13404 break;
13405 default:
13406 entryName = "biological";
13407 break;
13408 }
13409
13410 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13411
13413 }
13414
13415
13416
13419 {
13420 if (!IsMagazine())
13422
13424 }
13425
13426
13427
13428
13429
13434 {
13435 return true;
13436 }
13437
13439 {
13441 }
13442
13443
13444
13445
13446
13448 {
13449 if (parent)
13450 {
13451 if (parent.IsInherited(DayZInfected))
13452 return true;
13453
13454 if (!parent.IsRuined())
13455 return true;
13456 }
13457
13458 return true;
13459 }
13460
13462 {
13463 if (!super.CanPutAsAttachment(parent))
13464 {
13465 return false;
13466 }
13467
13468 if (!IsRuined() && !parent.IsRuined())
13469 {
13470 return true;
13471 }
13472
13473 return false;
13474 }
13475
13477 {
13478
13479
13480
13481
13482 return super.CanReceiveItemIntoCargo(item);
13483 }
13484
13486 {
13487
13488
13489
13490
13491 GameInventory attachmentInv = attachment.GetInventory();
13493 {
13494 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13495 return false;
13496 }
13497
13498 InventoryLocation loc = new InventoryLocation();
13499 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13500 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13501 return false;
13502
13503 return super.CanReceiveAttachment(attachment, slotId);
13504 }
13505
13507 {
13508 if (!super.CanReleaseAttachment(attachment))
13509 return false;
13510
13511 return GetInventory().AreChildrenAccessible();
13512 }
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13535 {
13536 int id = muzzle_owner.GetMuzzleID();
13537 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13538
13539 if (WPOF_array)
13540 {
13541 for (int i = 0; i < WPOF_array.Count(); i++)
13542 {
13543 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13544
13545 if (WPOF)
13546 {
13547 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13548 }
13549 }
13550 }
13551 }
13552
13553
13555 {
13556 int id = muzzle_owner.GetMuzzleID();
13558
13559 if (WPOBE_array)
13560 {
13561 for (int i = 0; i < WPOBE_array.Count(); i++)
13562 {
13563 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13564
13565 if (WPOBE)
13566 {
13567 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13568 }
13569 }
13570 }
13571 }
13572
13573
13575 {
13576 int id = muzzle_owner.GetMuzzleID();
13577 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13578
13579 if (WPOOH_array)
13580 {
13581 for (int i = 0; i < WPOOH_array.Count(); i++)
13582 {
13583 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13584
13585 if (WPOOH)
13586 {
13587 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13588 }
13589 }
13590 }
13591 }
13592
13593
13595 {
13596 int id = muzzle_owner.GetMuzzleID();
13597 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13598
13599 if (WPOOH_array)
13600 {
13601 for (int i = 0; i < WPOOH_array.Count(); i++)
13602 {
13603 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13604
13605 if (WPOOH)
13606 {
13607 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13608 }
13609 }
13610 }
13611 }
13612
13613
13615 {
13616 int id = muzzle_owner.GetMuzzleID();
13617 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13618
13619 if (WPOOH_array)
13620 {
13621 for (int i = 0; i < WPOOH_array.Count(); i++)
13622 {
13623 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13624
13625 if (WPOOH)
13626 {
13627 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13628 }
13629 }
13630 }
13631 }
13632
13633
13634
13636 {
13638 {
13639 return true;
13640 }
13641
13642 return false;
13643 }
13644
13646 {
13648 {
13649 return true;
13650 }
13651
13652 return false;
13653 }
13654
13656 {
13658 {
13659 return true;
13660 }
13661
13662 return false;
13663 }
13664
13666 {
13667 return false;
13668 }
13669
13672 {
13673 return UATimeSpent.DEFAULT_DEPLOY;
13674 }
13675
13676
13677
13678
13680 {
13682 SetSynchDirty();
13683 }
13684
13686 {
13688 }
13689
13690
13692 {
13693 return false;
13694 }
13695
13698 {
13699 string att_type = "None";
13700
13701 if (ConfigIsExisting("soundAttType"))
13702 {
13703 att_type = ConfigGetString("soundAttType");
13704 }
13705
13707 }
13708
13710 {
13712 }
13713
13714
13715
13716
13717
13721
13723 {
13726
13728 }
13729
13730
13732 {
13734 return;
13735
13737
13740
13743
13744 SoundParameters params = new SoundParameters();
13748 }
13749
13750
13752 {
13754 return;
13755
13757 SetSynchDirty();
13758
13761 }
13762
13763
13765 {
13767 return;
13768
13770 SetSynchDirty();
13771
13774 }
13775
13777 {
13779 }
13780
13782 {
13784 }
13785
13788 {
13789 if (!
GetGame().IsDedicatedServer())
13790 {
13791 if (ConfigIsExisting("attachSoundSet"))
13792 {
13793 string cfg_path = "";
13794 string soundset = "";
13795 string type_name =
GetType();
13796
13799 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13800 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13801
13802 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13803 {
13804 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13805 {
13806 if (cfg_slot_array[i] == slot_type)
13807 {
13808 soundset = cfg_soundset_array[i];
13809 break;
13810 }
13811 }
13812 }
13813
13814 if (soundset != "")
13815 {
13816 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13818 }
13819 }
13820 }
13821 }
13822
13824 {
13825
13826 }
13827
13828 void OnApply(PlayerBase player);
13829
13831 {
13832 return 1.0;
13833 };
13834
13836 {
13838 }
13839
13841 {
13843 }
13844
13846
13848 {
13849 SetDynamicPhysicsLifeTime(0.01);
13851 }
13852
13854 {
13855 array<string> zone_names = new array<string>;
13856 GetDamageZones(zone_names);
13857 for (int i = 0; i < zone_names.Count(); i++)
13858 {
13859 SetHealthMax(zone_names.Get(i),"Health");
13860 }
13861 SetHealthMax("","Health");
13862 }
13863
13866 {
13867 float global_health = GetHealth01("","Health");
13868 array<string> zones = new array<string>;
13869 GetDamageZones(zones);
13870
13871 for (int i = 0; i < zones.Count(); i++)
13872 {
13873 SetHealth01(zones.Get(i),"Health",global_health);
13874 }
13875 }
13876
13879 {
13880 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13881 }
13882
13884 {
13885 if (!hasRootAsPlayer)
13886 {
13887 if (refParentIB)
13888 {
13889
13890 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13891 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13892
13893 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13894 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13895
13898 }
13899 else
13900 {
13901
13904 }
13905 }
13906 }
13907
13909 {
13911 {
13912 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13913 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13914 {
13915 float heatPermCoef = 1.0;
13917 while (ent)
13918 {
13919 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13920 ent = ent.GetHierarchyParent();
13921 }
13922
13923 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13924 }
13925 }
13926 }
13927
13929 {
13930
13931 EntityAI parent = GetHierarchyParent();
13932 if (!parent)
13933 {
13934 hasParent = false;
13935 hasRootAsPlayer = false;
13936 }
13937 else
13938 {
13939 hasParent = true;
13940 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13941 refParentIB =
ItemBase.Cast(parent);
13942 }
13943 }
13944
13945 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13946 {
13947
13948 }
13949
13951 {
13952
13953 return false;
13954 }
13955
13957 {
13958
13959
13960 return false;
13961 }
13962
13964 {
13965
13966 return false;
13967 }
13968
13971 {
13972 return !GetIsFrozen() &&
IsOpen();
13973 }
13974
13976 {
13977 bool hasParent = false, hasRootAsPlayer = false;
13979
13980 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13981 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13982
13983 if (wwtu || foodDecay)
13984 {
13988
13989 if (processWetness || processTemperature || processDecay)
13990 {
13992
13993 if (processWetness)
13994 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13995
13996 if (processTemperature)
13998
13999 if (processDecay)
14000 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14001 }
14002 }
14003 }
14004
14007 {
14009 }
14010
14012 {
14015
14016 return super.GetTemperatureFreezeThreshold();
14017 }
14018
14020 {
14023
14024 return super.GetTemperatureThawThreshold();
14025 }
14026
14028 {
14031
14032 return super.GetItemOverheatThreshold();
14033 }
14034
14036 {
14038 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14039
14040 return super.GetTemperatureFreezeTime();
14041 }
14042
14044 {
14046 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14047
14048 return super.GetTemperatureThawTime();
14049 }
14050
14055
14057 {
14058 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14059 }
14060
14062 {
14063 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14064 }
14065
14068 {
14070 }
14071
14073 {
14075 }
14076
14078 {
14080 }
14081
14084 {
14085 return null;
14086 }
14087
14090 {
14091 return false;
14092 }
14093
14095 {
14097 {
14100 if (!trg)
14101 {
14103 explosive = this;
14104 }
14105
14106 explosive.PairRemote(trg);
14108
14109 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14110 trg.SetPersistentPairID(persistentID);
14111 explosive.SetPersistentPairID(persistentID);
14112
14113 return true;
14114 }
14115 return false;
14116 }
14117
14120 {
14121 float ret = 1.0;
14124 ret *= GetHealth01();
14125
14126 return ret;
14127 }
14128
14129 #ifdef DEVELOPER
14130 override void SetDebugItem()
14131 {
14132 super.SetDebugItem();
14133 _itemBase = this;
14134 }
14135
14137 {
14138 string text = super.GetDebugText();
14139
14141 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14142
14143 return text;
14144 }
14145 #endif
14146
14148 {
14149 return true;
14150 }
14151
14153
14155
14157 {
14160 }
14161
14162
14170
14186}
14187
14189{
14191 if (entity)
14192 {
14193 bool is_item = entity.IsInherited(
ItemBase);
14194 if (is_item && full_quantity)
14195 {
14198 }
14199 }
14200 else
14201 {
14203 return NULL;
14204 }
14205 return entity;
14206}
14207
14209{
14210 if (item)
14211 {
14212 if (health > 0)
14213 item.SetHealth("", "", health);
14214
14215 if (item.CanHaveTemperature())
14216 {
14218 if (item.CanFreeze())
14219 item.SetFrozen(false);
14220 }
14221
14222 if (item.HasEnergyManager())
14223 {
14224 if (quantity >= 0)
14225 {
14226 item.GetCompEM().SetEnergy0To1(quantity);
14227 }
14228 else
14229 {
14231 }
14232 }
14233 else if (item.IsMagazine())
14234 {
14235 Magazine mag = Magazine.Cast(item);
14236 if (quantity >= 0)
14237 {
14238 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14239 }
14240 else
14241 {
14243 }
14244
14245 }
14246 else
14247 {
14248 if (quantity >= 0)
14249 {
14250 item.SetQuantityNormalized(quantity, false);
14251 }
14252 else
14253 {
14255 }
14256
14257 }
14258 }
14259}
14260
14261#ifdef DEVELOPER
14263#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.