Beispiel #1
0
            public async Task <RuntimeResult> SetSkillsAsync(Skill tag, int points)
            {
                if (ExperienceService.UseOldProgression)
                {
                    return(StatisticResult.UsingOldProgression());
                }

                var userInfo  = Context.User;
                var character = await _charService.GetCharacterAsync(userInfo.Id);

                if (character == null)
                {
                    return(CharacterResult.CharacterNotFound());
                }
                if (_skillsService.AreSkillsSet(character))
                {
                    return(StatisticResult.SkillsAlreadyTagged());
                }

                try
                {
                    await _skillsService.TagSkill(character, tag, points);

                    return(GenericResult.FromSuccess(Messages.SKILLS_SET_SUCCESS));
                }
                catch (Exception e)
                {
                    return(GenericResult.FromError($"{Messages.FAILURE_EMOJI} {e.Message}"));
                }
            }