add C++, Typescript and more stuff

This commit is contained in:
2026-10-28 00:15:08 +01:00
parent e99e6386e8
commit ea0f475cae
108 changed files with 2488 additions and 980 deletions
@@ -22,6 +22,7 @@ namespace KernelPanic.Combat
// A stable integer mixer, independent of both gameplay random streams and runtime hash codes.
public static EncounterPlan Plan(int wave, WaveRoute route, int seed, int revision)
{
if (revision >= 3 && wave >= 5 && wave <= 9) return VariedCampaignPlan(wave, route, seed);
if (revision >= 2) return CampaignPlan(wave, route, seed);
if (revision == 0) return Plan(wave, route);
uint hash = unchecked((uint)seed ^ ((uint)wave * 0x9E3779B9u));
@@ -125,6 +126,37 @@ namespace KernelPanic.Combat
return new EncounterPlan(title, advice, Math.Max(0, wave - 1) * CombatTuning.EnemyUptimeGrowthPerWave, enemies);
}
private static EncounterPlan VariedCampaignPlan(int wave, WaveRoute route, int seed)
{
uint hash = unchecked((uint)seed ^ ((uint)wave * 0x9E3779B9u));
hash ^= hash >> 16; hash = unchecked(hash * 0x7FEB352Du); hash ^= hash >> 15;
int variant = (int)(hash % 3);
if (variant == 0) return CampaignPlan(wave, route, seed);
var baseline = CampaignPlan(wave, route, seed);
var (title, advice, enemies) = (wave, variant) switch
{
(5, 1) => ("Replicating privileges", "Fork Bomb copies itself after acting. Kill it early to expose Rootkit, which resists damage while allies remain.", new[] { "rootkit", "fork_bomb", "zombie_process" }),
(5, _) => ("Scheduled escalation", "Cron Job counts down while Memory Leak grows. Remove urgent threats to expose Rootkit.", new[] { "rootkit", "cron_job", "memory_leak" }),
(6, 1) => ("Protected telemetry", "Firewalld protects Telemetry Collector. Break through Shield before resource interference wears down your build.", new[] { "telemetry_collector", "firewalld", "zombie_process" }),
(6, _) => ("Scheduled collection", "Telemetry Collector interferes with resources while two Cron Jobs count down. Front-load damage or prepare defense for their heavy attacks.", new[] { "telemetry_collector", "cron_job", "cron_job" }),
(7, 1) => ("Growing restrictions", "DRM Guardian and Firewalld shelter a growing Memory Leak. Pick a target you can finish before its next turn.", new[] { "drm_guardian", "firewalld", "memory_leak" }),
(7, _) => ("Licensed replication", "Fork Bomb multiplies behind DRM Guardian's defenses. Segfault leaves a death payload; reserve damage for the process it creates.", new[] { "drm_guardian", "fork_bomb", "segfault" }),
(8, 1) => ("Leaking concurrency", "Race partners can swap order and the survivor enrages. Memory Leak grows each round; balance paired kills against stopping its growth.", new[] { "race_condition", "race_condition", "memory_leak" }),
(8, _) => ("Veiled concurrency", "Damage the Daemon to reveal its committed action. Race partners can swap order; killing one enrages the survivor.", new[] { "race_condition", "race_condition", "daemon" }),
(9, 1) => ("Leaking kernel", "Kernel Panic pressures RAM while Memory Leak grows. Firewalld adds defense; use efficient attacks and leave room to draw.", new[] { "kernel_panic", "memory_leak", "firewalld" }),
_ => ("Scheduled panic", "Kernel Panic pressures RAM, Cron Job counts down, and Segfault leaves a death payload. Save a follow-up for the new process.", new[] { "kernel_panic", "cron_job", "segfault" })
};
var composition = new List<string>(enemies);
if (route == WaveRoute.Challenge)
{
composition.Add("daemon"); title += " (elite)";
advice += baseline.EscortShield > 0 ? " Extra Daemon: 6 starting Shield, hidden intent."
: baseline.EscortUptime > 0 ? " Extra Daemon: +4 Uptime, hidden intent." : " Extra Daemon: hidden intent.";
}
return new EncounterPlan(title, advice, baseline.UptimeBonus, composition.ToArray())
{ EscortShield = baseline.EscortShield, EscortUptime = baseline.EscortUptime };
}
private static EncounterPlan CampaignPlan(int wave, WaveRoute route, int seed)
{
// Keep introductory encounters familiar; introduce the heavier systems before the final boss.