예제 #1
0
            public async Task <RuntimeResult> ShowCharacterStoryAsync(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());
                }

                if (character.Story == null || character.Story.Equals(""))
                {
                    return(GenericResult.FromError(Messages.ERR_STORY_NOT_FOUND));
                }

                var embed = EmbedHelper.BuildBasicEmbed("Command: $character story",
                                                        $"**Name:** {character.Name}\n" +
                                                        $"**Story:** {character.Story}");

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

                return(GenericResult.FromSilentSuccess());
            }
예제 #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());
        }
예제 #3
0
        public async Task <RuntimeResult> ViewEffectAsync([Remainder] string name)
        {
            var effect = await _effectsService.GetEffectAsync(name);

            if (effect == null)
            {
                return(GenericResult.FromError(Messages.ERR_EFFECT_NOT_FOUND));
            }

            await ReplyAsync(message : Context.User.Mention, embed : EmbedHelper.BuildBasicEmbed(null, _effectsService.GetEffectInfo(effect)));

            return(GenericResult.FromSilentSuccess());
        }
예제 #4
0
        public async Task <RuntimeResult> ShowCharacterEffectsAsync(string name)
        {
            var userInfo  = Context.User;
            var character = _npcService.FindNpc(name);

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

            string info = _effectsService.GetCharacterEffects(character);

            await ReplyAsync(userInfo.Mention, embed : EmbedHelper.BuildBasicEmbed($"{character.Name}'s Effects:", info));

            return(GenericResult.FromSilentSuccess());
        }
예제 #5
0
        public async Task <RuntimeResult> ListEffectsAsync()
        {
            var effects = await _effectsService.GetAllOwnedEffectsAsync(Context.User.Id);

            if (effects == null)
            {
                return(GenericResult.FromError(Messages.ERR_EFFECT_NOT_FOUND));
            }

            var message = new StringBuilder();

            for (var i = 0; i < effects.Count; i++)
            {
                message.Append($"{i + 1}: {effects[i].Name}\n");
            }

            var embed = EmbedHelper.BuildBasicEmbed("Command: $effect list", message.ToString());

            await ReplyAsync(Context.User.Mention, embed : embed);

            return(GenericResult.FromSilentSuccess());
        }
예제 #6
0
        public async Task <RuntimeResult> ListCharactersAsync()
        {
            var characters = await _charService.GetAllCharactersAsync(Context.User.Id);

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

            var message = new StringBuilder();

            for (var i = 0; i < characters.Count; i++)
            {
                message.Append($"{i + 1}: {characters[i].Name}\n");
            }

            var embed = EmbedHelper.BuildBasicEmbed("Command: $character list", message.ToString());

            await ReplyAsync(Context.User.Mention, embed : embed);

            return(GenericResult.FromSilentSuccess());
        }
예제 #7
0
            private async Task <RuntimeResult> ShowSpecialAsync(IUser targetUser = null, bool useEffects = false)
            {
                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 stats = character.Statistics;

                if (useEffects)
                {
                    stats = _effectsService.GetEffectiveStatistics(character);
                }

                StringBuilder message = new StringBuilder($"**Name:** {character.Name}\n");

                foreach (var special in stats.Where(x => x.Statistic is Special).OrderBy(x => x.Statistic.Id))
                {
                    message.Append($"**{special.Statistic.Name}:** {special.Value}\n");
                }

                if (!_specService.IsSpecialSet(character))
                {
                    message.Append($"*You have {character.SpecialPoints} S.P.E.C.I.A.L. points left to spend!*");
                }

                var embed = EmbedHelper.BuildBasicEmbed("Command: $special", message.ToString());

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

                return(GenericResult.FromSilentSuccess());
            }
예제 #8
0
            private async Task <RuntimeResult> ShowSkillsAsync(IUser targetUser = null, bool useEffects = false)
            {
                var userInfo  = Context.User;
                var character = targetUser == null
                    ? await _charService.GetCharacterAsync(userInfo.Id)
                    : await _charService.GetCharacterAsync(targetUser.Id);

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

                bool skillsSet = _skillsService.AreSkillsSet(character);
                var  stats     = character.Statistics;

                if (useEffects)
                {
                    stats = _effectsService.GetEffectiveStatistics(character);
                }

                StringBuilder message = new StringBuilder($"**Name:** {character.Name}\n");

                foreach (var special in SpecialService.Specials.OrderBy(x => x.Id))
                {
                    message.Append($"__**{special.Name}:**__\n");
                    foreach (var skill in stats.Where(x => x.Statistic is Skill sk && sk.Special.Equals(special)).OrderBy(x => x.Statistic.Name))
                    {
                        if (skillsSet || !_progOptions.UseOldProgression)
                        {
                            if (skill.Value == 0)
                            {
                                continue;
                            }

                            message.Append($"**{skill.Statistic.Name}:** {skill.Value}\n");
                        }
                        else
                        {
                            message.Append($"*{skill.Statistic.Name}*, ");
                        }
                    }

                    message.Append($"\n");
                }

                if (skillsSet)
                {
                    if (character.ExperiencePoints > 0)
                    {
                        message.Append($"*You have {character.ExperiencePoints}XP left to spend! ($char skills spend)*");
                    }
                }
                else
                {
                    if (!_progOptions.OldProgression.UseNewVegasRules)
                    {
                        message.Append($"*You have {character.TagPoints} Tag points left to spend!*");
                    }
                }

                var embed = EmbedHelper.BuildBasicEmbed("Command: $skills", message.ToString());

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

                return(GenericResult.FromSilentSuccess());
            }