private async Task <RuntimeResult> ShowSpecialAsync(IUser targetUser = null, bool useEffects = false) { var userInfo = Context.User; var character = targetUser == null ? await _charService.GetCharacterAsync(userInfo.Id) : await _charService.GetCharacterAsync(targetUser.Id); if (character == null) { return(CharacterResult.CharacterNotFound()); } var stats = character.Statistics; if (useEffects) { stats = _effectsService.GetEffectiveStatistics(character); } StringBuilder message = new StringBuilder($"**Name:** {character.Name}\n"); foreach (var special in stats.Where(x => x.Statistic is Special).OrderBy(x => x.Statistic.Id)) { message.Append($"**{special.Statistic.Name}:** {special.Value}\n"); } if (!_specService.IsSpecialSet(character)) { message.Append($"*You have {character.SpecialPoints} S.P.E.C.I.A.L. points left to spend!*"); } var embed = EmbedHelper.BuildBasicEmbed("Command: $special", message.ToString()); await ReplyAsync(userInfo.Mention, embed : embed); return(GenericResult.FromSilentSuccess()); }
private async Task <RuntimeResult> ShowSkillsAsync(IUser targetUser = null, bool useEffects = false) { var userInfo = Context.User; var character = targetUser == null ? await _charService.GetCharacterAsync(userInfo.Id) : await _charService.GetCharacterAsync(targetUser.Id); if (character == null) { return(CharacterResult.CharacterNotFound()); } bool skillsSet = _skillsService.AreSkillsSet(character); var stats = character.Statistics; if (useEffects) { stats = _effectsService.GetEffectiveStatistics(character); } StringBuilder message = new StringBuilder($"**Name:** {character.Name}\n"); foreach (var special in SpecialService.Specials.OrderBy(x => x.Id)) { message.Append($"__**{special.Name}:**__\n"); foreach (var skill in stats.Where(x => x.Statistic is Skill sk && sk.Special.Equals(special)).OrderBy(x => x.Statistic.Name)) { if (skillsSet || !_progOptions.UseOldProgression) { if (skill.Value == 0) { continue; } message.Append($"**{skill.Statistic.Name}:** {skill.Value}\n"); } else { message.Append($"*{skill.Statistic.Name}*, "); } } message.Append($"\n"); } if (skillsSet) { if (character.ExperiencePoints > 0) { message.Append($"*You have {character.ExperiencePoints}XP left to spend! ($char skills spend)*"); } } else { if (!_progOptions.OldProgression.UseNewVegasRules) { message.Append($"*You have {character.TagPoints} Tag points left to spend!*"); } } var embed = EmbedHelper.BuildBasicEmbed("Command: $skills", message.ToString()); await ReplyAsync(userInfo.Mention, embed : embed); return(GenericResult.FromSilentSuccess()); }