From e0411ce3e5fd06d61efe0f83f1c9cb9f7835ade5 Mon Sep 17 00:00:00 2001 From: AlexCube Date: Fri, 16 Oct 2026 23:38:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B6-=D0=B4=D0=BB=D1=8F-=D0=BD?= =?UTF-8?q?=D0=B8=D1=82=D0=B5=D0=B9=20=D1=83=20=D1=82=D0=B5=D0=BB=D0=B0:?= =?UTF-8?q?=20=D1=85=D0=B2=D0=B0=D1=82=20=D0=BB=D1=83=D0=BA=D0=B0,=20?= =?UTF-8?q?=D0=BA=D0=B8=D1=81=D1=82=D1=8C=20+20=20=D0=BA=20=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BE=D0=BD=D0=B8,=20=D0=BD=D0=BE=D0=B6=20=D0=B2=20?= =?UTF-8?q?=D0=BA=D1=83=D0=BB=D0=B0=D0=BA=D0=B5=20(=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D0=B1=D0=BE=D1=80=20necrobody)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- HarmonySrc/HandPosePose.cs | 1 + HarmonySrc/ThreadKnifeBody.cs | 60 ++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/HarmonySrc/HandPosePose.cs b/HarmonySrc/HandPosePose.cs index 07ee59c..ea80da3 100644 --- a/HarmonySrc/HandPosePose.cs +++ b/HarmonySrc/HandPosePose.cs @@ -449,6 +449,7 @@ namespace NecromancerTome HeldTweak.Apply(); NecroView.Update(); NecroBody.LateUpdate(); + ThreadKnifeBody.LateUpdate(); } } diff --git a/HarmonySrc/ThreadKnifeBody.cs b/HarmonySrc/ThreadKnifeBody.cs index 4e33743..16782ee 100644 --- a/HarmonySrc/ThreadKnifeBody.cs +++ b/HarmonySrc/ThreadKnifeBody.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using HarmonyLib; using UnityEngine; @@ -12,7 +13,64 @@ namespace NecromancerTome /// public static class ThreadKnifeBody { - public static int TpHold = 36; + /// 0 - тело держит хватом предмета (68, лук). 16.10 в игре (necrobody) пользователь выбрал именно его: нож в левой + /// руке тела, «Нож был нормальным», нужна только поправка кисти и места ножа (ниже). Подмена на 36 - на пробу командой. + public static int TpHold = 0; + + /// Поправка тела, подобранная 16.10 командами necrobody: левая кисть к ладони на 20° («лучезапястный сустав + /// выгнуло... словно перелом»: LeftHand Z 302 -> 322), нож в кулаке - item pos 3 -4 -2 см («Вот так идеально»). + public static float WristBend = 20f; + public static Vector3 ItemPos = new Vector3(0.03f, -0.04f, -0.02f); + static readonly Dictionary _leftHand = new Dictionary(); + + /// Из HandPoseDriver.LateUpdate: у всех игроков в мире с ножом-для-нитей, кроме своего вида от первого лица. + public static void LateUpdate() + { + World w = GameManager.Instance?.World; + if (w?.Players?.list == null || TpHold > 0) + { + return; + } + foreach (EntityPlayer p in w.Players.list) + { + if (p == null || p.inventory?.holdingItem?.Name != CinerariumThreads.ThreadKnifeName || p.emodel == null || + p.emodel.IsFPV && !p.isEntityRemote) + { + continue; + } + AvatarCharacterController ac = p.emodel.avatarController as AvatarCharacterController; + Animator a = ac?.CharacterBody?.Animator; + if (a == null) + { + continue; + } + if (!_leftHand.TryGetValue(a, out Transform lh) || lh == null) + { + lh = null; + foreach (Transform t in a.GetComponentsInChildren(true)) + { + if (t.name == "LeftHand") + { + lh = t; + break; + } + } + if (_leftHand.Count > 16) + { + _leftHand.Clear(); + } + _leftHand[a] = lh; + } + if (lh != null) + { + lh.localRotation *= Quaternion.Euler(0f, 0f, WristBend); + } + if (ac.heldItemTransform != null && !NecroBody.ItemPos.HasValue) + { + ac.heldItemTransform.localPosition = ItemPos; + } + } + } public static bool Applies(EntityAlive _e) {