示例#1
0
            public async Task ShowSkillsAsync(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;
                }

                if (!_skillsService.AreSkillsSet(character))
                {
                    await ReplyAsync(
                        string.Format(Messages.ERR_SKILLS_NOT_FOUND, userInfo.Mention));

                    return;
                }

                var embed = EmbedHelper.BuildBasicEmbed("Command: $character skills",
                                                        $"**Name:** {character.Name}\n" +
                                                        $"**Barter:** {character.Skills.Barter}\n" +
                                                        $"**Energy Weapons:** {character.Skills.EnergyWeapons}\n" +
                                                        $"**Explosives:** {character.Skills.Explosives}\n" +
                                                        $"**Guns:** {character.Skills.Guns}\n" +
                                                        $"**Lockpick:** {character.Skills.Lockpick}\n" +
                                                        $"**Medicine:** {character.Skills.Medicine}\n" +
                                                        $"**MeleeWeapons:** {character.Skills.MeleeWeapons}\n" +
                                                        $"**Repair:** {character.Skills.Repair}\n" +
                                                        $"**Science:** {character.Skills.Science}\n" +
                                                        $"**Sneak:** {character.Skills.Sneak}\n" +
                                                        $"**Speech:** {character.Skills.Speech}\n" +
                                                        $"**Survival:** {character.Skills.Survival}\n" +
                                                        $"**Unarmed:** {character.Skills.Unarmed}\n" +
                                                        $"*You have {character.SkillPoints} left to spend! ($char skills spend)*");

                await ReplyAsync(userInfo.Mention, embed : embed);
            }
示例#2
0
        public async Task CheckSkill(IUser user, Globals.SkillType skill, 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 (!_skillsService.AreSkillsSet(character))
            {
                await ReplyAsync(String.Format(Messages.ERR_SKILLS_NOT_FOUND, user.Username));

                return;
            }

            int skillValue = _skillsService.GetSkill(character, skill);

            await ReplyAsync(GetCheckMessage(character.Name, skill.ToString(), skillValue, minimum));
        }
示例#3
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());
            }