Implement more QoL features and rebalances
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using KernelPanic.Combat;
|
||||
using KernelPanic.Run;
|
||||
using UnityEngine.UIElements;
|
||||
@@ -10,9 +11,40 @@ namespace KernelPanic.UI
|
||||
{
|
||||
public static VisualElement Build(RunManager run, CombatManager combat)
|
||||
{
|
||||
var section = TerminalLayout.Section(run.CampaignChoicePending ? "KERNEL SECURED" : "Next route", "RunRouteChoices");
|
||||
var section = TerminalLayout.Section(run.CampaignChoicePending ? "KERNEL SECURED" : "Route", "RunRouteChoices");
|
||||
section.AddToClassList("run-route-section");
|
||||
if (!string.IsNullOrEmpty(run.Journey.lastReward)) section.Add(TerminalLayout.BodyText(run.Journey.lastReward));
|
||||
if (run.BuildRewardPending)
|
||||
{
|
||||
section.Add(TerminalLayout.BodyText("Build reward / choose one before departure. Upgrade a card for this run, or take Bits to spend freely."));
|
||||
var cards = run.RunDeck.Where(card => card.Definition != null && !card.Definition.IsToken && !card.Definition.IsJunk).ToList();
|
||||
if (cards.Count > 0)
|
||||
{
|
||||
int selected = 0;
|
||||
var target = TerminalLayout.BodyText("", "BuildRewardTarget");
|
||||
section.Add(target);
|
||||
var navigation = new VisualElement();
|
||||
navigation.AddToClassList("reward-target-navigation");
|
||||
section.Add(navigation);
|
||||
section.Add(Action($"Upgrade effect +{CombatTuning.UpgradeMagnitudeBonus}", "RewardMagnitude",
|
||||
() => run.ClaimBuildReward(cards[selected], CardUpgradeKind.MagnitudeUp)));
|
||||
var draw = Action("Add draw 1 on resolution", "RewardDraw",
|
||||
() => run.ClaimBuildReward(cards[selected], CardUpgradeKind.DrawRider));
|
||||
void Select(int offset)
|
||||
{
|
||||
selected = (selected + offset + cards.Count) % cards.Count;
|
||||
var card = cards[selected];
|
||||
target.text = $"Target {selected + 1}/{cards.Count}: {card.Definition.DisplayName}\n+{card.MagnitudeBonus} effect / +{card.DrawRider} draw";
|
||||
draw.SetEnabled(card.DrawRider == 0);
|
||||
}
|
||||
navigation.Add(Action("Previous card", "RewardPrevious", () => Select(-1)));
|
||||
navigation.Add(Action("Next card", "RewardNext", () => Select(1)));
|
||||
Select(0);
|
||||
section.Add(draw);
|
||||
}
|
||||
section.Add(Action($"Take {RunManager.BuildRewardBits} Bits", "RewardBits",
|
||||
() => run.ClaimBuildReward(null, CardUpgradeKind.MagnitudeUp, true)));
|
||||
}
|
||||
if (run.CampaignChoicePending)
|
||||
{
|
||||
section.Add(TerminalLayout.BodyText("Five waves cleared. Finish this campaign and bank your rewards, or keep this build running in endless mode. Rewards are saved when the run ends."));
|
||||
@@ -20,17 +52,17 @@ namespace KernelPanic.UI
|
||||
section.Add(Action("Continue into endless", "ContinueEndlessButton", () => combat.ContinueEndless()));
|
||||
return section;
|
||||
}
|
||||
var plan = EncounterDirector.Plan(run.CurrentWaveNumber, run.Journey.selectedRoute);
|
||||
section.Add(TerminalLayout.BodyText($"Wave {run.CurrentWaveNumber}: {plan.Title}"));
|
||||
section.Add(TerminalLayout.BodyText(plan.Advice));
|
||||
var plan = EncounterDirector.Plan(run.CurrentWaveNumber, run.Journey.selectedRoute,
|
||||
run.CurrentConfig.RunSeed, run.Journey.encounterRevision);
|
||||
var choices = new VisualElement();
|
||||
choices.AddToClassList("route-choices");
|
||||
AddChoice(choices, run, WaveRoute.Repair, "Repair stop",
|
||||
$"Restore up to {RunJourney.RepairUptime} Uptime on departure. Fight the standard encounter.");
|
||||
AddChoice(choices, run, WaveRoute.Challenge, "Elite detour",
|
||||
$"An extra elite Daemon joins the encounter. On clear: +{RunJourney.ChallengeBits} Bits and +1 draw on the first eligible deck card without a draw rider; +{RunJourney.ChallengeBits} extra Bits if none qualify.");
|
||||
$"Extra Daemon. On clear: +{RunJourney.ChallengeBits} Bits and +1 draw on the first card without a draw rider (or +{RunJourney.ChallengeBits} Bits if none)."
|
||||
+ (run.Journey.selectedRoute == WaveRoute.Challenge
|
||||
? $"\nElite: {(plan.EscortShield > 0 ? $"+{plan.EscortShield} Shield" : plan.EscortUptime > 0 ? $"+{plan.EscortUptime} Uptime" : "hidden intent")}." : ""));
|
||||
section.Add(choices);
|
||||
section.Add(TerminalLayout.BodyText("Choose freely before booting. Repairs and difficulty apply only when you leave; the elite reward requires clearing the wave."));
|
||||
return section;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user