public static string GetDisplay(this IEnumerable <Djinn> djinn, DjinnDetail detail)
        {
            var seperator = detail == DjinnDetail.Names ? ", " : "";
            var s         = string.Join(seperator, djinn.Select(d => $"{d.Emote}{(detail == DjinnDetail.Names ? $" {d.Name}" : "")}"));

            return(s.IsNullOrEmpty() ? "-" : s);
        }
Exemple #2
0
        public async Task DjinnInv(DjinnDetail detail = DjinnDetail.None)
        {
            var djinnPocket = UserAccounts.GetAccount(Context.User).DjinnPocket;
            var embed       = new EmbedBuilder();

            var equippedstring = string.Join("", djinnPocket.GetDjinns().Select(d => GoldenSun.ElementIcons[d.Element]));

            if (equippedstring.IsNullOrEmpty())
            {
                equippedstring = "-";
            }
            embed.AddField("Equipped", equippedstring);

            foreach (Element e in new[] { Element.Venus, Element.Mars, Element.Jupiter, Element.Mercury })
            {
                var djinnString = djinnPocket.djinn.OfElement(e).GetDisplay(detail);
                embed.AddField($"{e} Djinn", djinnString, true);
            }
            embed.WithFooter($"{djinnPocket.djinn.Count()}/{djinnPocket.PocketSize} Upgrade: {(djinnPocket.PocketUpgrades + 1) * 3000}");

            var summonString = string.Join(detail == DjinnDetail.Names ? ", " : "", djinnPocket.summons.Select(s => $"{s.Emote}{(detail == DjinnDetail.Names ? $" {s.Name}" : "")}"));

            if (summonString.IsNullOrEmpty())
            {
                summonString = "-";
            }
            embed.AddField("Summons", summonString);
            await ReplyAsync(embed : embed.Build());
        }
Exemple #3
0
        public async Task DjinnInv(DjinnDetail detail = DjinnDetail.None)
        {
            var djinnPocket = EntityConverter.ConvertUser(Context.User).DjinnPocket;
            var embed       = new EmbedBuilder();

            var equippedstring = string.Join("", djinnPocket.GetDjinns().Select(d => Emotes.GetIcon(d.Element)));

            if (equippedstring.IsNullOrEmpty())
            {
                equippedstring = "-";
            }
            embed.AddField("Equipped", equippedstring);

            foreach (var e in new[]
                     { Element.Venus, Element.Mars, Element.None, Element.Jupiter, Element.Mercury, Element.None })
            {
                if (e == Element.None)
                {
                    embed.AddField("\u200b", "\u200b", true);
                }
                else
                {
                    var djinnString = djinnPocket.Djinn.OfElement(e).GetDisplay(detail);
                    embed.AddField($"{e} Djinn", djinnString, true);
                }
            }

            var eventDjinn = djinnPocket.Djinn.Count(d => d.IsEvent);

            embed.WithFooter(
                $"{djinnPocket.Djinn.Count}/{djinnPocket.PocketSize}{(eventDjinn > 0 ? $"(+{eventDjinn})" : "")} Upgrade: {(djinnPocket.PocketUpgrades + 1) * 3000}");

            var summonString = string.Join(detail == DjinnDetail.Names ? ", " : "",
                                           djinnPocket.Summons.Select(s => $"{s.Emote}{(detail == DjinnDetail.Names ? $" {s.Name}" : "")}"));

            if (summonString.IsNullOrEmpty())
            {
                summonString = "-";
            }
            embed.AddField("Summons", summonString);
            await ReplyAsync(embed : embed.Build());
        }