Резная кость: отдельный инструмент нитей цинерариев (#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
+2 -2
View File
@@ -75,14 +75,14 @@ namespace NecromancerTome
}
}
/// <summary>Череп и нож (меч прилива) - модели предметов: в руке и на земле.</summary>
/// <summary>Череп, нож (меч прилива) и резная кость (#86) - модели предметов: в руке и на земле.</summary>
[HarmonyPatch(typeof(ItemClass), nameof(ItemClass.CloneModel))]
public static class Patch_ItemClass_CloneModel_BundleShaderFix
{
public static void Postfix(ItemClass __instance, AssetManagement.InstanceHandle<GameObject> __result)
{
string n = __instance?.Name;
if (n != "necroSkull" && n != SnakeMode.KnifeName)
if (n != "necroSkull" && n != SnakeMode.KnifeName && n != CinerariumThreads.BoneName)
{
return;
}
+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;
}
+1 -1
View File
@@ -64,7 +64,7 @@ namespace NecromancerTome
{
// Только от первого лица (16.10: «В виде от третьего лица что-то страшное»): поза и перенос ножа - для рук первого
// лица; от третьего лица модель в руке - у тела, и нож улетал к невидимой руке первого лица.
if (_player != null && _player.inventory?.holdingItem?.Name == CinerariumThreads.ThreadKnifeName &&
if (_player != null && CinerariumThreads.IsThreadToolName(_player.inventory?.holdingItem?.Name) &&
(_player.emodel as EModelSDCS)?.IsFPV == true && !SnakeMode.Active && !MindPalace.Active && !Possession.Active && !_player.IsDead())
{
if (_threadSince < 0f)
+2 -2
View File
@@ -33,7 +33,7 @@ namespace NecromancerTome
}
foreach (EntityPlayer p in w.Players.list)
{
if (p == null || p.inventory?.holdingItem?.Name != CinerariumThreads.ThreadKnifeName || p.emodel == null ||
if (p == null || !CinerariumThreads.IsThreadToolName(p.inventory?.holdingItem?.Name) || p.emodel == null ||
p.emodel.IsFPV && !p.isEntityRemote)
{
continue;
@@ -74,7 +74,7 @@ namespace NecromancerTome
public static bool Applies(EntityAlive _e)
{
return TpHold > 0 && _e != null && _e.inventory?.holdingItem?.Name == CinerariumThreads.ThreadKnifeName;
return TpHold > 0 && _e != null && CinerariumThreads.IsThreadToolName(_e.inventory?.holdingItem?.Name);
}
}