Стервятник с ношей: курица/кролик выше в когтях, Shift не разгоняет (#74)

CarryGap -0.06 -> -0.15 м; с ношей разгон и планирование по Shift
выключены (перегружен). Подбор без перезапуска - necrocarry gap|run.
DLL закоммитится вместе с оссуарием (#66).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AlexCube
2026-10-22 22:45:29 +03:00
co-authored by Claude Opus 5.5
parent c9b3e078c3
commit e3cdff0323
2 changed files with 50 additions and 4 deletions
+9 -4
View File
@@ -106,8 +106,12 @@ namespace NecromancerTome
/// угол из PlaceCamera затирался).</summary>
public static float ZoomFov = -1f;
/// <summary>Зазор между когтями стервятника и спиной ноши, м; минус - когти впиваются в спину
/// (тест 08.10: «курица висит под стервятником, а не в его когтях»).</summary>
public const float CarryGap = -0.06f;
/// (тест 08.10: «курица висит под стервятником, а не в его когтях»). 22.10: -0.06 -> -0.15 («поднимай курицу и кролика
/// ещё выше. Иначе они не достают до лап»). Подбор без перезапуска - necrocarry gap.</summary>
public static float CarryGap = -0.15f;
/// <summary>С ношей Shift не разгоняет (22.10: «он не может разгоняться по шифту, ибо перегружен»). Выключатель -
/// necrocarry run on|off.</summary>
public static bool CarryNoRun = true;
/// <summary>Цель рывка под прицелом сейчас (каждый кадр) - обычный прицел игры краснеет (AimTint).</summary>
public static EntityAlive FlyAim;
static float _flyDashUntil;
@@ -961,7 +965,8 @@ namespace NecromancerTome
dir += Vector3.down;
}
bool moving = dir.sqrMagnitude > 0.01f;
float accel = _flyRun ? FlyAccelRun * _v.moveSpeedAggro : FlyAccel * _v.moveSpeed;
bool run = _flyRun && !(CarryNoRun && _carry != null); // с ношей - перегружен, без разгона
float accel = run ? FlyAccelRun * _v.moveSpeedAggro : FlyAccel * _v.moveSpeed;
if (moving)
{
_v.motion = _v.motion * 0.9f + dir.normalized * (accel * 0.1f);
@@ -976,7 +981,7 @@ namespace NecromancerTome
_v.SetRotation(new Vector3(0f, _bodyYaw, 0f));
if (_v.emodel != null && _v.emodel.avatarController != null)
{
_v.glidingCurrentPercent = Mathf.MoveTowards(_v.glidingCurrentPercent, _flyRun && moving ? 1f : 0f, 0.06f);
_v.glidingCurrentPercent = Mathf.MoveTowards(_v.glidingCurrentPercent, run && moving ? 1f : 0f, 0.06f);
_v.emodel.avatarController.UpdateFloat("Gliding", _v.glidingCurrentPercent);
}
// «Вниз» на земле посадке не мешает: Ctrl - переключатель, и с ним стервятник не сел бы никогда.
+41
View File
@@ -0,0 +1,41 @@
using System.Collections.Generic;
using System.Globalization;
using UnityEngine;
namespace NecromancerTome
{
/// <summary>Ноша одержимого стервятника (курица, кролик): высота под лапами и запрет разгона с грузом (22.10.2026).</summary>
public class ConsoleCmdNecroCarry : ConsoleCmdAbstract
{
public override string[] getCommands() => new[] { "necrocarry" };
public override string getDescription() => "NecromancerTome: ноша стервятника - gap <м, минус - выше>|run on|off|show";
void Out(string _s)
{
SdtdConsole.Instance.Output(_s);
Debug.Log("[NecromancerTome] necrocarry: " + _s);
}
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
{
string cmd = _params.Count > 0 ? _params[0] : "show";
switch (cmd)
{
case "gap":
if (_params.Count > 1 && float.TryParse(_params[1].Replace(',', '.'), NumberStyles.Float, CultureInfo.InvariantCulture, out float g))
{
Possession.CarryGap = Mathf.Clamp(g, -0.6f, 0.3f);
}
break;
case "run":
if (_params.Count > 1 && (_params[1] == "on" || _params[1] == "off"))
{
Possession.CarryNoRun = _params[1] == "on";
}
break;
}
Out("gap " + Possession.CarryGap.ToString("0.###", CultureInfo.InvariantCulture) + ", без разгона с ношей - " +
(Possession.CarryNoRun ? "да" : "нет"));
}
}
}