Files
linuxdistro-roguelite/Assets/Scripts/Meta/DistroVersionCatalog.cs
T
2026-10-29 22:54:29 +01:00

93 lines
5.0 KiB
C#

using System;
using System.Collections.Generic;
namespace KernelPanic.Meta
{
public static class DistroVersionCatalog
{
private static readonly Dictionary<string, string[]> ReleaseLabels = new(StringComparer.OrdinalIgnoreCase)
{
["ubuntu"] = new[] { "20.04", "21.04", "22.04", "23.04", "24.04" },
["fedora"] = new[] { "38", "39", "40", "41", "42" },
["mint"] = new[] { "21", "21.2", "21.3", "22", "22.1" },
["arch"] = new[] { "2024.01", "2024.06", "2024.12", "2025.06", "2025.12" },
["gentoo"] = new[] { "1.0", "1.1", "1.2", "2.0", "2.1" },
["nixos"] = new[] { "24.05", "24.11", "25.05", "25.11", "26.05" }
};
public static string GetReleaseLabel(string unitId, int version)
{
int safeVersion = Math.Max(1, Math.Min(GachaTuning.MaxVersion, version));
if (!string.IsNullOrWhiteSpace(unitId) && ReleaseLabels.TryGetValue(unitId, out string[] labels) && safeVersion <= labels.Length)
{
return labels[safeVersion - 1];
}
return $"V{safeVersion}";
}
public static string GetEffectSummary(string unitId, int version)
{
int safeVersion = Math.Max(1, Math.Min(GachaTuning.MaxVersion, version));
return (unitId ?? string.Empty).ToLowerInvariant() switch
{
"nixos" => safeVersion switch
{
1 => "nixos-rebuild switch: once per turn, pay 1 Cycle to change governor. performance +20% damage / -25% card Shield; powersave -20% damage / +30% card Shield; schedutil +5% both. Reset to schedutil each wave.",
2 => "schedutil: +10% card damage and +10% card Shield",
3 => "first successful governor change each wave is free",
4 => "performance: +30% damage; powersave: +40% card Shield; penalties remain",
5 => "specialisation: successful switches grant performance 5 damage, powersave 6 Shield, or schedutil draw 1; no governor scaling",
_ => "--"
},
"gentoo" => safeVersion switch
{
1 => "emerge --world: start each wave at Compilation 0/4; +1 per completed round. Card damage: -15%, normal, +10%, +20%, +30%",
2 => "ccache: Compilation 0 card damage penalty improves to -5%",
3 => "precompiled headers: begin every wave at Compilation 1",
4 => "LTO: explicit card Shield gains +5% per Compilation level",
5 => "-O3 -march=native: Compilation cap 6; levels 5/6 give +40%/+50% card damage and +25%/+30% card Shield",
_ => "--"
},
"ubuntu" => safeVersion switch
{
1 => "turn draw: choose one of the top 2 cards with apt update",
2 => "apt update lets you choose from the top 3 cards",
3 => "ask ubuntu inspects 5 cards instead of 3; take one",
4 => "apt update lets you choose from the top 4 cards; chosen card costs 1 less this turn",
5 => "once per combat, empty hand refills up to RAM",
_ => "--"
},
"fedora" => safeVersion switch
{
1 => "first card each turn costs 1 less and deals +50%, with crash risk",
2 => "first-card damage bonus rises to +75%",
3 => "non-crashing first-card plays gain +1 effect this combat; rawhide doubles that growth",
4 => "crashes grant +1 Cycle that turn",
5 => "first two cards each turn get the discount, bonus, and independent crash rolls",
_ => "--"
},
"mint" => safeVersion switch
{
1 => "random values roll max; no crits; ignores multiplicative damage buffs",
2 => "fixed effect values are treated as +2",
3 => "timeshift snapshot restores 2 uptime beyond the snapshot, up to max uptime",
4 => "flat +damage can apply; multiplicative crit/mult remains ignored",
5 => "timeshift snapshot restores to full uptime if lower",
_ => "--"
},
"arch" => safeVersion switch
{
1 => "btw stacks add C/Rust damage; once per wave, lethal uptime recovers to 1",
2 => "btw stacks add +2 C/Rust damage instead of +1",
3 => "makepkg scales at btw x3 instead of x2",
4 => "rolling-release recovery also grants 15 Shield and 2 Cycles",
5 => "btw persists for the wave and rolling release can save twice per wave",
_ => "--"
},
_ => safeVersion == 1 ? "base release" : $"V{safeVersion} release effect"
};
}
}
}