Add NixOS and Go
This commit is contained in:
@@ -63,6 +63,13 @@ namespace KernelPanic.UI
|
||||
private PackageSlot? _packageInventoryFilter;
|
||||
|
||||
public event Action ViewChanged;
|
||||
public event Action<Language> LanguageTrainingRequested;
|
||||
|
||||
public void ShowLanguage(Language language)
|
||||
{
|
||||
_selectedLanguageIndex = _languages.ToList().FindIndex(entry => entry.Language == language);
|
||||
ShowLanguages();
|
||||
}
|
||||
|
||||
public void Bind(VisualElement root, FontAsset artFont, LanguageDeckDatabase deckDatabase, CardDatabase cardsDatabase, PlayerCollection collection, Func<DistroDefinition, int> getMergesBalance = null, Func<DistroDefinition, VersionUpgradeResult> tryUpgradeUnit = null, PackageDatabase packageDatabase = null, PackageLoadout packageLoadout = null, Action packageLoadoutChanged = null, Func<SaveData> getSaveData = null, Func<OwnedPackageInstance, PackageUpgradeResult> tryUpgradePackage = null, Func<OwnedPackageInstance, PackageScrapResult> tryScrapPackage = null)
|
||||
{
|
||||
@@ -1699,6 +1706,18 @@ namespace KernelPanic.UI
|
||||
}
|
||||
|
||||
_detail.Add(BuildSubviewCommand($"cat ~/lang/{GetLanguageId(language.Language)}/deck", "starter deck", true, () => OpenLanguageDeck(language), null));
|
||||
if (LanguageTraining.IsSupported(language.Language))
|
||||
{
|
||||
var learn = new Button(() =>
|
||||
{
|
||||
if (LanguageUnlock.IsUnlocked(language.Language, _playerCollection))
|
||||
LanguageTrainingRequested?.Invoke(language.Language);
|
||||
}) { name = "LearnLanguageButton", text = "Learn more / practice fight" };
|
||||
learn.AddToClassList("terminal-button");
|
||||
_detail.Add(learn);
|
||||
_detail.Add(TerminalLayout.BodyText("Learn the basics by playing a guided fight. You can retry or leave without changing your saved campaign."));
|
||||
}
|
||||
else _detail.Add(TerminalLayout.BodyText("Practice fight unavailable: this language's playable cards are still planned."));
|
||||
}
|
||||
|
||||
private void OpenUnitCards(DistroDefinition unit)
|
||||
@@ -1908,7 +1927,7 @@ namespace KernelPanic.UI
|
||||
return row;
|
||||
}
|
||||
|
||||
private static void AddPassiveDetails(VisualElement target, DistroDefinition unit)
|
||||
private void AddPassiveDetails(VisualElement target, DistroDefinition unit)
|
||||
{
|
||||
if (unit.Passive == null)
|
||||
{
|
||||
@@ -1918,6 +1937,17 @@ namespace KernelPanic.UI
|
||||
VisualElement passive = TerminalLayout.Section(unit.Passive.Name,
|
||||
sectionClass: "unit-info-section unit-passive-section", headingClass: "detail-section-title");
|
||||
Label passiveRules = TerminalLayout.BodyText(unit.Passive.RulesText, className: "collection-detail-description");
|
||||
if (unit.Id == "nixos")
|
||||
{
|
||||
var policy = new NixGovernorState(); policy.BeginWave(GetUnitVersion(unit));
|
||||
passiveRules.name = "NixCurrentPolicy";
|
||||
passiveRules.text = "Start each wave in schedutil. Switch once per player turn.\n"
|
||||
+ string.Join("\n", Enum.GetValues(typeof(NixGovernor)).Cast<NixGovernor>().Select(governor =>
|
||||
$"{governor.ToString().ToLowerInvariant()}: {policy.DamageFor(governor)-100:+0;-0;0}% card damage / {policy.ShieldFor(governor)-100:+0;-0;0}% card Shield"))
|
||||
+ (policy.Version >= 3 ? "\nFirst successful switch each wave is free; later switches cost 1 Cycle." : "\nSwitch cost: 1 Cycle.")
|
||||
+ "\nModifiers apply when card effects resolve."
|
||||
+ (policy.Version >= 5 ? "\nSpecialisation on switch: performance deals 5 damage, powersave grants 6 Shield, schedutil draws 1. These bonuses are unscaled." : "");
|
||||
}
|
||||
passive.Add(passiveRules);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(unit.Passive.FlavorText))
|
||||
|
||||
Reference in New Issue
Block a user