Add NixOS and Go

This commit is contained in:
2026-10-27 11:35:32 +01:00
parent 881b61a66d
commit 97d2685302
64 changed files with 1295 additions and 204 deletions
+21 -1
View File
@@ -16,7 +16,7 @@ namespace KernelPanic.Combat
Cleanse, ShuffleToken, UpgradeHandCards, GenerateCard, NoOp, UpdateManager,
ShieldRepeatDamage, Timeshift, DnfAutoremove, FirstToPackage, Rawhide,
IncomingAttackHalve, ConsultWiki, RandomCommonLanguageCard, MinimalInstall, SizeofDamage,
RepairCorruptedCards, AskUbuntu, FixedDraw, Python
RepairCorruptedCards, AskUbuntu, FixedDraw, Python, Go
}
/// <summary>
@@ -60,6 +60,7 @@ namespace KernelPanic.Combat
CardEffectKind.Draw => new DrawEffect(Amount),
CardEffectKind.FixedDraw => new FixedDrawEffect(Amount),
CardEffectKind.Python => new PythonEffect((PythonOperation)SecondaryAmount, Amount),
CardEffectKind.Go => new GoEffect((GoOperation)SecondaryAmount, Amount, MaxAmount),
CardEffectKind.AskUbuntu => new AskUbuntuEffect(),
CardEffectKind.ChanceDamage => new ChanceDamageEffect(Amount, SecondaryAmount, Language),
CardEffectKind.PreviousLanguageDamage => new PreviousLanguageDamageEffect(Amount, SecondaryAmount, Language),
@@ -269,6 +270,23 @@ namespace KernelPanic.Combat
Add("shop_c_valgrind", None, false, "repair up to {amount:0} corrupted cards in your active deck. gain {shield:1} Shield.",
Fx(CardEffectKind.RepairCorruptedCards, 3), Shield(6));
Add("nixos_rebuild_switch_card", None, false, "gain {shield:0} Shield. draw 1. does not switch governor.", Shield(4), Fx(CardEffectKind.FixedDraw, 1));
Add("nixos_nix_shell", Single, false, "deploy {amount:0} damage/tick for 3 ticks, starting next round.", Go(GoOperation.Deploy, 2, 3));
Add("nixos_flake_update", Single, false, "deal {amount:0}.", Damage(3, Language.Haskell));
Add("nixos_store_gc", None, false, "gain {shield:0} Shield. draw 1.", Shield(5), Fx(CardEffectKind.FixedDraw, 1));
Add("nixos_rollback", None, false, "restore {amount:0} Uptime. extend a selected goroutine by 1 tick if possible (cap 5).", Go(GoOperation.Rollback, 4));
Add("lang_go_worker", Single, false, "deploy {amount:0} damage/tick for 3 ticks, starting next round.", Go(GoOperation.Deploy, 3, 3));
Add("lang_go_func", Single, false, "deploy {amount:0} damage/tick for 2 ticks, starting next round.", Go(GoOperation.Deploy, 1, 2));
Add("lang_go_context_timeout", None, false, "extend a selected active goroutine by 2 ticks (cap 5).", Go(GoOperation.Extend, 2));
Add("shop_go_time_ticker", Single, false, "deploy {amount:0} damage/tick for 3 ticks, starting next round.", Go(GoOperation.Deploy, 2, 3));
Add("shop_go_waitgroup", None, false, "gain 3 Shield per active goroutine (base cap 9).", Go(GoOperation.WaitGroup));
Add("shop_go_gosched", None, false, "draw 1. if a goroutine is active, gain {shield:0} Shield.", Go(GoOperation.Gosched, 1));
Add("shop_go_context_cancel", None, false, "terminate a selected active goroutine. gain {shield:0} Shield.", Go(GoOperation.Cancel, 4));
Add("shop_go_build", Single, false, "deal {amount:0} immediately.", Damage(7, Language.Go));
Add("shop_go_channel_send", None, false, "extend all active goroutines by 1 tick (cap 5). requires extension capacity.", Go(GoOperation.ExtendAll, 1));
Add("shop_go_select", Single, false, "deal 3 damage per active goroutine as one hit (base cap 9).", Go(GoOperation.Select));
Add("shop_go_num_goroutines", None, false, "draw 1 per active goroutine (fixed cap 3; limited by free RAM).", Go(GoOperation.NumGoroutines));
var byId = new Dictionary<string, CardCatalogEntry>(StringComparer.Ordinal);
foreach (CardCatalogEntry entry in entries) byId.Add(entry.Id, entry);
Entries = entries.AsReadOnly();
@@ -284,6 +302,8 @@ namespace KernelPanic.Combat
private static CardEffectSpec Damage(int amount, Language language, int max = -1, bool all = false, bool trueDamage = false)
=> new(CardEffectKind.Damage, amount, max, language: language, allEnemies: all, trueDamage: trueDamage);
private static CardEffectSpec Shield(int amount) => new(CardEffectKind.Shield, amount);
private static CardEffectSpec Go(GoOperation operation, int amount = 0, int ticks = 0) =>
new(CardEffectKind.Go, amount, ticks, (int)operation, Language.Go);
private static CardEffectSpec Draw(int amount) => new(CardEffectKind.Draw, amount);
private static CardEffectSpec Py(PythonOperation operation, int amount = 0, bool all = false) =>
new(CardEffectKind.Python, amount, secondaryAmount: (int)operation, language: Language.Python, allEnemies: all);