Резная кость: отдельный инструмент нитей цинерариев (#86)

Новый предмет necroCarvedBone: бедренная кость с железным колпачком, кольцом
и светящимися рунами; в руке как нож некроманта, хват всегда нитяной и делает
всё то же. Рецепт: кость, 10 кованого железа, щепоть праха; открывается вместе
с цинерариями. Иконка, лист книги, тексты на 13 языках.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AlexCube
2026-10-28 12:24:15 +03:00
co-authored by Claude Opus 5.5
parent 96d930e5bb
commit 9d54cab98f
13 changed files with 51 additions and 16 deletions
+11 -4
View File
@@ -34,6 +34,10 @@ namespace NecromancerTome
{
public const string KnifeName = Patch_ItemClass_ExecuteAction_KnifePowerCost.KnifeName;
public const string ThreadKnifeName = "necroWpnBladeNecroKnifeThread";
/// <summary>Резная кость (#86, 28.10.2026): отдельный инструмент нитей - делает то же, что нож хватом для нитей, хват
/// всегда для нитей, меню хватов по R у неё нет. Для тех, кто не нашёл хват у ножа (пользователь: «чтобы игроки, которые
/// не обнаружили нитяной хват у ножа, легко могли найти отдельный инструмент управления цинерариями»).</summary>
public const string BoneName = "necroCarvedBone";
/// <summary>Как у провода электрики: ItemActionConnectPower.maxWireLength = 15.</summary>
public const float MaxLength = 15f;
public const int MaxFrom = 8;
@@ -51,6 +55,9 @@ namespace NecromancerTome
return n == SkullDecorPlace.CenterBlock || n == SkullDecorPlace.BackBlock || n == "necroSkullDecor";
}
public static bool IsThreadKnife(ItemClass _i) => _i != null && _i.Name == ThreadKnifeName;
/// <summary>Инструмент нитей в руке: нож хватом для нитей или резная кость.</summary>
public static bool IsThreadTool(ItemClass _i) => _i != null && IsThreadToolName(_i.Name);
public static bool IsThreadToolName(string _n) => _n == ThreadKnifeName || _n == BoneName;
// ------------------------------------------------------------------
// Хват.
@@ -439,7 +446,7 @@ namespace NecromancerTome
public static bool ToolInHand()
{
EntityPlayerLocal pl = GameManager.Instance?.World?.GetPrimaryPlayer();
return pl != null && CinerariumThreads.IsThreadKnife(pl.inventory?.holdingItem);
return pl != null && CinerariumThreads.IsThreadTool(pl.inventory?.holdingItem);
}
void Update()
@@ -492,7 +499,7 @@ namespace NecromancerTome
void Update()
{
EntityPlayerLocal pl = GameManager.Instance?.World?.GetPrimaryPlayer();
if (pl == null || !CinerariumThreads.Start.HasValue || !CinerariumThreads.IsThreadKnife(pl.inventory?.holdingItem))
if (pl == null || !CinerariumThreads.Start.HasValue || !CinerariumThreads.IsThreadTool(pl.inventory?.holdingItem))
{
CinerariumThreads.Cancel();
return;
@@ -517,13 +524,13 @@ namespace NecromancerTome
}
}
/// <summary>Нож для нитей не бьёт: ЛКМ и ПКМ - нити (на отпускание кнопки).</summary>
/// <summary>Нож для нитей и резная кость не бьют: ЛКМ и ПКМ - нити (на отпускание кнопки).</summary>
[HarmonyPatch(typeof(ItemClass), nameof(ItemClass.ExecuteAction))]
public static class Patch_ItemClass_ExecuteAction_ThreadKnife
{
public static bool Prefix(ItemClass __instance, int _actionIdx, ItemInventoryData _data, bool _bReleased)
{
if (!CinerariumThreads.IsThreadKnife(__instance))
if (!CinerariumThreads.IsThreadTool(__instance))
{
return true;
}