Exemplo n.º 1
0
        /// <summary>
        /// Returns the value of the specified character's given special.
        /// </summary>
        /// <returns>Returns 0 if character or special values are null.</returns>
        public int GetSpecial(Character character, Globals.SpecialType special)
        {
            if (character == null || !IsSpecialSet(character))
            {
                return(0);
            }

            return((int)typeof(Special).GetProperty(special.ToString()).GetValue(character.Special));
        }
Exemplo n.º 2
0
        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)));
        }
Exemplo n.º 3
0
        public async Task CheckSpecial(IUser user, Globals.SpecialType special, int minimum)
        {
            var character = await _charService.GetCharacterAsync(user.Id);

            if (character == null)
            {
                await ReplyAsync(String.Format(Messages.ERR_CHAR_NOT_FOUND, user.Username));

                return;
            }
            if (!_specialService.IsSpecialSet(character))
            {
                await ReplyAsync(String.Format(Messages.ERR_SPECIAL_NOT_FOUND, user.Username));

                return;
            }

            int specialValue = _specialService.GetSpecial(character, special);

            await ReplyAsync(GetCheckMessage(character.Name, special.ToString(), specialValue, minimum));
        }