Разгром дальше 5:1 (решения 31.10, п. 5): 7:1 -- 92%, 10:1 -- 95%, дальше плавно к 99%

Сильная сторона после 5:1 -- 11% (документ не задаёт). Версия правил боя 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alexander
2026-11-01 13:07:14 +01:00
co-authored by Claude Opus 5.5
parent 20691e0511
commit 5c4ba98fef
7 changed files with 51 additions and 16 deletions
+9 -2
View File
@@ -556,6 +556,13 @@ public class ModuleTests
Assert.AreEqual(550, five.AttackerLosses, "5:1 -- сильная теряет 11%");
Assert.AreEqual(880, five.DefenderLosses, "5:1 -- слабая теряет 88%");
// Разгром дальше 5:1 (решения 31.10, п. 5): 7:1 -- 92%, 10:1 -- 95%, дальше -- плавно к 99%, но не 100%
Assert.AreEqual(920, Fight(7000, 1000).DefenderLosses, "7:1 -- 92%");
Assert.AreEqual(950, Fight(10000, 1000).DefenderLosses, "10:1 -- 95%");
Assert.AreEqual(970, Fight(20000, 1000).DefenderLosses, "20:1 -- 99 - 4 x 10/20 = 97%");
Assert.AreEqual(986, Fight(100000, 1000).DefenderLosses, "100:1 -- 98,6%");
Assert.AreEqual(1100, Fight(10000, 1000).AttackerLosses, "сильная сторона дальше 5:1 -- 11%");
// Симметрия: тот же перевес у защитника -- те же доли (одинаково для PvE, PvP и Круга)
BattleOutcome threeDef = Fight(1000, 3000);
Assert.AreEqual(740, threeDef.AttackerLosses);
@@ -563,7 +570,7 @@ public class ModuleTests
// Плавность: при росте перевеса сильная теряет всё меньше, слабая -- всё больше, без скачков
int prevStrong = 1000, prevWeak = -1;
for (int att = 1010; att <= 6000; att += 10)
for (int att = 1010; att <= 30000; att += 10)
{
BattleOutcome o = Fight(att, 1000);
int strongPermille = (int)((long)o.AttackerLosses * 1000 / att);
@@ -577,7 +584,7 @@ public class ModuleTests
// Кривая из таблицы: другие точки -- другие потери; ошибка в таблице не ломает бой
var custom = BattleRules.NoRandom;
custom.StrongLossPermille = new[] { 300, 100, 50 };
custom.StrongLossPermille = new[] { 300, 100, 50, 50, 50 };
Assert.AreEqual(300, new BattleSystem(custom).Resolve(new BattleRequest { Attackers = 1000, Defenders = 1000 }).DefenderLosses);
var broken = BattleRules.NoRandom;
broken.LossRatioPermille = new[] { 3000, 1000 }; // не по возрастанию и разной длины