Refactor alot of stuff
This commit is contained in:
@@ -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 >= 4 && wave >= 2 && wave <= RunJourney.BossWave) return SpecialistPlan(wave, route, seed);
|
||||
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);
|
||||
@@ -79,6 +80,28 @@ namespace KernelPanic.Combat
|
||||
return plan;
|
||||
}
|
||||
|
||||
private static EncounterPlan SpecialistPlan(int wave, WaveRoute route, int seed)
|
||||
{
|
||||
uint hash = unchecked((uint)seed * 0x9E3779B9u + (uint)wave * 0x7FEB352Du);
|
||||
hash ^= hash >> 16;
|
||||
int variant = (int)(hash % 3);
|
||||
var baseline = Plan(wave, route, seed, 3);
|
||||
if (wave == RunJourney.BossWave)
|
||||
{
|
||||
if (variant == 0) return baseline;
|
||||
return variant == 1
|
||||
? new EncounterPlan("Process Supervisor", "Cycle: summon two workers, Shield, interrupt. Workers accumulate up to eight living processes; clear them with area damage or race the supervisor. At half Uptime its next attacks gain 3 damage.", baseline.UptimeBonus, "process_supervisor", "firewalld")
|
||||
: new EncounterPlan("OOM Reaper", "Two RAM are unavailable while the Reaper lives. Cycle: charge with Shield, 14-damage OOM kill, weak recovery attack. Prepare defense for the burst; at half Uptime its next attacks gain 3 damage.", baseline.UptimeBonus, "oom_reaper", "cron_job");
|
||||
}
|
||||
if (route != WaveRoute.Challenge || variant == 0) return baseline;
|
||||
var standard = Plan(wave, WaveRoute.Repair, seed, 3);
|
||||
var enemies = new List<string>(standard.Enemies) { variant == 1 ? "watchdog" : "process_broker" };
|
||||
string advice = variant == 1
|
||||
? "Watchdog escort: two countdown turns, then 12-14 damage. Defeat it before timeout or bank Shield."
|
||||
: "Process Broker escort: alternates summoning a worker and attacking. Workers accumulate up to eight living processes; stop the broker early.";
|
||||
return new EncounterPlan(standard.Title + " (elite)", standard.Advice + " " + advice, standard.UptimeBonus, enemies.ToArray());
|
||||
}
|
||||
|
||||
public static EncounterPlan Plan(int wave, WaveRoute route)
|
||||
{
|
||||
string title, advice;
|
||||
|
||||
Reference in New Issue
Block a user