public async Task ClassToggle([Remainder] string name = "") { var account = UserAccounts.GetAccount(Context.User); AdeptClassSeriesManager.TryGetClassSeries(account.GsClass, out AdeptClassSeries curSeries); var gotClass = AdeptClassSeriesManager.TryGetClassSeries(name, out AdeptClassSeries series); var embed = new EmbedBuilder().WithColor(Colors.Get(account.Element.ToString())); if (gotClass || name == "") { var success = SetClass(account, series?.Name ?? ""); if (curSeries.Name.Equals(series?.Name) || success) { await Context.Channel.SendMessageAsync(embed : embed .WithDescription($"You are {Article(account.GsClass)} {account.GsClass} now, {((SocketGuildUser)Context.User).DisplayName()}.") .Build()); return; } else { await Context.Channel.SendMessageAsync(embed : embed .WithDescription($":x: A {account.Element} Adept cannot get into the {series.Name}") .Build()); return; } } await Context.Channel.SendMessageAsync(embed : embed .WithDescription($":x: I could not find the {name} class in your available classes.") .Build()); }
public async Task ClassInfo([Remainder] string name = "") { if (name == "") { return; } if (AdeptClassSeriesManager.TryGetClassSeries(name, out AdeptClassSeries series)) { AdeptClass adeptClass = series.Classes.Where(c => c.Name.ToUpper() == name.ToUpper()).FirstOrDefault(); var embed = new EmbedBuilder(); embed.WithAuthor($"{adeptClass.Name} - {series.Archtype}"); embed.WithColor(Colors.Get(series.Elements.Select(s => s.ToString()).ToArray())); var relevantMoves = AdeptClassSeriesManager.GetMoveset(adeptClass).Where(m => m is Psynergy).ToList().ConvertAll(m => (Psynergy)m).ConvertAll(p => $"{p.Emote} {p.Name} `{p.PPCost}`"); embed.AddField("Description", series.Description ?? "-"); embed.AddField("Stats", adeptClass.StatMultipliers, true); embed.AddField("Elemental Stats", series.Elstats.ToString(), true); embed.AddField("Movepool", string.Join(" - ", relevantMoves)); embed.AddField($"Other Classes in {series.Name}", string.Join(", ", series.Classes.Select(s => s.Name)), true); embed.AddField("Elements", string.Join(", ", series.Elements.Select(e => e.ToString())), true); await Context.Channel.SendMessageAsync("", false, embed.Build()); if (Context.User is SocketGuildUser sgu) { _ = ServerGames.UserLookedUpClass(sgu, (SocketTextChannel)Context.Channel); } } else { return; } }
public async Task ClassToggle([Remainder] string name = "") { var account = EntityConverter.ConvertUser(Context.User); AdeptClassSeriesManager.TryGetClassSeries(account.GsClass, out AdeptClassSeries curSeries); var gotClass = AdeptClassSeriesManager.TryGetClassSeries(name, out AdeptClassSeries series); var embed = new EmbedBuilder().WithColor(Colors.Get(account.Element.ToString())); if (gotClass || name == "") { var success = SetClass(account, series?.Name ?? ""); series = AdeptClassSeriesManager.GetClassSeries(account); if (curSeries.Name.Equals(series?.Name) || success) { if (series != null && !account.DjinnPocket.DjinnSetup.All(d => series.Elements.Contains(d))) { account.DjinnPocket.DjinnSetup.Clear(); account.DjinnPocket.DjinnSetup.Add(account.Element); account.DjinnPocket.DjinnSetup.Add(account.Element); } UserAccountProvider.StoreUser(account); await Context.Channel.SendMessageAsync(embed : embed .WithDescription($"You are {Article(account.GsClass)} {account.GsClass} now, {account.Name}.") .Build()); return; } else { await Context.Channel.SendMessageAsync(embed : embed .WithDescription($":x: A {account.Element} Adept cannot get into the {series.Name}") .Build()); return; } } await Context.Channel.SendMessageAsync(embed : embed .WithDescription($":x: I could not find the {name} class in your available classes.") .Build()); }