using System; using System.Collections.Generic; using KernelPanic.Run; namespace KernelPanic.Combat { public sealed class EncounterPlan { public string Title { get; } public string Advice { get; } public IReadOnlyList Enemies { get; } public int UptimeBonus { get; } public EncounterPlan(string title, string advice, int uptimeBonus, params string[] enemies) { Title = title; Advice = advice; UptimeBonus = uptimeBonus; Enemies = Array.AsReadOnly(enemies); } } /// Authored encounter composition. Reads no random state; spawning owns stat rolls. public static class EncounterDirector { public static EncounterPlan Plan(int wave, WaveRoute route) { string title, advice; string[] enemies; switch (wave) { case 1: title = "Boot diagnostics"; advice = "Memory Leak grows each round. A Zombie can revive once: finish weakened zombies decisively."; enemies = new[] { "zombie_process", "memory_leak" }; break; case 2: title = "Firewall maintenance"; advice = "firewalld shields its neighbours. Cron Job counts down to a heavy attack."; enemies = new[] { "firewalld", "cron_job" }; break; case 3: title = "Process explosion"; advice = "Fork Bomb copies itself after acting. Stop it before the process table fills."; enemies = new[] { "fork_bomb", "memory_leak", "firewalld" }; break; case 4: title = "Concurrency fault"; advice = "Race partners attack in uncertain order; killing one enrages the survivor. Segfault has a death payload."; enemies = new[] { "race_condition", "race_condition", "segfault" }; break; case RunJourney.BossWave: title = "Kernel Overseer"; advice = "Boss cycle: shield, probe, heavy interrupt. At half uptime its NEXT announced attacks become stronger."; enemies = new[] { "kernel_overseer", "firewalld" }; break; default: title = "Endless / " + wave; advice = "Threats return in stronger combinations. Race partners remain paired."; enemies = (wave % 4) switch { 0 => new[] { "race_condition", "race_condition", "drm_guardian", "segfault" }, 1 => new[] { "kernel_overseer", "telemetry_collector", "firewalld" }, 2 => new[] { "rootkit", "fork_bomb", "cron_job", "memory_leak" }, _ => new[] { "kernel_panic", "daemon", "firewalld", "zombie_process" } }; break; } if (wave > 1 && route == WaveRoute.Challenge) { var harder = new List(enemies) { "daemon" }; enemies = harder.ToArray(); title += " / challenge"; advice += " An elite Daemon escorts this route; damage it to expose its intent."; } return new EncounterPlan(title, advice, Math.Max(0, wave - 1) * CombatTuning.EnemyUptimeGrowthPerWave, enemies); } } }