Rebalance most languages and revamp main game loop

This commit is contained in:
2026-10-25 23:50:04 +01:00
parent 53f831d91e
commit a4109f5be0
76 changed files with 4198 additions and 573 deletions
+29 -5
View File
@@ -71,7 +71,7 @@ public class CampaignTests
Assert.That(pair[0].PairId, Is.GreaterThanOrEqualTo(0));
Assert.That(pair[1].PairId, Is.EqualTo(pair[0].PairId));
((List<EnemyInstance>)_combat.Enemies).Clear();
Set(_run, "currentWaveNumber", 5);
Set(_run, "currentWaveNumber", RunJourney.BossWave);
Call(_combat, "SpawnEncounter");
Assert.That(_combat.Enemies.Count(enemy => enemy.Archetype.Tier == EnemyTier.Boss), Is.EqualTo(1));
}
@@ -107,6 +107,30 @@ public class CampaignTests
Assert.That(RandomRoll.DrawCount, Is.EqualTo(draws));
}
[Test]
public void ExtendedEncountersEscalateWithoutAnEarlyBossAndContinueIntoSurvival()
{
int draws = RandomRoll.DrawCount;
for (int seed = 0; seed < 50; seed++)
for (int wave = 1; wave <= 12; wave++)
{
var plan = EncounterDirector.Plan(wave, WaveRoute.Repair, seed, 2);
Assert.That(plan.Enemies.All(id => EnemyArchetypeCatalog.Get(id).Id == id), Is.True);
Assert.That(plan.Enemies.Count(id => id == "race_condition") % 2, Is.Zero);
if (wave < 10) Assert.That(plan.Enemies, Does.Not.Contain("kernel_overseer"));
if (wave == 10) Assert.That(plan.Enemies.Count(id => id == "kernel_overseer"), Is.EqualTo(1));
if (wave > 10) Assert.That(plan.Title, Does.StartWith("Survival"));
Assert.That(plan.UptimeBonus, Is.EqualTo((wave - 1) * CombatTuning.EnemyUptimeGrowthPerWave));
if (wave > 1)
{
var elite = EncounterDirector.Plan(wave, WaveRoute.Challenge, seed, 2);
Assert.That(elite.Enemies.Count, Is.EqualTo(plan.Enemies.Count + 1));
Assert.That(elite.Enemies.Last(), Is.EqualTo("daemon"));
}
}
Assert.That(RandomRoll.DrawCount, Is.EqualTo(draws));
}
[Test]
public void BuildRewardBlocksDepartureAndOnlyUpgradesTheChosenCardOnce()
{
@@ -309,7 +333,7 @@ public class CampaignTests
[Test]
public void CompletedCampaignIsAVictoryAndCannotContinueOrCompleteTwice()
{
RepositoryAfter(5);
RepositoryAfter(RunJourney.BossWave);
Assert.That(_run.CampaignChoicePending, Is.True);
_combat.ContinueToNextWave();
Assert.That(_combat.AwaitingWaveContinue, Is.True);
@@ -326,13 +350,13 @@ public class CampaignTests
public void EndlessIsExplicitAndKeepsTheSameRunAndRewards()
{
Assert.That(_run.EnterEndless(), Is.False);
RepositoryAfter(5);
RepositoryAfter(RunJourney.BossWave);
string id = _run.RunId;
int bandwidth = _run.AccruedBandwidth;
Assert.That(_run.EnterEndless(), Is.True);
Assert.That(_run.EnterEndless(), Is.False);
Assert.That(_run.CampaignChoicePending, Is.False);
Assert.That(_run.CurrentWaveNumber, Is.EqualTo(6));
Assert.That(_run.CurrentWaveNumber, Is.EqualTo(RunJourney.BossWave + 1));
Assert.That(_run.AccruedBandwidth, Is.EqualTo(bandwidth));
Assert.That(_run.RunId, Is.EqualTo(id));
Assert.That(_run.RewardsSettled, Is.False);
@@ -353,7 +377,7 @@ public class CampaignTests
int draws = RandomRoll.DrawCount;
var lines = ExecutionPreview.Build(_combat);
Assert.That(lines[1], Does.Contain(python.Definition.DisplayName).And.Contain("FIFO").And.Contain("Memory Leak"));
Assert.That(lines[2], Does.Contain(thunk.Definition.DisplayName).And.Contain("LIFO x1.5"));
Assert.That(lines[2], Does.Contain(thunk.Definition.DisplayName).And.Contain("LIFO x1.75"));
Assert.That(lines[3], Does.Contain(map.Definition.DisplayName));
Assert.That(ExecutionPreview.Build(_combat), Is.EqualTo(lines));
Assert.That(RandomRoll.DrawCount, Is.EqualTo(draws));