public async Task ListSkillMod(string skillName = null, [Remainder] string name = null) { DnDPlayerCharacter player = await GetPlayerOrCurrent(name, false); if (player != null) { EmbedBuilder builder = new EmbedBuilder(); DnDCharacterSkills skill = GetSkill(skillName); if ((int)skill == -1) { builder.WithTitle("List of all active skill modifiers"); int i = 0; DnDCharacterSkills lastSkill = DnDCharacterSkills.Athletics; foreach (DnDSkillModDescriptor descriptor in player.BasicInfo.SkillMods.OrderBy((smd) => smd.SkillMod.Skill)) { if (descriptor.SkillMod.Skill != lastSkill) { i = 0; lastSkill = descriptor.SkillMod.Skill; } builder.Description += lastSkill.ToString().ToUpper().Substring(0, 4) + " " + (i + 1) + ": " + descriptor.SourceDescription + " (" + descriptor.SkillMod.Modifier.ShowSign() + ")\n"; i++; } } else { builder.WithTitle("List of active " + skill.ToString().ToLowerInvariant() + " modifiers"); int i = 0; foreach (DnDSkillModDescriptor descriptor in player.BasicInfo.SkillMods.Where((smd) => smd.SkillMod.Skill == skill)) { builder.Description += (i + 1) + ": " + descriptor.SourceDescription + " (" + descriptor.SkillMod.Modifier.ShowSign() + ")\n"; i++; } } if (string.IsNullOrEmpty(builder.Description)) { builder.Description = "None"; } await ReplyAsync(embed : builder.Build()); } }
public async Task DeleteSkillProficiency(string skillName, [Remainder] string name = null) { DnDPlayerCharacter player = await GetPlayerOrCurrent(name); if (player != null) { DnDCharacterSkills skill = GetSkill(skillName); if ((int)skill == -1) { await ReplyAsync("Invalid skill! Valid: athl, acro, slei, stea, arca, hist, inve, natu, reli, anim, insi, medi, perc, surv, dece, inti, perf, pers"); return; } DnDBasicCharacterInfo basicInfo = player.BasicInfo; if (!basicInfo.SkillProficiencies.Contains(skill)) { await ReplyAsync(player.Name + " does not have a proficiency in " + skill.ToString().ToLowerInvariant() + "!"); return; } basicInfo.SkillProficiencies.Remove(skill); player.BasicInfo = basicInfo; await ReplyAsync("Successfully deleted skill proficiency."); } }