9474{
9476 {
9477 return true;
9478 }
9479};
9480
9481
9482
9484{
9488
9490
9493
9494
9495
9496
9497
9506
9512
9517
9522
9543 protected bool m_IsResultOfSplit
9544
9546
9551
9552
9553
9555
9559
9560
9561
9563
9566
9567
9568
9574
9575
9583
9586
9587
9589
9590
9592
9593
9598
9599
9604
9605
9607
9608
9610 {
9615
9616 if (!
GetGame().IsDedicatedServer())
9617 {
9619 {
9621
9623 {
9625 }
9626 }
9627
9630 }
9631
9632 m_OldLocation = null;
9633
9635 {
9637 }
9638
9639 if (ConfigIsExisting("headSelectionsToHide"))
9640 {
9643 }
9644
9646 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9647 {
9649 }
9650
9652
9653 m_IsResultOfSplit = false;
9654
9656 }
9657
9659 {
9660 super.InitItemVariables();
9661
9667 m_Count = ConfigGetInt(
"count");
9668
9671
9676
9679
9684
9696
9700
9701
9704 if (ConfigIsExisting("canBeSplit"))
9705 {
9708 }
9709
9711 if (ConfigIsExisting("itemBehaviour"))
9713
9714
9717 RegisterNetSyncVariableInt("m_VarLiquidType");
9718 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9719
9720 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9721 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9722 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9723
9724 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9725 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9726 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9727 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9728
9729 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9730 RegisterNetSyncVariableBool("m_IsTakeable");
9731 RegisterNetSyncVariableBool("m_IsHologram");
9732
9735 {
9738 }
9739
9741
9743 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9745
9746 }
9747
9749 {
9751 }
9752
9754 {
9757 {
9762 }
9763 }
9764
9765 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9766 {
9768 {
9771 }
9772
9774 }
9775
9777 {
9783 }
9784
9786
9788 {
9790
9791 if (!action)
9792 {
9793 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9794 return;
9795 }
9796
9798 if (!ai)
9799 {
9801 return;
9802 }
9803
9805 if (!action_array)
9806 {
9807 action_array = new array<ActionBase_Basic>;
9809 }
9810 if (LogManager.IsActionLogEnable())
9811 {
9812 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9813 }
9814
9815 if (action_array.Find(action) != -1)
9816 {
9817 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9818 }
9819 else
9820 {
9821 action_array.Insert(action);
9822 }
9823 }
9824
9826 {
9828 ActionBase action = player.GetActionManager().GetAction(actionName);
9831
9832 if (action_array)
9833 {
9834 action_array.RemoveItem(action);
9835 }
9836 }
9837
9838
9839
9841 {
9842 ActionOverrideData overrideData = new ActionOverrideData();
9846
9848 if (!actionMap)
9849 {
9852 }
9853
9854 actionMap.Insert(this.
Type(), overrideData);
9855
9856 }
9857
9859
9861
9862
9864 {
9867
9870
9871 string config_to_search = "CfgVehicles";
9872 string muzzle_owner_config;
9873
9875 {
9876 if (IsInherited(Weapon))
9877 config_to_search = "CfgWeapons";
9878
9879 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9880
9881 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9882
9884
9885 if (config_OnFire_subclass_count > 0)
9886 {
9887 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9888
9889 for (int i = 0; i < config_OnFire_subclass_count; i++)
9890 {
9891 string particle_class = "";
9893 string config_OnFire_entry = config_OnFire_class + particle_class;
9894 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9895 WPOF_array.Insert(WPOF);
9896 }
9897
9898
9900 }
9901 }
9902
9904 {
9905 config_to_search = "CfgWeapons";
9906 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9907
9908 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9909
9911
9912 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9913 {
9914 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9915
9916 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9917 {
9918 string particle_class2 = "";
9920 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9921 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9922 WPOBE_array.Insert(WPOBE);
9923 }
9924
9925
9927 }
9928 }
9929 }
9930
9931
9933 {
9936
9938 {
9939 string config_to_search = "CfgVehicles";
9940
9941 if (IsInherited(Weapon))
9942 config_to_search = "CfgWeapons";
9943
9944 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9945 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9946
9947 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9948 {
9949
9951
9953 {
9955 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9957 return;
9958 }
9959
9962
9963
9964
9966 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9967
9968 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9969 {
9970 string particle_class = "";
9972 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9974
9975 if (entry_type == CT_CLASS)
9976 {
9977 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9978 WPOOH_array.Insert(WPOF);
9979 }
9980 }
9981
9982
9984 }
9985 }
9986 }
9987
9989 {
9991 }
9992
9994 {
9996 {
9998
10001
10004
10005 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10006 }
10007 }
10008
10010 {
10012 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10013
10015 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10016
10018 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10019
10021 {
10023 }
10024 }
10025
10027 {
10029 }
10030
10032 {
10035 else
10037
10039 {
10042 }
10043 else
10044 {
10047
10050 }
10051
10053 }
10054
10056 {
10058 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10059 }
10060
10062 {
10064 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10066 }
10067
10069 {
10071 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10072 }
10073
10075 {
10078
10079 OverheatingParticle OP = new OverheatingParticle();
10084
10086 }
10087
10089 {
10092
10093 return -1;
10094 }
10095
10097 {
10099 {
10102
10103 for (int i = count; i > 0; --i)
10104 {
10105 int id = i - 1;
10108
10111
10112 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10113 {
10114 if (p)
10115 {
10118 }
10119 }
10120 }
10121 }
10122 }
10123
10125 {
10127 {
10129 {
10130 int id = i - 1;
10132
10133 if (OP)
10134 {
10136
10137 if (p)
10138 {
10140 }
10141
10142 delete OP;
10143 }
10144 }
10145
10148 }
10149 }
10150
10153 {
10154 return 0.0;
10155 }
10156
10157
10159 {
10160 return 250;
10161 }
10162
10164 {
10165 return 0;
10166 }
10167
10170 {
10172 return true;
10173
10174 return false;
10175 }
10176
10179 {
10182
10184 {
10186 }
10187 else
10188 {
10189
10191 }
10192
10194 }
10195
10202 {
10203 return -1;
10204 }
10205
10206
10207
10208
10210 {
10212 {
10214 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10215
10216 if (r_index >= 0)
10217 {
10218 InventoryLocation r_il = new InventoryLocation;
10219 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10220
10221 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10224 {
10225 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10226 }
10228 {
10229 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10230 }
10231
10232 }
10233
10234 player.GetHumanInventory().ClearUserReservedLocation(this);
10235 }
10236
10239 }
10240
10241
10242
10243
10245 {
10246 return ItemBase.m_DebugActionsMask;
10247 }
10248
10250 {
10251 return ItemBase.m_DebugActionsMask & mask;
10252 }
10253
10255 {
10256 ItemBase.m_DebugActionsMask = mask;
10257 }
10258
10260 {
10261 ItemBase.m_DebugActionsMask |= mask;
10262 }
10263
10265 {
10266 ItemBase.m_DebugActionsMask &= ~mask;
10267 }
10268
10270 {
10272 {
10274 }
10275 else
10276 {
10278 }
10279 }
10280
10281
10283 {
10284 if (GetEconomyProfile())
10285 {
10286 float q_max = GetEconomyProfile().GetQuantityMax();
10287 if (q_max > 0)
10288 {
10289 float q_min = GetEconomyProfile().GetQuantityMin();
10290 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10291
10293 {
10294 ComponentEnergyManager comp = GetCompEM();
10296 {
10298 }
10299 }
10301 {
10303
10304 }
10305
10306 }
10307 }
10308 }
10309
10312 {
10313 EntityAI parent = GetHierarchyParent();
10314
10315 if (parent)
10316 {
10317 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10318 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10319 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10320 }
10321 }
10322
10325 {
10326 EntityAI parent = GetHierarchyParent();
10327
10328 if (parent)
10329 {
10330 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10331 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10332 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10333 }
10334 }
10335
10337 {
10338
10339
10340
10341
10343
10345 {
10346 if (ScriptInputUserData.CanStoreInputUserData())
10347 {
10348 ScriptInputUserData ctx = new ScriptInputUserData;
10354 ctx.
Write(use_stack_max);
10357
10359 {
10360 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10361 }
10362 }
10363 }
10364 else if (!
GetGame().IsMultiplayer())
10365 {
10367 }
10368 }
10369
10371 {
10373 }
10374
10376 {
10378 }
10379
10381 {
10383 }
10384
10386 {
10387
10388 return false;
10389 }
10390
10392 {
10393 return false;
10394 }
10395
10399 {
10400 return false;
10401 }
10402
10404 {
10405 return "";
10406 }
10407
10409
10411 {
10412 return false;
10413 }
10414
10416 {
10417 return true;
10418 }
10419
10420
10421
10423 {
10424 return true;
10425 }
10426
10428 {
10429 return true;
10430 }
10431
10433 {
10434 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10436 }
10437
10439 {
10441 }
10442
10444 {
10446 if (!is_being_placed)
10448 SetSynchDirty();
10449 }
10450
10451
10453
10455 {
10457 }
10458
10460 {
10462 }
10463
10465 {
10466 return 1;
10467 }
10468
10470 {
10471 return false;
10472 }
10473
10475 {
10477 SetSynchDirty();
10478 }
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10515 {
10516 super.OnMovedInsideCargo(container);
10517
10518 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10519 }
10520
10521 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10522 {
10523 super.EEItemLocationChanged(oldLoc,newLoc);
10524
10525 PlayerBase new_player = null;
10526 PlayerBase old_player = null;
10527
10528 if (newLoc.GetParent())
10529 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10530
10531 if (oldLoc.GetParent())
10532 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10533
10535 {
10536 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10537
10538 if (r_index >= 0)
10539 {
10540 InventoryLocation r_il = new InventoryLocation;
10541 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10542
10543 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10546 {
10547 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10548 }
10550 {
10551 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10552 }
10553
10554 }
10555 }
10556
10558 {
10559 if (new_player)
10560 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10561
10562 if (new_player == old_player)
10563 {
10564
10565 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10566 {
10568 {
10569 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10570 {
10571 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10572 }
10573 }
10574 else
10575 {
10576 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10577 }
10578 }
10579
10580 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10581 {
10582 int type = oldLoc.GetType();
10584 {
10585 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10586 }
10588 {
10589 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10590 }
10591 }
10592 if (!m_OldLocation)
10593 {
10594 m_OldLocation = new InventoryLocation;
10595 }
10596 m_OldLocation.Copy(oldLoc);
10597 }
10598 else
10599 {
10600 if (m_OldLocation)
10601 {
10602 m_OldLocation.Reset();
10603 }
10604 }
10605
10607 }
10608 else
10609 {
10610 if (new_player)
10611 {
10612 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10613 if (res_index >= 0)
10614 {
10615 InventoryLocation il = new InventoryLocation;
10616 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10618 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10621 {
10622 il.
GetParent().GetOnReleaseLock().Invoke(it);
10623 }
10625 {
10627 }
10628
10629 }
10630 }
10632 {
10633
10635 }
10636
10637 if (m_OldLocation)
10638 {
10639 m_OldLocation.Reset();
10640 }
10641 }
10642 }
10643
10644 override void EOnContact(IEntity other, Contact extra)
10645 {
10647 {
10648 int liquidType = -1;
10650 if (impactSpeed > 0.0)
10651 {
10653 #ifndef SERVER
10655 #else
10657 SetSynchDirty();
10658 #endif
10660 }
10661 }
10662
10663 #ifdef SERVER
10664 if (GetCompEM() && GetCompEM().IsPlugged())
10665 {
10666 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10667 GetCompEM().UnplugThis();
10668 }
10669 #endif
10670 }
10671
10673
10675 {
10677 }
10678
10680 {
10681
10682 }
10683
10685 {
10686 super.OnItemLocationChanged(old_owner, new_owner);
10687
10688 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10689 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10690
10691 if (!relatedPlayer && playerNew)
10692 relatedPlayer = playerNew;
10693
10694 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10695 {
10697 if (actionMgr)
10698 {
10699 ActionBase currentAction = actionMgr.GetRunningAction();
10700 if (currentAction)
10702 }
10703 }
10704
10705 Man ownerPlayerOld = null;
10706 Man ownerPlayerNew = null;
10707
10708 if (old_owner)
10709 {
10710 if (old_owner.
IsMan())
10711 {
10712 ownerPlayerOld = Man.Cast(old_owner);
10713 }
10714 else
10715 {
10716 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10717 }
10718 }
10719 else
10720 {
10722 {
10724
10725 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10726 {
10727 GetCompEM().UnplugThis();
10728 }
10729 }
10730 }
10731
10732 if (new_owner)
10733 {
10734 if (new_owner.
IsMan())
10735 {
10736 ownerPlayerNew = Man.Cast(new_owner);
10737 }
10738 else
10739 {
10740 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10741 }
10742 }
10743
10744 if (ownerPlayerOld != ownerPlayerNew)
10745 {
10746 if (ownerPlayerOld)
10747 {
10748 array<EntityAI> subItemsExit = new array<EntityAI>;
10750 for (int i = 0; i < subItemsExit.Count(); i++)
10751 {
10754 }
10755 }
10756
10757 if (ownerPlayerNew)
10758 {
10759 array<EntityAI> subItemsEnter = new array<EntityAI>;
10761 for (int j = 0; j < subItemsEnter.Count(); j++)
10762 {
10765 }
10766 }
10767 }
10768 else if (ownerPlayerNew != null)
10769 {
10770 PlayerBase nplayer;
10771 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10772 {
10773 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10775 for (int k = 0; k < subItemsUpdate.Count(); k++)
10776 {
10778 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10779 }
10780 }
10781 }
10782
10783 if (old_owner)
10784 old_owner.OnChildItemRemoved(this);
10785 if (new_owner)
10786 new_owner.OnChildItemReceived(this);
10787 }
10788
10789
10791 {
10792 super.EEDelete(parent);
10793 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10794 if (player)
10795 {
10797
10798 if (player.IsAlive())
10799 {
10800 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10801 if (r_index >= 0)
10802 {
10803 InventoryLocation r_il = new InventoryLocation;
10804 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10805
10806 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10809 {
10810 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10811 }
10813 {
10814 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10815 }
10816
10817 }
10818
10819 player.RemoveQuickBarEntityShortcut(this);
10820 }
10821 }
10822 }
10823
10825 {
10826 super.EEKilled(killer);
10827
10830 {
10831 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10832 {
10833 if (IsMagazine())
10834 {
10835 if (Magazine.Cast(this).GetAmmoCount() > 0)
10836 {
10838 }
10839 }
10840 else
10841 {
10843 }
10844 }
10845 }
10846 }
10847
10849 {
10850 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10851
10852 super.OnWasAttached(parent, slot_id);
10853
10856
10858 }
10859
10861 {
10862 super.OnWasDetached(parent, slot_id);
10863
10866 }
10867
10869 {
10870 int idx;
10873
10874 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10875 if (inventory_slots.Count() < 1)
10876 {
10877 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10878 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10879 }
10880 else
10881 {
10882 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10883 }
10884
10885 idx = inventory_slots.Find(slot);
10886 if (idx < 0)
10887 return "";
10888
10889 return attach_types.Get(idx);
10890 }
10891
10893 {
10894 int idx = -1;
10895 string slot;
10896
10899
10900 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10901 if (inventory_slots.Count() < 1)
10902 {
10903 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10904 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10905 }
10906 else
10907 {
10908 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10909 if (detach_types.Count() < 1)
10910 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10911 }
10912
10913 for (int i = 0; i < inventory_slots.Count(); i++)
10914 {
10915 slot = inventory_slots.Get(i);
10916 }
10917
10918 if (slot != "")
10919 {
10920 if (detach_types.Count() == 1)
10921 idx = 0;
10922 else
10923 idx = inventory_slots.Find(slot);
10924 }
10925 if (idx < 0)
10926 return "";
10927
10928 return detach_types.Get(idx);
10929 }
10930
10932 {
10933
10935
10936
10937 float min_time = 1;
10938 float max_time = 3;
10939 float delay = Math.RandomFloat(min_time, max_time);
10940
10941 explode_timer.Run(delay, this, "DoAmmoExplosion");
10942 }
10943
10945 {
10946 Magazine magazine = Magazine.Cast(this);
10947 int pop_sounds_count = 6;
10948 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10949
10950
10951 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10952 string sound_name = pop_sounds[ sound_idx ];
10954
10955
10956 magazine.ServerAddAmmoCount(-1);
10957
10958
10959 float min_temp_to_explode = 100;
10960
10961 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10962 {
10964 }
10965 }
10966
10967
10968 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10969 {
10970 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10971
10972 const int CHANCE_DAMAGE_CARGO = 4;
10973 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10974 const int CHANCE_DAMAGE_NOTHING = 2;
10975
10977 {
10978 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10979 int chances;
10980 int rnd;
10981
10982 if (GetInventory().GetCargo())
10983 {
10984 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10985 rnd = Math.RandomInt(0,chances);
10986
10987 if (rnd < CHANCE_DAMAGE_CARGO)
10988 {
10990 }
10991 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10992 {
10994 }
10995 }
10996 else
10997 {
10998 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10999 rnd = Math.RandomInt(0,chances);
11000
11001 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11002 {
11004 }
11005 }
11006 }
11007 }
11008
11010 {
11011 if (GetInventory().GetCargo())
11012 {
11013 int item_count = GetInventory().GetCargo().GetItemCount();
11014 if (item_count > 0)
11015 {
11016 int random_pick = Math.RandomInt(0, item_count);
11018 if (!item.IsExplosive())
11019 {
11020 item.AddHealth("","",damage);
11021 return true;
11022 }
11023 }
11024 }
11025 return false;
11026 }
11027
11029 {
11030 int attachment_count = GetInventory().AttachmentCount();
11031 if (attachment_count > 0)
11032 {
11033 int random_pick = Math.RandomInt(0, attachment_count);
11034 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11035 if (!attachment.IsExplosive())
11036 {
11037 attachment.AddHealth("","",damage);
11038 return true;
11039 }
11040 }
11041 return false;
11042 }
11043
11045 {
11047 }
11048
11050 {
11052 return GetInventory().CanRemoveEntity();
11053
11054 return false;
11055 }
11056
11058 {
11059
11061 return false;
11062
11063
11065 return false;
11066
11067
11068
11070 if (delta == 0)
11071 return false;
11072
11073
11074 return true;
11075 }
11076
11078 {
11080 {
11081 if (ScriptInputUserData.CanStoreInputUserData())
11082 {
11083 ScriptInputUserData ctx = new ScriptInputUserData;
11088 ctx.
Write(destination_entity);
11090 ctx.
Write(slot_id);
11092 }
11093 }
11094 else if (!
GetGame().IsMultiplayer())
11095 {
11097 }
11098 }
11099
11101 {
11102 float split_quantity_new;
11106 InventoryLocation loc = new InventoryLocation;
11107
11108 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11109 {
11111 split_quantity_new = stack_max;
11112 else
11114
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,
false,
true);
11124 }
11125 }
11126 }
11127 else if (destination_entity && slot_id == -1)
11128 {
11129 if (quantity > stack_max)
11130 split_quantity_new = stack_max;
11131 else
11132 split_quantity_new = quantity;
11133
11135 {
11137 {
11140 }
11141
11142 if (new_item)
11143 {
11144 new_item.SetResultOfSplit(true);
11145 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11147 new_item.
SetQuantity(split_quantity_new,
false,
true);
11148 }
11149 }
11150 }
11151 else
11152 {
11153 if (stack_max != 0)
11154 {
11156 {
11158 }
11159
11160 if (split_quantity_new == 0)
11161 {
11162 if (!
GetGame().IsMultiplayer())
11163 player.PhysicalPredictiveDropItem(this);
11164 else
11165 player.ServerDropEntity(this);
11166 return;
11167 }
11168
11170 {
11172
11173 if (new_item)
11174 {
11175 new_item.SetResultOfSplit(true);
11176 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11179 new_item.PlaceOnSurface();
11180 }
11181 }
11182 }
11183 }
11184 }
11185
11187 {
11188 float split_quantity_new;
11192 InventoryLocation loc = new InventoryLocation;
11193
11194 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11195 {
11197 split_quantity_new = stack_max;
11198 else
11200
11202 {
11203 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11204 if (new_item)
11205 {
11206 new_item.SetResultOfSplit(true);
11207 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11209 new_item.
SetQuantity(split_quantity_new,
false,
true);
11210 }
11211 }
11212 }
11213 else if (destination_entity && slot_id == -1)
11214 {
11215 if (quantity > stack_max)
11216 split_quantity_new = stack_max;
11217 else
11218 split_quantity_new = quantity;
11219
11221 {
11223 {
11226 }
11227
11228 if (new_item)
11229 {
11230 new_item.SetResultOfSplit(true);
11231 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11233 new_item.
SetQuantity(split_quantity_new,
false,
true);
11234 }
11235 }
11236 }
11237 else
11238 {
11239 if (stack_max != 0)
11240 {
11242 {
11244 }
11245
11247 {
11249
11250 if (new_item)
11251 {
11252 new_item.SetResultOfSplit(true);
11253 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11256 new_item.PlaceOnSurface();
11257 }
11258 }
11259 }
11260 }
11261 }
11262
11264 {
11266 {
11267 if (ScriptInputUserData.CanStoreInputUserData())
11268 {
11269 ScriptInputUserData ctx = new ScriptInputUserData;
11274 dst.WriteToContext(ctx);
11276 }
11277 }
11278 else if (!
GetGame().IsMultiplayer())
11279 {
11281 }
11282 }
11283
11285 {
11287 {
11288 if (ScriptInputUserData.CanStoreInputUserData())
11289 {
11290 ScriptInputUserData ctx = new ScriptInputUserData;
11295 ctx.
Write(destination_entity);
11301 }
11302 }
11303 else if (!
GetGame().IsMultiplayer())
11304 {
11306 }
11307 }
11308
11310 {
11312 }
11313
11315 {
11317 float split_quantity_new;
11319 if (dst.IsValid())
11320 {
11321 int slot_id = dst.GetSlot();
11323
11324 if (quantity > stack_max)
11325 split_quantity_new = stack_max;
11326 else
11327 split_quantity_new = quantity;
11328
11330 {
11332
11333 if (new_item)
11334 {
11335 new_item.SetResultOfSplit(true);
11336 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11338 new_item.
SetQuantity(split_quantity_new,
false,
true);
11339 }
11340
11341 return new_item;
11342 }
11343 }
11344
11345 return null;
11346 }
11347
11349 {
11351 float split_quantity_new;
11353 if (destination_entity)
11354 {
11356 if (quantity > stackable)
11357 split_quantity_new = stackable;
11358 else
11359 split_quantity_new = quantity;
11360
11362 {
11363 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11364 if (new_item)
11365 {
11366 new_item.SetResultOfSplit(true);
11367 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11369 new_item.
SetQuantity(split_quantity_new,
false,
true);
11370 }
11371 }
11372 }
11373 }
11374
11376 {
11378 {
11379 if (ScriptInputUserData.CanStoreInputUserData())
11380 {
11381 ScriptInputUserData ctx = new ScriptInputUserData;
11386 ItemBase destination_entity =
this;
11387 ctx.
Write(destination_entity);
11391 }
11392 }
11393 else if (!
GetGame().IsMultiplayer())
11394 {
11396 }
11397 }
11398
11400 {
11402 float split_quantity_new;
11404 if (player)
11405 {
11407 if (quantity > stackable)
11408 split_quantity_new = stackable;
11409 else
11410 split_quantity_new = quantity;
11411
11413 {
11414 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11415 new_item =
ItemBase.Cast(in_hands);
11416 if (new_item)
11417 {
11418 new_item.SetResultOfSplit(true);
11419 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11421 new_item.SetQuantity(split_quantity_new, false, true);
11422 }
11423 }
11424 }
11425 }
11426
11428 {
11430 float split_quantity_new = Math.Floor(quantity * 0.5);
11431
11433 return;
11434
11436
11437 if (new_item)
11438 {
11439 if (new_item.GetQuantityMax() < split_quantity_new)
11440 {
11441 split_quantity_new = new_item.GetQuantityMax();
11442 }
11443
11444 new_item.SetResultOfSplit(true);
11445 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11446
11448 {
11451 }
11452 else
11453 {
11455 new_item.
SetQuantity(split_quantity_new,
false,
true);
11456 }
11457 }
11458 }
11459
11461 {
11463 float split_quantity_new = Math.Floor(quantity / 2);
11464
11466 return;
11467
11468 InventoryLocation invloc = new InventoryLocation;
11470
11472 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11473
11474 if (new_item)
11475 {
11476 if (new_item.GetQuantityMax() < split_quantity_new)
11477 {
11478 split_quantity_new = new_item.GetQuantityMax();
11479 }
11481 {
11484 }
11485 else if (split_quantity_new > 1)
11486 {
11488 new_item.
SetQuantity(split_quantity_new,
false,
true);
11489 }
11490 }
11491 }
11492
11495 {
11496 SetWeightDirty();
11498
11499 if (parent)
11500 parent.OnAttachmentQuantityChangedEx(this, delta);
11501
11503 {
11505 {
11507 }
11509 {
11510 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11512 }
11513 }
11514
11515 }
11516
11519 {
11520
11521 }
11522
11525 {
11527 }
11528
11530 {
11531 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11532
11534 {
11535 if (newLevel == GameConstants.STATE_RUINED)
11536 {
11538 EntityAI parent = GetHierarchyParent();
11539 if (parent && parent.IsFireplace())
11540 {
11541 CargoBase cargo = GetInventory().GetCargo();
11542 if (cargo)
11543 {
11545 {
11547 }
11548 }
11549 }
11550 }
11551
11553 {
11554
11556 return;
11557 }
11558
11559 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11560 {
11562 }
11563 }
11564 }
11565
11566
11568 {
11569 super.OnRightClick();
11570
11572 {
11574 {
11575 if (ScriptInputUserData.CanStoreInputUserData())
11576 {
11577 EntityAI root = GetHierarchyRoot();
11578 Man playerOwner = GetHierarchyRootPlayer();
11579 InventoryLocation dst = new InventoryLocation;
11580
11581
11582 if (!playerOwner && root && root == this)
11583 {
11585 }
11586 else
11587 {
11588
11589 GetInventory().GetCurrentInventoryLocation(dst);
11591 {
11594 {
11596 }
11597 else
11598 {
11600
11601
11602 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11603 {
11605 }
11606 else
11607 {
11608 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11609 }
11610 }
11611 }
11612 }
11613
11614 ScriptInputUserData ctx = new ScriptInputUserData;
11622 }
11623 }
11624 else if (!
GetGame().IsMultiplayer())
11625 {
11627 }
11628 }
11629 }
11630
11632 {
11633 if (root)
11634 {
11635 vector m4[4];
11636 root.GetTransform(m4);
11637 dst.SetGround(this, m4);
11638 }
11639 else
11640 {
11641 GetInventory().GetCurrentInventoryLocation(dst);
11642 }
11643 }
11644
11645 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11646 {
11647
11648 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11649 return false;
11650
11651 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11652 return false;
11653
11654
11656 return false;
11657
11658
11659 Magazine mag = Magazine.Cast(this);
11660 if (mag)
11661 {
11662 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11663 return false;
11664
11665 if (stack_max_limit)
11666 {
11667 Magazine other_mag = Magazine.Cast(other_item);
11668 if (other_item)
11669 {
11670 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11671 return false;
11672 }
11673
11674 }
11675 }
11676 else
11677 {
11678
11680 return false;
11681
11683 return false;
11684 }
11685
11686 PlayerBase player = null;
11687 if (CastTo(player, GetHierarchyRootPlayer()))
11688 {
11689 if (player.GetInventory().HasAttachment(this))
11690 return false;
11691
11692 if (player.IsItemsToDelete())
11693 return false;
11694 }
11695
11696 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11697 return false;
11698
11699 int slotID;
11701 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11702 return false;
11703
11704 return true;
11705 }
11706
11708 {
11710 }
11711
11713 {
11714 return m_IsResultOfSplit;
11715 }
11716
11718 {
11719 m_IsResultOfSplit = value;
11720 }
11721
11723 {
11725 }
11726
11728 {
11729 float other_item_quantity = other_item.GetQuantity();
11730 float this_free_space;
11731
11733
11735
11736 if (other_item_quantity > this_free_space)
11737 {
11738 return this_free_space;
11739 }
11740 else
11741 {
11742 return other_item_quantity;
11743 }
11744 }
11745
11747 {
11749 }
11750
11752 {
11754 return;
11755
11756 if (!IsMagazine() && other_item)
11757 {
11759 if (quantity_used != 0)
11760 {
11761 float hp1 = GetHealth01("","");
11762 float hp2 = other_item.GetHealth01("","");
11763 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11764 hpResult = hpResult / (
GetQuantity() + quantity_used);
11765
11766 hpResult *= GetMaxHealth();
11767 Math.Round(hpResult);
11768 SetHealth("", "Health", hpResult);
11769
11771 other_item.AddQuantity(-quantity_used);
11772 }
11773 }
11775 }
11776
11778 {
11779 #ifdef SERVER
11780 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11781 GetHierarchyParent().IncreaseLifetimeUp();
11782 #endif
11783 };
11784
11786 {
11787 PlayerBase p = PlayerBase.Cast(player);
11788
11789 array<int> recipesIds = p.m_Recipes;
11790 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11791 if (moduleRecipesManager)
11792 {
11793 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11794 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11795 }
11796
11797 for (int i = 0;i < recipesIds.Count(); i++)
11798 {
11799 int key = recipesIds.Get(i);
11800 string recipeName = moduleRecipesManager.GetRecipeName(key);
11802 }
11803 }
11804
11805
11806 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11807 {
11808 super.GetDebugActions(outputList);
11809
11810
11816
11817
11822
11827
11828
11832
11833
11835 {
11839 }
11840
11843
11844
11848
11850
11851 InventoryLocation loc = new InventoryLocation();
11852 GetInventory().GetCurrentInventoryLocation(loc);
11854 {
11855 if (Gizmo_IsSupported())
11858 }
11859
11861 }
11862
11863
11864
11865
11867 {
11868 super.OnAction(action_id, player, ctx);
11869
11871 {
11872 switch (action_id)
11873 {
11876 return true;
11879 return true;
11880 }
11881 }
11882
11884 {
11885 switch (action_id)
11886 {
11888 Delete();
11889 return true;
11890 }
11891 }
11892
11893 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11894 {
11895 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11896 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11897 PlayerBase p = PlayerBase.Cast(player);
11898 if (
EActions.RECIPES_RANGE_START < 1000)
11899 {
11900 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11901 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11902 }
11903 }
11904 #ifndef SERVER
11905 else if (action_id ==
EActions.WATCH_PLAYER)
11906 {
11907 PluginDeveloper.SetDeveloperItemClientEx(player);
11908 }
11909 #endif
11911 {
11912 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11913 {
11914 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11915 OnDebugButtonPressServer(id + 1);
11916 }
11917
11918 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11919 {
11920 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11922 }
11923
11924 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11925 {
11926 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11928 }
11929
11930 else if (action_id ==
EActions.ADD_QUANTITY)
11931 {
11932 if (IsMagazine())
11933 {
11934 Magazine mag = Magazine.Cast(this);
11935 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11936 }
11937 else
11938 {
11940 }
11941
11942 if (m_EM)
11943 {
11944 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11945 }
11946
11947 }
11948
11949 else if (action_id ==
EActions.REMOVE_QUANTITY)
11950 {
11951 if (IsMagazine())
11952 {
11953 Magazine mag2 = Magazine.Cast(this);
11954 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11955 }
11956 else
11957 {
11959 }
11960 if (m_EM)
11961 {
11962 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11963 }
11964
11965 }
11966
11967 else if (action_id ==
EActions.SET_QUANTITY_0)
11968 {
11970
11971 if (m_EM)
11972 {
11973 m_EM.SetEnergy(0);
11974 }
11975 }
11976
11977 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11978 {
11980
11981 if (m_EM)
11982 {
11983 m_EM.SetEnergy(m_EM.GetEnergyMax());
11984 }
11985 }
11986
11987 else if (action_id ==
EActions.ADD_HEALTH)
11988 {
11989 AddHealth("","",GetMaxHealth("","Health")/5);
11990 }
11991 else if (action_id ==
EActions.REMOVE_HEALTH)
11992 {
11993 AddHealth("","",-GetMaxHealth("","Health")/5);
11994 }
11995 else if (action_id ==
EActions.DESTROY_HEALTH)
11996 {
11997 SetHealth01("","",0);
11998 }
11999 else if (action_id ==
EActions.WATCH_ITEM)
12000 {
12002 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12003 #ifdef DEVELOPER
12004 SetDebugDeveloper_item(this);
12005 #endif
12006 }
12007
12008 else if (action_id ==
EActions.ADD_TEMPERATURE)
12009 {
12010 AddTemperature(20);
12011
12012 }
12013
12014 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12015 {
12016 AddTemperature(-20);
12017
12018 }
12019
12020 else if (action_id ==
EActions.FLIP_FROZEN)
12021 {
12022 SetFrozen(!GetIsFrozen());
12023
12024 }
12025
12026 else if (action_id ==
EActions.ADD_WETNESS)
12027 {
12029
12030 }
12031
12032 else if (action_id ==
EActions.REMOVE_WETNESS)
12033 {
12035
12036 }
12037
12038 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12039 {
12042
12043
12044 }
12045
12046 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12047 {
12050 }
12051
12052 else if (action_id ==
EActions.MAKE_SPECIAL)
12053 {
12054 auto debugParams = DebugSpawnParams.WithPlayer(player);
12055 OnDebugSpawnEx(debugParams);
12056 }
12057
12058 }
12059
12060
12061 return false;
12062 }
12063
12064
12065
12066
12070
12073
12074
12075
12077 {
12078 return false;
12079 }
12080
12081
12083 {
12084 return true;
12085 }
12086
12087
12089 {
12090 return true;
12091 }
12092
12093
12094
12096 {
12097 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12099 }
12100
12103 {
12104 return null;
12105 }
12106
12108 {
12109 return false;
12110 }
12111
12113 {
12114 return false;
12115 }
12116
12120
12121
12123 {
12124 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12125 return module_repairing.CanRepair(this, item_repair_kit);
12126 }
12127
12128
12129 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12130 {
12131 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12132 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12133 }
12134
12135
12137 {
12138
12139
12140
12141
12142
12143
12144
12145
12146 return 1;
12147 }
12148
12149
12150
12152 {
12154 }
12155
12156
12157
12159 {
12161 }
12162
12163
12172 {
12173 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12174
12175 if (player)
12176 {
12177 player.MessageStatus(text);
12178 }
12179 }
12180
12181
12190 {
12191 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12192
12193 if (player)
12194 {
12195 player.MessageAction(text);
12196 }
12197 }
12198
12199
12208 {
12209 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12210
12211 if (player)
12212 {
12213 player.MessageFriendly(text);
12214 }
12215 }
12216
12217
12226 {
12227 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12228
12229 if (player)
12230 {
12231 player.MessageImportant(text);
12232 }
12233 }
12234
12236 {
12237 return true;
12238 }
12239
12240
12241 override bool KindOf(
string tag)
12242 {
12243 bool found = false;
12244 string item_name = this.
GetType();
12247
12248 int array_size = item_tag_array.Count();
12249 for (int i = 0; i < array_size; i++)
12250 {
12251 if (item_tag_array.Get(i) == tag)
12252 {
12253 found = true;
12254 break;
12255 }
12256 }
12257 return found;
12258 }
12259
12260
12262 {
12263
12264 super.OnRPC(sender, rpc_type,ctx);
12265
12266
12267 switch (rpc_type)
12268 {
12269 #ifndef SERVER
12270 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12271 Param2<bool, string> p = new Param2<bool, string>(false, "");
12272
12274 return;
12275
12276 bool play = p.param1;
12277 string soundSet = p.param2;
12278
12279 if (play)
12280 {
12282 {
12284 {
12286 }
12287 }
12288 else
12289 {
12291 }
12292 }
12293 else
12294 {
12296 }
12297
12298 break;
12299 #endif
12300
12301 }
12302
12304 {
12306 }
12307 }
12308
12309
12310
12311
12313 {
12314 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12315 return plugin.GetID(
name);
12316 }
12317
12319 {
12320 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12321 return plugin.GetName(id);
12322 }
12323
12326 {
12327
12328
12329 int varFlags;
12330 if (!ctx.
Read(varFlags))
12331 return;
12332
12333 if (varFlags & ItemVariableFlags.FLOAT)
12334 {
12336 }
12337 }
12338
12340 {
12341
12342 super.SerializeNumericalVars(floats_out);
12343
12344
12345
12347 {
12349 }
12350
12352 {
12354 }
12355
12357 {
12359 }
12360
12362 {
12367 }
12368
12370 {
12372 }
12373 }
12374
12376 {
12377
12378 super.DeSerializeNumericalVars(floats);
12379
12380
12381 int index = 0;
12382 int mask = Math.Round(floats.Get(index));
12383
12384 index++;
12385
12387 {
12389 {
12391 }
12392 else
12393 {
12394 float quantity = floats.Get(index);
12395 SetQuantity(quantity,
true,
false,
false,
false);
12396 }
12397 index++;
12398 }
12399
12401 {
12402 float wet = floats.Get(index);
12404 index++;
12405 }
12406
12408 {
12409 int liquidtype = Math.Round(floats.Get(index));
12411 index++;
12412 }
12413
12415 {
12417 index++;
12419 index++;
12421 index++;
12423 index++;
12424 }
12425
12427 {
12428 int cleanness = Math.Round(floats.Get(index));
12430 index++;
12431 }
12432 }
12433
12435 {
12436 super.WriteVarsToCTX(ctx);
12437
12438
12440 {
12442 }
12443
12445 {
12447 }
12448
12450 {
12452 }
12453
12455 {
12456 int r,g,b,a;
12462 }
12463
12465 {
12467 }
12468 }
12469
12471 {
12472 if (!super.ReadVarsFromCTX(ctx,version))
12473 return false;
12474
12475 int intValue;
12476 float value;
12477
12478 if (version < 140)
12479 {
12480 if (!ctx.
Read(intValue))
12481 return false;
12482
12483 m_VariablesMask = intValue;
12484 }
12485
12487 {
12488 if (!ctx.
Read(value))
12489 return false;
12490
12492 {
12494 }
12495 else
12496 {
12498 }
12499 }
12500
12501 if (version < 140)
12502 {
12504 {
12505 if (!ctx.
Read(value))
12506 return false;
12507 SetTemperatureDirect(value);
12508 }
12509 }
12510
12512 {
12513 if (!ctx.
Read(value))
12514 return false;
12516 }
12517
12519 {
12520 if (!ctx.
Read(intValue))
12521 return false;
12523 }
12524
12526 {
12527 int r,g,b,a;
12529 return false;
12531 return false;
12533 return false;
12535 return false;
12536
12538 }
12539
12541 {
12542 if (!ctx.
Read(intValue))
12543 return false;
12545 }
12546
12547 if (version >= 138 && version < 140)
12548 {
12550 {
12551 if (!ctx.
Read(intValue))
12552 return false;
12553 SetFrozen(intValue);
12554 }
12555 }
12556
12557 return true;
12558 }
12559
12560
12562 {
12565 {
12567 }
12568
12569 if (!super.OnStoreLoad(ctx, version))
12570 {
12572 return false;
12573 }
12574
12575 if (version >= 114)
12576 {
12577 bool hasQuickBarIndexSaved;
12578
12579 if (!ctx.
Read(hasQuickBarIndexSaved))
12580 {
12582 return false;
12583 }
12584
12585 if (hasQuickBarIndexSaved)
12586 {
12587 int itmQBIndex;
12588
12589
12590 if (!ctx.
Read(itmQBIndex))
12591 {
12593 return false;
12594 }
12595
12596 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12597 if (itmQBIndex != -1 && parentPlayer)
12598 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12599 }
12600 }
12601 else
12602 {
12603
12604 PlayerBase player;
12605 int itemQBIndex;
12606 if (version ==
int.
MAX)
12607 {
12608 if (!ctx.
Read(itemQBIndex))
12609 {
12611 return false;
12612 }
12613 }
12614 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12615 {
12616
12617 if (!ctx.
Read(itemQBIndex))
12618 {
12620 return false;
12621 }
12622 if (itemQBIndex != -1 && player)
12623 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12624 }
12625 }
12626
12627 if (version < 140)
12628 {
12629
12630 if (!LoadVariables(ctx, version))
12631 {
12633 return false;
12634 }
12635 }
12636
12637
12639 {
12641 return false;
12642 }
12643 if (version >= 132)
12644 {
12646 if (raib)
12647 {
12649 {
12651 return false;
12652 }
12653 }
12654 }
12655
12657 return true;
12658 }
12659
12660
12661
12663 {
12664 super.OnStoreSave(ctx);
12665
12666 PlayerBase player;
12667 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12668 {
12670
12671 int itemQBIndex = -1;
12672 itemQBIndex = player.FindQuickBarEntityIndex(this);
12673 ctx.
Write(itemQBIndex);
12674 }
12675 else
12676 {
12678 }
12679
12681
12683 if (raib)
12684 {
12686 }
12687 }
12688
12689
12691 {
12692 super.AfterStoreLoad();
12693
12695 {
12697 }
12698
12700 {
12703 }
12704 }
12705
12707 {
12708 super.EEOnAfterLoad();
12709
12711 {
12713 }
12714
12717 }
12718
12720 {
12721 return false;
12722 }
12723
12724
12725
12727 {
12729 {
12730 #ifdef PLATFORM_CONSOLE
12731
12733 {
12735 if (menu)
12736 {
12738 }
12739 }
12740 #endif
12741 }
12742
12744 {
12747 }
12748
12750 {
12751 SetWeightDirty();
12753 }
12755 {
12758 }
12759
12761 {
12764 }
12766 {
12769 }
12770
12771 super.OnVariablesSynchronized();
12772 }
12773
12774
12775
12777 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12778 {
12779 if (!IsServerCheck(allow_client))
12780 return false;
12781
12783 return false;
12784
12787
12788 if (value <= (min + 0.001))
12789 value = min;
12790
12791 if (value == min)
12792 {
12793 if (destroy_config)
12794 {
12795 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12796 if (dstr)
12797 {
12799 this.Delete();
12800 return true;
12801 }
12802 }
12803 else if (destroy_forced)
12804 {
12806 this.Delete();
12807 return true;
12808 }
12809
12811 }
12812
12815
12817 {
12819
12820 if (delta)
12822 }
12823
12825
12826 return false;
12827 }
12828
12829
12831 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12832 {
12834 }
12835
12837 {
12840 }
12841
12843 {
12846 }
12847
12849 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12850 {
12851 float value_clamped = Math.Clamp(value, 0, 1);
12853 SetQuantity(result, destroy_config, destroy_forced);
12854 }
12855
12856
12859 {
12861 }
12862
12864 {
12866 }
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12878 {
12879 int slot = -1;
12880 if (GetInventory())
12881 {
12882 InventoryLocation il = new InventoryLocation;
12883 GetInventory().GetCurrentInventoryLocation(il);
12885 }
12886
12888 }
12889
12891 {
12892 float quantity_max = 0;
12893
12895 {
12896 if (attSlotID != -1)
12897 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12898
12899 if (quantity_max <= 0)
12901 }
12902
12903 if (quantity_max <= 0)
12905
12906 return quantity_max;
12907 }
12908
12910 {
12912 }
12913
12915 {
12917 }
12918
12919
12921 {
12923 }
12924
12926 {
12928 }
12929
12931 {
12933 }
12934
12935
12937 {
12938
12939 float weightEx = GetWeightEx();
12940 float special = GetInventoryAndCargoWeight();
12941 return weightEx - special;
12942 }
12943
12944
12946 {
12948 }
12949
12951 {
12953 {
12954 #ifdef DEVELOPER
12955 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12956 {
12957 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12959 }
12960 #endif
12961
12962 return GetQuantity() * GetConfigWeightModified();
12963 }
12964 else if (HasEnergyManager())
12965 {
12966 #ifdef DEVELOPER
12967 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12968 {
12969 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12970 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12971 }
12972 #endif
12973 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12974 }
12975 else
12976 {
12977 #ifdef DEVELOPER
12978 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12979 {
12980 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12981 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12982 }
12983 #endif
12984 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12985 }
12986 }
12987
12990 {
12991 int item_count = 0;
12993
12994 if (GetInventory().GetCargo() != NULL)
12995 {
12996 item_count = GetInventory().GetCargo().GetItemCount();
12997 }
12998
12999 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13000 {
13001 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13002 if (item)
13003 item_count += item.GetNumberOfItems();
13004 }
13005 return item_count;
13006 }
13007
13010 {
13011 float weight = 0;
13012 float wetness = 1;
13013 if (include_wetness)
13016 {
13017 weight = wetness * m_ConfigWeight;
13018 }
13020 {
13021 weight = 1;
13022 }
13023 return weight;
13024 }
13025
13026
13027
13029 {
13030 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13031 {
13032 GameInventory inv = GetInventory();
13033 array<EntityAI> items = new array<EntityAI>;
13035 for (int i = 0; i < items.Count(); i++)
13036 {
13038 if (item)
13039 {
13041 }
13042 }
13043 }
13044 }
13045
13046
13047
13048
13050 {
13051 float energy = 0;
13052 if (HasEnergyManager())
13053 {
13054 energy = GetCompEM().GetEnergy();
13055 }
13056 return energy;
13057 }
13058
13059
13061 {
13062 super.OnEnergyConsumed();
13063
13065 }
13066
13068 {
13069 super.OnEnergyAdded();
13070
13072 }
13073
13074
13076 {
13077 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13078 {
13080 {
13081 float energy_0to1 = GetCompEM().GetEnergy0To1();
13083 }
13084 }
13085 }
13086
13087
13089 {
13090 return ConfigGetFloat("heatIsolation");
13091 }
13092
13094 {
13096 }
13097
13099 {
13100 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13101 if (
GetGame().ConfigIsExisting(paramPath))
13103
13104 return 0.0;
13105 }
13106
13108 {
13109 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13110 if (
GetGame().ConfigIsExisting(paramPath))
13112
13113 return 0.0;
13114 }
13115
13116 override void SetWet(
float value,
bool allow_client =
false)
13117 {
13118 if (!IsServerCheck(allow_client))
13119 return;
13120
13123
13125
13126 m_VarWet = Math.Clamp(value, min, max);
13127
13129 {
13132 }
13133 }
13134
13135 override void AddWet(
float value)
13136 {
13138 }
13139
13141 {
13143 }
13144
13146 {
13148 }
13149
13151 {
13153 }
13154
13156 {
13158 }
13159
13161 {
13163 }
13164
13165 override void OnWetChanged(
float newVal,
float oldVal)
13166 {
13169 if (newLevel != oldLevel)
13170 {
13172 }
13173 }
13174
13176 {
13177 SetWeightDirty();
13178 }
13179
13181 {
13182 return GetWetLevelInternal(
m_VarWet);
13183 }
13184
13185
13186
13188 {
13190 }
13191
13193 {
13195 }
13196
13198 {
13200 }
13201
13203 {
13205 }
13206
13207
13208
13210 {
13211 if (ConfigIsExisting("itemModelLength"))
13212 {
13213 return ConfigGetFloat("itemModelLength");
13214 }
13215 return 0;
13216 }
13217
13219 {
13220 if (ConfigIsExisting("itemAttachOffset"))
13221 {
13222 return ConfigGetFloat("itemAttachOffset");
13223 }
13224 return 0;
13225 }
13226
13227 override void SetCleanness(
int value,
bool allow_client =
false)
13228 {
13229 if (!IsServerCheck(allow_client))
13230 return;
13231
13233
13235
13238 }
13239
13241 {
13243 }
13244
13246 {
13247 return true;
13248 }
13249
13250
13251
13252
13254 {
13256 }
13257
13259 {
13261 }
13262
13263
13264
13265
13266 override void SetColor(
int r,
int g,
int b,
int a)
13267 {
13273 }
13275 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13276 {
13281 }
13282
13284 {
13286 }
13287
13290 {
13291 int r,g,b,a;
13293 r = r/255;
13294 g = g/255;
13295 b = b/255;
13296 a = a/255;
13297 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13298 }
13299
13300
13301
13302 override void SetLiquidType(
int value,
bool allow_client =
false)
13303 {
13304 if (!IsServerCheck(allow_client))
13305 return;
13306
13311 }
13312
13314 {
13315 return ConfigGetInt("varLiquidTypeInit");
13316 }
13317
13319 {
13321 }
13322
13324 {
13326 SetFrozen(false);
13327 }
13328
13331 {
13332 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13333 }
13334
13335
13338 {
13339 PlayerBase nplayer;
13340 if (PlayerBase.CastTo(nplayer, player))
13341 {
13343
13344 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13345 }
13346 }
13347
13348
13351 {
13352 PlayerBase nplayer;
13353 if (PlayerBase.CastTo(nplayer,player))
13354 {
13355
13356 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13357
13358 }
13359
13360
13361 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13362
13363
13364 if (HasEnergyManager())
13365 {
13366 GetCompEM().UpdatePlugState();
13367 }
13368 }
13369
13370
13372 {
13373 super.OnPlacementStarted(player);
13374
13376 }
13377
13378 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13379 {
13381 {
13382 m_AdminLog.OnPlacementComplete(player,
this);
13383 }
13384
13385 super.OnPlacementComplete(player, position, orientation);
13386 }
13387
13388
13389
13390
13391
13393 {
13395 {
13396 return true;
13397 }
13398 else
13399 {
13400 return false;
13401 }
13402 }
13403
13404
13406 {
13408 {
13410 }
13411 }
13412
13413
13415 {
13417 }
13418
13420 {
13422 }
13423
13424 override void InsertAgent(
int agent,
float count = 1)
13425 {
13426 if (count < 1)
13427 return;
13428
13430 }
13431
13434 {
13436 }
13437
13438
13440 {
13442 }
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13486 {
13488 return false;
13489 return true;
13490 }
13491
13493 {
13494
13496 }
13497
13498
13501 {
13502 super.CheckForRoofLimited(timeTresholdMS);
13503
13505 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13506 {
13507 m_PreviousRoofTestTime = time;
13508 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13509 }
13510 }
13511
13512
13514 {
13516 {
13517 return 0;
13518 }
13519
13520 if (GetInventory().GetAttachmentSlotsCount() != 0)
13521 {
13522 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13523 if (filter)
13524 return filter.GetProtectionLevel(type, false, system);
13525 else
13526 return 0;
13527 }
13528
13529 string subclassPath, entryName;
13530
13531 switch (type)
13532 {
13534 entryName = "biological";
13535 break;
13537 entryName = "chemical";
13538 break;
13539 default:
13540 entryName = "biological";
13541 break;
13542 }
13543
13544 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13545
13547 }
13548
13549
13550
13553 {
13554 if (!IsMagazine())
13556
13558 }
13559
13560
13561
13562
13563
13568 {
13569 return true;
13570 }
13571
13573 {
13575 }
13576
13577
13578
13579
13580
13582 {
13583 if (parent)
13584 {
13585 if (parent.IsInherited(DayZInfected))
13586 return true;
13587
13588 if (!parent.IsRuined())
13589 return true;
13590 }
13591
13592 return true;
13593 }
13594
13596 {
13597 if (!super.CanPutAsAttachment(parent))
13598 {
13599 return false;
13600 }
13601
13602 if (!IsRuined() && !parent.IsRuined())
13603 {
13604 return true;
13605 }
13606
13607 return false;
13608 }
13609
13611 {
13612
13613
13614
13615
13616 return super.CanReceiveItemIntoCargo(item);
13617 }
13618
13620 {
13621
13622
13623
13624
13625 GameInventory attachmentInv = attachment.GetInventory();
13627 {
13628 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13629 return false;
13630 }
13631
13632 InventoryLocation loc = new InventoryLocation();
13633 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13634 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13635 return false;
13636
13637 return super.CanReceiveAttachment(attachment, slotId);
13638 }
13639
13641 {
13642 if (!super.CanReleaseAttachment(attachment))
13643 return false;
13644
13645 return GetInventory().AreChildrenAccessible();
13646 }
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13669 {
13670 int id = muzzle_owner.GetMuzzleID();
13671 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13672
13673 if (WPOF_array)
13674 {
13675 for (int i = 0; i < WPOF_array.Count(); i++)
13676 {
13677 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13678
13679 if (WPOF)
13680 {
13681 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13682 }
13683 }
13684 }
13685 }
13686
13687
13689 {
13690 int id = muzzle_owner.GetMuzzleID();
13692
13693 if (WPOBE_array)
13694 {
13695 for (int i = 0; i < WPOBE_array.Count(); i++)
13696 {
13697 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13698
13699 if (WPOBE)
13700 {
13701 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13702 }
13703 }
13704 }
13705 }
13706
13707
13709 {
13710 int id = muzzle_owner.GetMuzzleID();
13711 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13712
13713 if (WPOOH_array)
13714 {
13715 for (int i = 0; i < WPOOH_array.Count(); i++)
13716 {
13717 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13718
13719 if (WPOOH)
13720 {
13721 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13722 }
13723 }
13724 }
13725 }
13726
13727
13729 {
13730 int id = muzzle_owner.GetMuzzleID();
13731 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13732
13733 if (WPOOH_array)
13734 {
13735 for (int i = 0; i < WPOOH_array.Count(); i++)
13736 {
13737 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13738
13739 if (WPOOH)
13740 {
13741 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13742 }
13743 }
13744 }
13745 }
13746
13747
13749 {
13750 int id = muzzle_owner.GetMuzzleID();
13751 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13752
13753 if (WPOOH_array)
13754 {
13755 for (int i = 0; i < WPOOH_array.Count(); i++)
13756 {
13757 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13758
13759 if (WPOOH)
13760 {
13761 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13762 }
13763 }
13764 }
13765 }
13766
13767
13768
13770 {
13772 {
13773 return true;
13774 }
13775
13776 return false;
13777 }
13778
13780 {
13782 {
13783 return true;
13784 }
13785
13786 return false;
13787 }
13788
13790 {
13792 {
13793 return true;
13794 }
13795
13796 return false;
13797 }
13798
13800 {
13801 return false;
13802 }
13803
13806 {
13807 return UATimeSpent.DEFAULT_DEPLOY;
13808 }
13809
13810
13811
13812
13814 {
13816 SetSynchDirty();
13817 }
13818
13820 {
13822 }
13823
13824
13826 {
13827 return false;
13828 }
13829
13832 {
13833 string att_type = "None";
13834
13835 if (ConfigIsExisting("soundAttType"))
13836 {
13837 att_type = ConfigGetString("soundAttType");
13838 }
13839
13841 }
13842
13844 {
13846 }
13847
13848
13849
13850
13851
13857
13859 {
13862
13864 }
13865
13866
13868 {
13870 return;
13871
13873
13876
13879
13880 SoundParameters params = new SoundParameters();
13884 }
13885
13886
13888 {
13890 return;
13891
13893 SetSynchDirty();
13894
13897 }
13898
13899
13901 {
13903 return;
13904
13906 SetSynchDirty();
13907
13910 }
13911
13913 {
13915 }
13916
13918 {
13920 }
13921
13924 {
13925 if (!
GetGame().IsDedicatedServer())
13926 {
13927 if (ConfigIsExisting("attachSoundSet"))
13928 {
13929 string cfg_path = "";
13930 string soundset = "";
13931 string type_name =
GetType();
13932
13935 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13936 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13937
13938 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13939 {
13940 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13941 {
13942 if (cfg_slot_array[i] == slot_type)
13943 {
13944 soundset = cfg_soundset_array[i];
13945 break;
13946 }
13947 }
13948 }
13949
13950 if (soundset != "")
13951 {
13952 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13954 }
13955 }
13956 }
13957 }
13958
13960 {
13961
13962 }
13963
13964 void OnApply(PlayerBase player);
13965
13967 {
13968 return 1.0;
13969 };
13970
13972 {
13974 }
13975
13977 {
13979 }
13980
13982
13984 {
13985 SetDynamicPhysicsLifeTime(0.01);
13987 }
13988
13990 {
13991 array<string> zone_names = new array<string>;
13992 GetDamageZones(zone_names);
13993 for (int i = 0; i < zone_names.Count(); i++)
13994 {
13995 SetHealthMax(zone_names.Get(i),"Health");
13996 }
13997 SetHealthMax("","Health");
13998 }
13999
14002 {
14003 float global_health = GetHealth01("","Health");
14004 array<string> zones = new array<string>;
14005 GetDamageZones(zones);
14006
14007 for (int i = 0; i < zones.Count(); i++)
14008 {
14009 SetHealth01(zones.Get(i),"Health",global_health);
14010 }
14011 }
14012
14015 {
14016 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14017 }
14018
14020 {
14021 if (!hasRootAsPlayer)
14022 {
14023 if (refParentIB)
14024 {
14025
14026 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14027 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14028
14029 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14030 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14031
14034 }
14035 else
14036 {
14037
14040 }
14041 }
14042 }
14043
14045 {
14047 {
14048 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14049 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14050 {
14051 float heatPermCoef = 1.0;
14053 while (ent)
14054 {
14055 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14056 ent = ent.GetHierarchyParent();
14057 }
14058
14059 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14060 }
14061 }
14062 }
14063
14065 {
14066
14067 EntityAI parent = GetHierarchyParent();
14068 if (!parent)
14069 {
14070 hasParent = false;
14071 hasRootAsPlayer = false;
14072 }
14073 else
14074 {
14075 hasParent = true;
14076 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14077 refParentIB =
ItemBase.Cast(parent);
14078 }
14079 }
14080
14081 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14082 {
14083
14084 }
14085
14087 {
14088
14089 return false;
14090 }
14091
14093 {
14094
14095
14096 return false;
14097 }
14098
14100 {
14101
14102 return false;
14103 }
14104
14107 {
14108 return !GetIsFrozen() &&
IsOpen();
14109 }
14110
14112 {
14113 bool hasParent = false, hasRootAsPlayer = false;
14115
14116 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14117 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14118
14119 if (wwtu || foodDecay)
14120 {
14124
14125 if (processWetness || processTemperature || processDecay)
14126 {
14128
14129 if (processWetness)
14130 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14131
14132 if (processTemperature)
14134
14135 if (processDecay)
14136 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14137 }
14138 }
14139 }
14140
14143 {
14145 }
14146
14148 {
14151
14152 return super.GetTemperatureFreezeThreshold();
14153 }
14154
14156 {
14159
14160 return super.GetTemperatureThawThreshold();
14161 }
14162
14164 {
14167
14168 return super.GetItemOverheatThreshold();
14169 }
14170
14172 {
14174 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14175
14176 return super.GetTemperatureFreezeTime();
14177 }
14178
14180 {
14182 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14183
14184 return super.GetTemperatureThawTime();
14185 }
14186
14191
14193 {
14194 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14195 }
14196
14198 {
14199 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14200 }
14201
14204 {
14206 }
14207
14209 {
14211 }
14212
14214 {
14216 }
14217
14220 {
14221 return null;
14222 }
14223
14226 {
14227 return false;
14228 }
14229
14231 {
14233 {
14236 if (!trg)
14237 {
14239 explosive = this;
14240 }
14241
14242 explosive.PairRemote(trg);
14244
14245 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14246 trg.SetPersistentPairID(persistentID);
14247 explosive.SetPersistentPairID(persistentID);
14248
14249 return true;
14250 }
14251 return false;
14252 }
14253
14256 {
14257 float ret = 1.0;
14260 ret *= GetHealth01();
14261
14262 return ret;
14263 }
14264
14265 #ifdef DEVELOPER
14266 override void SetDebugItem()
14267 {
14268 super.SetDebugItem();
14269 _itemBase = this;
14270 }
14271
14273 {
14274 string text = super.GetDebugText();
14275
14277 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14278
14279 return text;
14280 }
14281 #endif
14282
14284 {
14285 return true;
14286 }
14287
14289
14291
14293 {
14296 }
14297
14298
14306
14322}
14323
14325{
14327 if (entity)
14328 {
14329 bool is_item = entity.IsInherited(
ItemBase);
14330 if (is_item && full_quantity)
14331 {
14334 }
14335 }
14336 else
14337 {
14339 return NULL;
14340 }
14341 return entity;
14342}
14343
14345{
14346 if (item)
14347 {
14348 if (health > 0)
14349 item.SetHealth("", "", health);
14350
14351 if (item.CanHaveTemperature())
14352 {
14354 if (item.CanFreeze())
14355 item.SetFrozen(false);
14356 }
14357
14358 if (item.HasEnergyManager())
14359 {
14360 if (quantity >= 0)
14361 {
14362 item.GetCompEM().SetEnergy0To1(quantity);
14363 }
14364 else
14365 {
14367 }
14368 }
14369 else if (item.IsMagazine())
14370 {
14371 Magazine mag = Magazine.Cast(item);
14372 if (quantity >= 0)
14373 {
14374 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14375 }
14376 else
14377 {
14379 }
14380
14381 }
14382 else
14383 {
14384 if (quantity >= 0)
14385 {
14386 item.SetQuantityNormalized(quantity, false);
14387 }
14388 else
14389 {
14391 }
14392
14393 }
14394 }
14395}
14396
14397#ifdef DEVELOPER
14399#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.