namespace Aeshnidae.ResonanceAuras; /// /// The auras' page in the Aeshnidae Codex. Found by Aeshnidae.Codex through /// reflection (a static class called CodexPage with Title and Pages(Player)), so /// nothing here references that mod. Ragged text on purpose: the book font is /// proportional. /// public static class CodexPage { public static string Title => "Resonance Auras"; public static string[] Pages(Player player) { if (player is null || !AuraDb.Ready) return Array.Empty(); var banked = player.Account is null ? 0 : AuraDb.ResonanceBalance(player.Account.AccountId); var first = new StringBuilder(); first.AppendLine("RESONANCE AURAS"); first.AppendLine(); first.AppendLine($"Small, permanent conveniences bought with Resonance. Rank n of any aura costs {Mod.Settings.RankPriceBase:N0} x n. They survive enlightenment."); first.AppendLine(); first.AppendLine($"Banked Resonance: {banked:N0}"); first.AppendLine(); foreach (var aura in Aura.All) { if (aura.MaxRanks == 0) continue; var ranks = Auras.RanksOf(player, aura.Key); first.AppendLine($"{aura.Name}: {ranks} of {aura.MaxRanks}" + (ranks < aura.MaxRanks ? $", next {aura.PriceOfRank(ranks + 1):N0}" : "")); } first.AppendLine(); first.AppendLine("/aura says what one does; /aura buy buys the next rank."); var second = new StringBuilder(); second.AppendLine("WHAT EACH RANK DOES"); second.AppendLine(); foreach (var aura in Aura.All) { if (aura.MaxRanks == 0) continue; second.AppendLine($"{aura.Name}: {aura.PerRank}."); } return new[] { first.ToString().TrimEnd(), second.ToString().TrimEnd() }; } }