Implement more QoL features and rebalances

This commit is contained in:
2026-10-25 02:16:30 +02:00
parent 0578913451
commit 53f831d91e
220 changed files with 14700 additions and 420 deletions
+50 -32
View File
@@ -30,7 +30,7 @@ namespace KernelPanic.Run
public CardInstance Card { get; private set; }
public EnemyInstance Enemy { get; private set; }
public bool CanEndTurn => !Active || Step.Action == TutorialAction.EndTurn;
private ResolutionTrack ExpectedTrack => _lesson == 1 ? ResolutionTrack.Native
private ResolutionTrack ExpectedTrack => _lesson != 2 ? ResolutionTrack.Native
: Step?.Id.Contains("haskell") == true ? ResolutionTrack.LazyStack : ResolutionTrack.InterpreterQueue;
public TutorialGuide(int lesson) { _lesson = lesson; _steps = Build(lesson); }
@@ -68,6 +68,8 @@ namespace KernelPanic.Run
if (Step.Id == "target-zombie" && Enemy?.PendingRevive == true) Advance(combat);
else if (Step.Id == "finish-zombie" && Enemy?.HasRevived == true && Enemy.State.IsDefeated) Advance(combat);
}
else if (_lesson == 3)
{ if (_resolved && Enemy?.IntentRevealed == true) Advance(combat); }
else if (_played && (Queued(combat) || _resolved)) Advance(combat);
break;
case TutorialAction.PlayShield:
@@ -101,10 +103,12 @@ namespace KernelPanic.Run
{
if (!Active) return;
if (Enemy == null)
Enemy = combat.Enemies.FirstOrDefault(enemy => _lesson != 1 || enemy.ArchetypeId == "zombie_process");
Enemy = combat.Enemies.FirstOrDefault(enemy => _lesson == 1 ? enemy.ArchetypeId == "zombie_process"
: _lesson == 3 ? enemy.ArchetypeId == "daemon" : true);
if (Card != null || combat.HandController == null) return;
string id = _lesson == 1 ? Step.Id is "shield-card" or "shield-result" ? "lang_rs_borrow"
: Index >= 13 ? "lang_rs_fn_main" : "lang_rs_unwrap" : null;
: Index >= 13 ? "lang_rs_fn_main" : "lang_rs_unwrap"
: _lesson == 3 ? Step.Action == TutorialAction.PlayShield ? "lang_rs_borrow" : "lang_rs_fn_main" : null;
Card = combat.HandController.Cards.FirstOrDefault(card => !card.IsBroken && !card.IsLocked
&& (id != null ? card.Definition.Id == id : card.Definition.ResolutionTrack == ExpectedTrack)
&& combat.GetDisplayedPlayCost(card) <= combat.PlayerState.Cycles);
@@ -112,39 +116,53 @@ namespace KernelPanic.Run
public static IReadOnlyList<TutorialStep> Build(int lesson)
{
if (lesson == 3) return new[] {
new TutorialStep("cron", "Cron Job / scheduled damage", "Countdown 2 means two enemy turns before its heavy attack is ready. Use that time to prepare.", "enemy:cron_job"),
new TutorialStep("daemon", "Miniboss / Daemon", "Surge: 8-10 damage. Harden: 6-8 Shield. Bypass: 3-4 through Shield. Hit it to reveal which action is coming.", "enemy:daemon"),
new TutorialStep("select-reveal", "Expose the miniboss", "Select fn main(). This Native attack deals damage immediately.", "card", TutorialAction.SelectCard),
new TutorialStep("target-daemon", "Hit the Daemon", "Click the Daemon to reveal what it plans to do.", "enemy", TutorialAction.TargetEnemy),
new TutorialStep("revealed-daemon", "Exposed for this round", "Shield stops Surge, not Bypass. Harden deals no damage. Its next action will be hidden again; hit it each round to reveal.", "enemy:daemon"),
new TutorialStep("countdown-turn", "Watch the timer", "End turn. Daemon carries out its revealed action; Cron Job counts down.", "TutorialEndTurn", TutorialAction.EndTurn),
new TutorialStep("cron-ticking", "One turn left", "Cron Job shows countdown 1. Daemon has hidden its new action again.", "enemy:cron_job"),
new TutorialStep("countdown-ready", "Let the timer expire", "End turn once more. Watch Cron Job's countdown become an attack intent.", "TutorialEndTurn", TutorialAction.EndTurn),
new TutorialStep("cron-armed", "Heavy attack ready", "Cron Job will hit on the next End turn. Defeat it first, or prepare Shield for the displayed damage.", "enemy:cron_job"),
new TutorialStep("shield-cron", "Prepare a defense", "Play borrow() to help absorb Cron Job's hit. Remember: Daemon's Bypass ignores Shield.", "card", TutorialAction.PlayShield),
new TutorialStep("practice", "Clear the final wave", "Finish both enemies. Cron Job resets to countdown 2 after attacking. Clear this wave to claim your training rewards.", "enemies")
};
if (lesson < 1 || lesson > TutorialCampaign.LessonCount) throw new ArgumentOutOfRangeException(nameof(lesson));
if (lesson == 1) return new[] {
new TutorialStep("uptime", "This is your Uptime", "Uptime is your health. At 0, a normal run ends. This practice uses loan cards, full health and no distro passive procs; your collection is safe.", "TutorialUptime"),
new TutorialStep("shield", "Shield protects Uptime", "Shield absorbs ordinary incoming damage first. This number shows how much protection you currently have.", "TutorialShield"),
new TutorialStep("cycles", "Cycles pay for cards", "This is your remaining card budget. The cost in a card's upper-right corner is paid when you play it. Cycles refresh each round.", "TutorialCycles"),
new TutorialStep("ram", "RAM is hand capacity", "This shows used RAM / capacity. Most cards use 1 RAM; Java uses 2. More Cycles do not let extra cards fit in a full hand.", "TutorialRam"),
new TutorialStep("attack-card", "Read your attack card", "unwrap() costs Cycles and deals damage immediately: it is Native. Its rules and current estimate are printed here. Rust overkill can also grant Shield.", "card"),
new TutorialStep("intent", "Read the enemy's intent", "This is what Zombie Process plans to do when enemies act. Check the attack range before ending your turn.", "zombie-intent"),
new TutorialStep("select-attack", "1 / Select the attack", "Click the highlighted unwrap() card first. Selecting a targeted card asks for an enemy; it does not spend Cycles yet.", "card", TutorialAction.SelectCard),
new TutorialStep("target-zombie", "2 / Choose the zombie", "Now click Zombie Process to dispatch your selected card. Other targets and End turn are locked for this demonstration.", "zombie", TutorialAction.TargetEnemy),
new TutorialStep("pending-revival", "Zero Uptime, but not gone", "Your attack reduced the zombie to 0. RESTART PENDING means it will revive next round. A fresh zombie can do this once; finishing it from 30% Uptime or less reaps it instead.", "zombie"),
new TutorialStep("end-turn", "3 / End your turn", "Click End turn (or press E). The remaining enemy acts, then the next round begins and the zombie revives. Watch its Uptime.", "TutorialEndTurn", TutorialAction.EndTurn),
new TutorialStep("revived", "The zombie has respawned", "It has returned at half Uptime. RESTART USED means it cannot revive again. Your Cycles also refreshed for this round.", "zombie"),
new TutorialStep("shield-card", "4 / Add protection", "Click borrow() to gain Shield now. It needs no enemy target. Any Shield you already have from Rust overkill is kept.", "card", TutorialAction.PlayShield),
new TutorialStep("shield-result", "Your Shield increased", "That card added protection to this number. Shield is not healing: it absorbs damage before your Uptime is reduced.", "TutorialShield"),
new TutorialStep("select-finisher", "5 / Select a finisher", "Select the highlighted fn main() card. Then you will choose the revived zombie as its target.", "card", TutorialAction.SelectCard),
new TutorialStep("finish-zombie", "6 / Finish the revived zombie", "Click the zombie again. Its revival is already spent, so this attack can terminate it permanently.", "zombie", TutorialAction.TargetEnemy),
new TutorialStep("piles", "Track your cards", "Played cards go to discard; an empty draw pile reshuffles discard. Exhausted cards stay out for this wave. These counters open pile inspectors.", "TutorialPiles"),
new TutorialStep("practice", "Finish the encounter", "You have practiced targeting, revival and Shield. Clear the remaining orphan processes on your own. Use card → enemy, and End turn when needed. A zombie can leave an orphan when permanently defeated.", "enemies")
new TutorialStep("uptime", "This is your Uptime", "Uptime is your health. At 0, the run ends. These loan cards keep your collection safe.", "TutorialUptime"),
new TutorialStep("shield", "Shield protects Uptime", "Shield absorbs ordinary damage before Uptime. This number is your current protection.", "TutorialShield"),
new TutorialStep("cycles", "Cycles pay for cards", "Cycles pay card costs. Your budget refreshes each round.", "TutorialCycles"),
new TutorialStep("ram", "RAM is hand capacity", "Used RAM / capacity. Most cards use 1 RAM; Java uses 2. Free RAM lets you hold more cards.", "TutorialRam"),
new TutorialStep("attack-card", "Read your attack card", "unwrap() deals damage immediately: it is Native. Read its cost and effect here.", "card"),
new TutorialStep("intent", "Read the enemy's intent", "This is Zombie Process's next action. Check the attack range before ending your turn.", "zombie-intent"),
new TutorialStep("select-attack", "1 / Select the attack", "Click unwrap(). Selecting a targeted card does not spend Cycles yet.", "card", TutorialAction.SelectCard),
new TutorialStep("target-zombie", "2 / Choose the zombie", "Click Zombie Process to dispatch your selected attack.", "zombie", TutorialAction.TargetEnemy),
new TutorialStep("pending-revival", "Zero Uptime, but not gone", "RESTART PENDING: this zombie will revive once. A killing hit from 30% Uptime or less prevents revival.", "zombie"),
new TutorialStep("end-turn", "3 / End your turn", "Press End turn (or E). Watch the zombie return when the next round begins.", "TutorialEndTurn", TutorialAction.EndTurn),
new TutorialStep("revived", "The zombie has respawned", "RESTART USED: it returned at half Uptime and cannot revive again. Your Cycles have refreshed.", "zombie"),
new TutorialStep("shield-card", "4 / Add protection", "Click borrow() to gain Shield. No target needed; existing Shield is kept.", "card", TutorialAction.PlayShield),
new TutorialStep("shield-result", "Your Shield increased", "Your Shield increased. It absorbs damage, but does not heal Uptime.", "TutorialShield"),
new TutorialStep("select-finisher", "5 / Select a finisher", "Select fn main(), then choose the revived zombie.", "card", TutorialAction.SelectCard),
new TutorialStep("finish-zombie", "6 / Finish the revived zombie", "Click the zombie. Its revival is spent, so this hit can terminate it permanently.", "zombie", TutorialAction.TargetEnemy),
new TutorialStep("piles", "Track your cards", "Played cards go to discard; an empty draw pile reshuffles it. Exhausted cards stay out for this wave.", "TutorialPiles"),
new TutorialStep("practice", "Finish the encounter", "Finish the orphan processes. Use card → enemy, then End turn as needed. A defeated zombie can leave an orphan.", "enemies")
};
return new[] {
new TutorialStep("leak", "A new threat: Memory Leak", "This enemy grows stronger each round and applies damage-over-time stacks. Your health and purchased upgrade carried over from wave one.", "enemy:memory_leak"),
new TutorialStep("firewall", "A protector: firewalld", "firewalld shields itself and adjacent processes. Read its intent before choosing which enemy to remove first.", "enemy:firewalld"),
new TutorialStep("queue-intro", "Python uses the queue", "Python waits until End turn. Its cards resolve oldest first (FIFO). Let's put a real card into this queue.", "TutorialQueue"),
new TutorialStep("select-python", "Select the Python card", "Click the highlighted Python card. print() chooses its target when it resolves, so it does not ask you to click an enemy.", "card", TutorialAction.SelectCard),
new TutorialStep("leak", "A new threat: Memory Leak", "Memory Leak grows stronger each round and applies damage over time. Your purchased patch carried over.", "enemy:memory_leak"),
new TutorialStep("firewall", "A protector: firewalld", "firewalld shields itself and its neighbors. Check its intent before choosing a target.", "enemy:firewalld"),
new TutorialStep("queue-intro", "Python uses the queue", "Python waits until End turn. Oldest queued card resolves first (FIFO).", "TutorialQueue"),
new TutorialStep("select-python", "Select the Python card", "Click print(). It chooses a target when it resolves, so no enemy click is needed.", "card", TutorialAction.SelectCard),
new TutorialStep("target-python", "Select a target", "Click the highlighted enemy to complete this play.", "enemy", TutorialAction.TargetEnemy),
new TutorialStep("queued-python", "Python is waiting here", "Your card is now queued, not resolved. With multiple entries, the oldest would execute first.", "TutorialQueue"),
new TutorialStep("stack-intro", "Haskell uses the stack", "Haskell waits until after Python and resolves newest first (LIFO). Each entry captures a multiplier for damage and explicit Shield.", "TutorialStack"),
new TutorialStep("select-haskell", "Select the Haskell card", "Click the highlighted thunk() card, then select the highlighted enemy.", "card", TutorialAction.SelectCard),
new TutorialStep("target-haskell", "Choose its target", "Click this enemy. The attack will wait on the stack rather than dealing damage immediately.", "enemy", TutorialAction.TargetEnemy),
new TutorialStep("queued-haskell", "Both tracks are ready", "Python will resolve first, then Haskell, then surviving enemies. A defeated target can cause deferred damage to retarget.", "TutorialStack"),
new TutorialStep("end-round", "Run the queued actions", "Click End turn (or press E). Watch the queue resolve before the stack. We will continue when the exchange finishes.", "TutorialEndTurn", TutorialAction.EndTurn),
new TutorialStep("resolved", "The waiting cards resolved", "The scheduler has executed the deferred cards. Check enemy Uptime, Shield and intents before choosing your next move.", "enemies"),
new TutorialStep("practice", "Clear wave two", "Finish every remaining enemy on your own. Clearing this wave completes training and unlocks 1,000 Bandwidth plus 1,000 Entropy: enough for a standard 10-pull.", "enemies")
new TutorialStep("queued-python", "Python is waiting here", "The card is queued, not resolved. With multiple entries, the oldest executes first.", "TutorialQueue"),
new TutorialStep("stack-intro", "Haskell uses the stack", "Haskell resolves after Python, newest first (LIFO). Its entry multiplier scales damage and Shield.", "TutorialStack"),
new TutorialStep("select-haskell", "Select the Haskell card", "Click thunk(), then choose the highlighted enemy.", "card", TutorialAction.SelectCard),
new TutorialStep("target-haskell", "Choose its target", "Click this enemy. Your attack will wait on the stack.", "enemy", TutorialAction.TargetEnemy),
new TutorialStep("queued-haskell", "Both tracks are ready", "Order: Python queue → Haskell stack → surviving enemies. Deferred attacks can retarget defeated enemies.", "TutorialStack"),
new TutorialStep("end-round", "Run the queued actions", "Press End turn (or E). Watch Python resolve before Haskell.", "TutorialEndTurn", TutorialAction.EndTurn),
new TutorialStep("resolved", "The waiting cards resolved", "The waiting cards resolved. Check enemy Uptime, Shield and intents.", "enemies"),
new TutorialStep("practice", "Clear wave two", "Finish the remaining enemies. Next: Cron Job's countdown and a Daemon miniboss.", "enemies")
};
}
}