/// <summary> /// Set character's tag skills. /// </summary> public async Task SetTagSkills(Character character, string tag1, string tag2, string tag3) { if (character == null) { throw new ArgumentNullException("character"); } if (!_specService.IsSpecialSet(character)) { throw new Exception(Exceptions.CHAR_SPECIAL_NOT_FOUND); } if (!IsValidSkillName(tag1) || !IsValidSkillName(tag2) || !IsValidSkillName(tag3)) { throw new ArgumentException(Exceptions.CHAR_INVALID_TAG_NAMES); } if (!AreUniqueTags(tag1, tag2, tag3)) { throw new ArgumentException(Exceptions.CHAR_TAGS_NOT_UNIQUE); } InitializeSkills(character); SetTagSkill(character, tag1); SetTagSkill(character, tag2); SetTagSkill(character, tag3); await _charService.SaveCharacterAsync(character); }
public async Task <string> GetSpRollAsync(IUser user, Globals.SpecialType specialToRoll) { var character = await _charService.GetCharacterAsync(user.Id); if (character == null) { return(String.Format(Messages.ERR_CHAR_NOT_FOUND, user.Mention)); } if (!_specService.IsSpecialSet(character)) { return(String.Format(Messages.ERR_SPECIAL_NOT_FOUND, user.Mention)); } return(GetRollMessage(character.Name, specialToRoll.ToString(), GetRollResult(specialToRoll, character))); }