From dec5d9851df3711cc110b17d785e266352c3abeb Mon Sep 17 00:00:00 2001 From: AlexCube Date: Thu, 1 Oct 2026 12:18:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BA=D0=B0=D0=BA=D1=83=D0=BD:=20=D1=81?= =?UTF-8?q?=D1=84=D0=B5=D1=80=D0=B0=20=D0=B8=20=D0=BA=D0=B0=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=8C=20=D1=81=D1=82=D0=B0=D0=B2=D1=8F=D1=82=D1=81=D1=8F?= =?UTF-8?q?=20=D1=88=D0=B8=D1=84=D1=82-=D0=BA=D0=BB=D0=B8=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- HarmonySrc/BoneSteedFuelPatch.cs | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/HarmonySrc/BoneSteedFuelPatch.cs b/HarmonySrc/BoneSteedFuelPatch.cs index e7284db..478a33b 100644 --- a/HarmonySrc/BoneSteedFuelPatch.cs +++ b/HarmonySrc/BoneSteedFuelPatch.cs @@ -264,6 +264,42 @@ namespace NecromancerTome } } + /// Шифт-клик сферой или камнем в окне скакуна (01.10: «в оссуарий сфера вставляется + /// по шифт-клику, а в мотоцикл только перетаскиванием»). Ваниль ставит деталь шифт-кликом + /// через AddPartToItem, а он пускает модификацию только по InstallableTags хозяина - у сферы + /// и камня там браслет. Для скакуна - первая пустая ячейка, как у ванили. + [HarmonyPatch(typeof(XUiM_AssembleItem), nameof(XUiM_AssembleItem.AddPartToItem))] + public static class Patch_XUiM_AssembleItem_AddPartToItem_BoneSteed + { + public static bool Prefix(XUiM_AssembleItem __instance, ItemStack _partStack, out ItemStack _resultStack, ref bool __result) + { + _resultStack = _partStack; + ItemStack current = __instance.CurrentItem; + if (current == null || current.IsEmpty() || !BoneSteedFuel.IsSteedItem(current.itemValue)) + return true; + __result = false; + ItemValue add = _partStack.itemValue; + bool blood = BoneSteedFuel.IsStone(add) || + BoneSteedFuel.IsSphere(add) && add.UseTimes < add.MaxUseTimes; + if (!blood) + return false; + ItemValue item = current.itemValue; + for (int i = 0; i < item.ModificationCount; i++) + { + ItemValue m = item.GetModification(i); + if (m != null && !m.IsEmpty()) + continue; + item.SetModification(i, add.Clone()); + __instance.RefreshAssembleItem(); + __instance.UpdateAssembleWindow(); + _resultStack = ItemStack.Empty; + __result = true; + return false; + } + return false; + } + } + /// Здоровье скакуна не зависит от сфер в ячейках (у сферы DegradationMax 500). [HarmonyPatch(typeof(ItemValue), nameof(ItemValue.MaxUseTimesBase), MethodType.Getter)] public static class Patch_ItemValue_MaxUseTimesBase_BoneSteed