Кровавый прилив: свой крит меча - 25% обычных ударов x2 урона

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AlexCube
2026-10-10 13:35:17 +03:00
co-authored by Claude Opus 5.5
parent c169003cf0
commit 75e122b6a4
3 changed files with 31 additions and 0 deletions
+31
View File
@@ -244,6 +244,37 @@ namespace NecromancerTome
}
}
/// <summary>
/// Крит меча (указание 10.10: «шанс на критический удар бы тоже повысить»). Случайного крита у ближнего боя в игре
/// нет: ItemActionDynamic помечает критическим каждый силовой удар (действие 1) и ни одного обычного, а
/// CriticalChance уходит в параметр _criticalHitChanceOLD функции Hit, которую та не читает. Сам крит урон не
/// поднимает - только чаще сбивает с ног и ставит на колено, вдвое быстрее копит урон по ногам, красит цифру урона.
/// Наш крит: в прилив обычный удар ножом по существу с шансом CritChance - критический, урон x CritMultiplier.
/// </summary>
[HarmonyPatch(typeof(ItemActionAttack), nameof(ItemActionAttack.Hit))]
public static class Patch_ItemActionAttack_Hit_BloodTideCrit
{
public const float CritChance = 0.25f;
public const float CritMultiplier = 2f;
public static void Prefix(WorldRayHitInfo hitInfo, int _attackerEntityId, ref float _entityDamage,
ItemActionAttack.AttackHitInfo _attackDetails, ItemValue damagingItemValue, bool _isGrazingHit)
{
if (!BloodTide.Armed || _isGrazingHit || _attackDetails == null || _attackDetails.isCriticalHit || _entityDamage <= 0f ||
hitInfo?.tag == null || !hitInfo.tag.StartsWith("E_") || damagingItemValue?.ItemClass?.Name != SnakeMode.KnifeName)
{
return;
}
World world = GameManager.Instance?.World;
if (world == null || world.GetPrimaryPlayer()?.entityId != _attackerEntityId || Random.value >= CritChance)
{
return;
}
_entityDamage *= CritMultiplier;
_attackDetails.isCriticalHit = true;
}
}
/// <summary>Пульс полосок здоровья и выносливости (прилив и нож в руке): цвет полосы (BarContent в HUDLeftStatBars
/// игры, у здоровья 255,0,0,160, у выносливости 0,54,255,160) уходит в фиолетовый на каждом ударе сердца.</summary>
[HarmonyPatch(typeof(XUiC_HUDStatBar), nameof(XUiC_HUDStatBar.Update))]
Binary file not shown.
Binary file not shown.