Пример #1
0
        public void AuraOfCourageEnablesImmunityToFear()
        {
            var character = CharacterTestTemplates.AverageBob();

            character.Add(new AuraOfCourage());
            AssertCharacter.IsImmuneTo("Fear", character);
        }
Пример #2
0
 public void GrantsImmunities()
 {
     AssertCharacter.IsImmuneTo("cold", sorcerer);
     AssertCharacter.IsImmuneTo("paralysis", sorcerer);
     AssertCharacter.IsImmuneTo("nonlethal", sorcerer);
     AssertCharacter.IsImmuneTo("sleep", sorcerer);
 }
Пример #3
0
        public void ProvidesImmunityToPoison()
        {
            var monk = CharacterTestTemplates.MarkyMonk();

            monk.Add(new DiamondBody());
            AssertCharacter.IsImmuneTo("poison", monk);
        }
Пример #4
0
        public void EnergyResistanceOverTenThousandIsEqualToImmunity()
        {
            var dr        = new EnergyResistance(10000, "fire");
            var character = CharacterTestTemplates.AverageBob();

            character.Defense.AddDamageResistance(dr);
            AssertCharacter.IsImmuneTo("fire", character);
        }
Пример #5
0
        public void ProvidesImmunities()
        {
            var sorcerer = CharacterTestTemplates.Sorcerer();

            sorcerer.SetLevel(20);
            sorcerer.Add(new SoulOfTheFey());
            AssertCharacter.IsImmuneTo("poison", sorcerer);
            AssertCharacter.HasDamageResistance(sorcerer, "cold iron", 10);
        }
Пример #6
0
        public void GrantsImmunityToCriticalsAndSneakAttacks()
        {
            var sorc     = CharacterTestTemplates.Sorcerer();
            var aberrant = new AberrantForm();

            sorc.Add(aberrant);
            AssertCharacter.IsImmuneTo("Criticals", sorc);
            AssertCharacter.IsImmuneTo("Sneak Attacks", sorc);
        }
Пример #7
0
        public void EnablesImmunityToDisease()
        {
            var character = CharacterTestTemplates.AverageBob();

            character.Add(new DivineHealth());
            var defense = character.Get <DefenseStats>();

            AssertCharacter.IsImmuneTo("Disease", character);
        }
Пример #8
0
        public void CanBeMarkedAsImmunity()
        {
            var dr = new EnergyResistance(5, "fire");

            dr.SetToImmunity();
            var character = CharacterTestTemplates.AverageBob();

            character.Defense.AddDamageResistance(dr);
            AssertCharacter.IsImmuneTo("fire", character);
            Assert.Empty(character.Defense.EnergyResistance);
        }
Пример #9
0
        public void ProvidesImmunities()
        {
            var sorcerer = CharacterTestTemplates.Sorcerer();
            var power    = new PowerOfThePit();

            sorcerer.Add(power);

            AssertCharacter.HasDamageResistance(sorcerer, "acid", 10);
            AssertCharacter.HasDamageResistance(sorcerer, "cold", 10);
            AssertCharacter.IsImmuneTo("fire", sorcerer);
            AssertCharacter.IsImmuneTo("poison", sorcerer);
        }
Пример #10
0
        public void AddsDRAndImmunities()
        {
            var sorcerer = CharacterTestTemplates.Sorcerer();
            var might    = new DemonicMight();

            sorcerer.Add(might);

            AssertExtensions.Contains("acid", sorcerer.Defense.EnergyResistance.Select(x => x.DamageType));
            AssertExtensions.Contains("cold", sorcerer.Defense.EnergyResistance.Select(x => x.DamageType));
            AssertExtensions.Contains("fire", sorcerer.Defense.EnergyResistance.Select(x => x.DamageType));
            AssertCharacter.IsImmuneTo("electricity", sorcerer);
            AssertCharacter.IsImmuneTo("poison", sorcerer);
        }
Пример #11
0
        public void GrantsImmunitiesBasedOnElementType()
        {
            var sorcerer    = CharacterTestTemplates.Sorcerer();
            var elementType = new ElementalType();

            elementType.EnergyType = "acid";
            sorcerer.Add(elementType);
            sorcerer.Add(new ElementalBody());

            AssertCharacter.IsImmuneTo("acid", sorcerer);
            AssertCharacter.IsImmuneTo("sneak attacks", sorcerer);
            AssertCharacter.IsImmuneTo("critical hits", sorcerer);
        }
Пример #12
0
        public void SelectsAnEnergyTypeToGenerateResistanceTo()
        {
            var wizard     = CharacterTestTemplates.Wizard();
            var energyType = new EnergyType();

            energyType.Name = "fire";
            var abjRes = new AbjurationResistance(EntityGateway <EnergyType> .LoadWithSingleItem(energyType));

            wizard.Add(abjRes);
            AssertCharacter.HasDamageResistance("fire", 5, wizard);

            wizard.SetLevel(11);
            AssertCharacter.HasDamageResistance("fire", 10, wizard);

            wizard.SetLevel(20);
            AssertCharacter.IsImmuneTo("fire", wizard);
        }
Пример #13
0
        public void AddsDRAndImmunities()
        {
            var sorcerer  = CharacterTestTemplates.Sorcerer();
            var ascension = new Ascension();

            sorcerer.Add(ascension);
            Assert.True(
                sorcerer.Defense.EnergyResistance.Any(dr =>
                                                      dr.DamageType == "electricity" && dr.Amount == 10)
                );
            Assert.True(
                sorcerer.Defense.EnergyResistance.Any(dr =>
                                                      dr.DamageType == "fire" && dr.Amount == 10)
                );

            AssertCharacter.IsImmuneTo("acid", sorcerer);
            AssertCharacter.IsImmuneTo("cold", sorcerer);
            AssertCharacter.IsImmuneTo("petrification", sorcerer);

            Assert.Equal(4, sorcerer.Defense.FortitudeSave.GetConditionalValue("poison"));
        }
Пример #14
0
 public void GrantsImmunities()
 {
     AssertCharacter.IsImmuneTo("electricity", sorcerer);
     AssertCharacter.IsImmuneTo("paralysis", sorcerer);
     AssertCharacter.IsImmuneTo("sleep", sorcerer);
 }