Example #1
0
            public async Task SetSpecialAsync(int str, int per, int end, int cha, int inte, int agi, int luc)
            {
                var userInfo  = Context.User;
                var character = await _charService.GetCharacterAsync(userInfo.Id);

                var special = new int[] { str, per, end, cha, inte, agi, luc };

                if (character == null)
                {
                    await ReplyAsync(string.Format(Messages.ERR_CHAR_NOT_FOUND, userInfo.Mention));

                    return;
                }

                if (_specService.IsSpecialSet(character))
                {
                    await ReplyAsync(string.Format(Messages.ERR_SPECIAL_ALREADY_SET, userInfo.Mention));

                    return;
                }

                try
                {
                    await _specService.SetInitialSpecialAsync(character, special);
                    await ReplyAsync(string.Format(Messages.SPECIAL_SET_SUCCESS, userInfo.Mention));
                }
                catch (Exception e)
                {
                    await ReplyAsync($"{Messages.FAILURE_EMOJI} {e.Message} ({userInfo.Mention})");
                }
            }
Example #2
0
            public async Task <RuntimeResult> SetSpecialAsync(Special special, int amount)
            {
                var userInfo  = Context.User;
                var character = await _charService.GetCharacterAsync(userInfo.Id);

                if (character == null)
                {
                    return(CharacterResult.CharacterNotFound());
                }
                if (character.Level > 1 && _specService.IsSpecialSet(character))
                {
                    return(StatisticResult.SpecialAlreadySet());
                }

                return(await _specService.SetInitialSpecialAsync(character, special, amount));
            }