public Embed CreateInfoEmbed()
        {
            EmbedBuilder builder = new EmbedBuilder()
                                   .AddField("Name", Name, true)
                                   .AddField("Controlled By", ControlledBy != 0UL ? $"<@{ControlledBy}>" : "Nobody", true)
                                   .AddField("Alive", Alive ? "Yes" : "No", true)
                                   .AddField("Class", BasicInfo.Class, true)
                                   .AddField("Proficiency Bonus", ProficiencyBonus.ShowSign(), true)
                                   .AddField("Total Level", Level.Current, true)
                                   .AddField("Race", BasicInfo.Race, true)
                                   .AddField("HP", (BasicInfo.Health.Current + BasicInfo.Health.Temporary) + " / " + BasicInfo.Health.Max
                                             + " (" + (int)((BasicInfo.Health.Current + BasicInfo.Health.Temporary) / (double)BasicInfo.Health.Max * 100) + "%)", true)
                                   .AddField("Strength", GetAbilityText(DnDAbilityScores.Strength), true)
                                   .AddField("Dexterity", GetAbilityText(DnDAbilityScores.Dexterity), true)
                                   .AddField("Constitution", GetAbilityText(DnDAbilityScores.Constitution), true)
                                   .AddField("Intelligence", GetAbilityText(DnDAbilityScores.Intelligence), true)
                                   .AddField("Wisdom", GetAbilityText(DnDAbilityScores.Wisdom), true)
                                   .AddField("Charisma", GetAbilityText(DnDAbilityScores.Charisma), true)
                                   .WithFooter(LastKnownCampaign != null ? "This character is currently part of the campaign: " + LastKnownCampaign
                            : "This character is not currently part of any campaign.");

            if (BasicInfo.Appearance.Image != null)
            {
                builder.WithThumbnailUrl(BasicInfo.Appearance.Image);
            }
            return(builder.Build());
        }
Exemplo n.º 2
0
        public void ProficiencyAndLevel_ReturnsAppropriateBonus(Proficiency proficiency, int expectedBonus)
        {
            //arrange
            Setup();
            //act
            ProficiencyBonus bonus = new ProficiencyBonus(level, proficiency);

            //assert
            Assert.AreEqual(expectedBonus, bonus.Amount);
        }