Ejemplo n.º 1
0
        public async Task ShowCharacterAsync(IUser targetUser = null)
        {
            var userInfo  = Context.User;
            var character = targetUser == null
                ? await _charService.GetCharacterAsync(userInfo.Id)
                : await _charService.GetCharacterAsync(targetUser.Id);

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

                return;
            }

            var level          = _expService.CalculateLevelForExperience(character.Experience);
            var expToNextLevel = _expService.CalculateRemainingExperienceToNextLevel(character.Experience);

            var description = string.IsNullOrEmpty(character.Description) ? "No description." : character.Description;
            var story       = string.IsNullOrEmpty(character.Story) ? "No story." : character.Story;

            var embed = EmbedHelper.BuildBasicEmbed($"{character.Name}",
                                                    $"**Description:** {description}\n" +
                                                    $"**Story:** ($char story)\n" +
                                                    $"**Level:** {level}\n" +
                                                    $"**Experience:** {character.Experience}\n" +
                                                    $"**To Next Level:** {expToNextLevel}\n" +
                                                    $"**Caps:** {character.Money}");

            await ReplyAsync(userInfo.Mention, embed : embed);
        }
Ejemplo n.º 2
0
        public async Task <RuntimeResult> ShowCharacterAsync(IUser targetUser = null)
        {
            var userInfo  = Context.User;
            var character = targetUser == null
                ? await _charService.GetCharacterAsync(userInfo.Id)
                : await _charService.GetCharacterAsync(targetUser.Id);

            if (character == null)
            {
                return(CharacterResult.CharacterNotFound());
            }

            var level          = _expService.CalculateLevelForExperience(character.Experience);
            var expToNextLevel = _expService.CalculateRemainingExperienceToNextLevel(character.Experience);

            if (!ExperienceService.UseOldProgression)
            {
                expToNextLevel = (level + 1) * 1000 - character.Experience;
            }

            var description = string.IsNullOrEmpty(character.Description) ? "No description." : character.Description;
            var story       = string.IsNullOrEmpty(character.Story) ? "No story." : character.Story;

            var embed = EmbedHelper.BuildBasicEmbed($"{character.Name}",
                                                    $"**Description:** {description}\n" +
                                                    $"**Story:** ($char story)\n" +
                                                    $"**Level:** {level}\n" +
                                                    $"**Experience:** {character.Experience}\n" +
                                                    $"**To Next Level:** {expToNextLevel}\n" +
                                                    $"**Caps:** {character.Money}");

            await ReplyAsync(userInfo.Mention, embed : embed);

            return(GenericResult.FromSilentSuccess());
        }