Example #1
0
        public void ChooseAnAbilityAndApplyTheModifierToIt()
        {
            var wizard  = CharacterTestTemplates.Wizard();
            var enhance = new PhysicalEnhancement();

            wizard.Add(enhance);

            //Modifiers have to equal one with the bonus
            Assert.Equal
            (
                31,
                wizard.AbilityScores.GetScore(AbilityScoreTypes.Strength) +
                wizard.AbilityScores.GetScore(AbilityScoreTypes.Dexterity) +
                wizard.AbilityScores.GetScore(AbilityScoreTypes.Constitution)
            );

            wizard.SetLevel(15);

            Assert.Equal
            (
                34,
                wizard.AbilityScores.GetScore(AbilityScoreTypes.Strength) +
                wizard.AbilityScores.GetScore(AbilityScoreTypes.Dexterity) +
                wizard.AbilityScores.GetScore(AbilityScoreTypes.Constitution)
            );
        }
Example #2
0
        public GraveTouchTests()
        {
            wizard = CharacterTestTemplates.Wizard();
            var configuration = new MemoryStore();

            configuration.SetValue("base-ability", "intelligence");
            touch = new GraveTouch(configuration);
            wizard.Add(touch);
        }
Example #3
0
        public void UsesPerDayDeterminedByLevel()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var meta   = new MetamagicMastery();

            wizard.Add(meta);
            wizard.SetLevel(12);
            Assert.Equal(3, meta.UsesPerDay);
        }
Example #4
0
        public void EvilCreaturesTakeCommandUndead()
        {
            var wizard = CharacterTestTemplates.Wizard();

            wizard.Alignment = CharacterAlignment.ChaoticEvil;
            var power = new PowerOverUndead();

            wizard.Add(power);
            AssertCharacter.HasFeatToken("Command Undead", wizard);
        }
Example #5
0
        public void GoodCreaturesTakeTurnUndead()
        {
            var wizard = CharacterTestTemplates.Wizard();

            wizard.Alignment = CharacterAlignment.ChaoticGood;
            var power = new PowerOverUndead();

            wizard.Add(power);
            AssertCharacter.HasFeatToken("Turn Undead", wizard);
        }
Example #6
0
        public void UsesPerDayBasedOnIntelligence()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var ray    = new BlindingRay();

            wizard.Add(ray);
            Assert.Equal(3, ray.UsesPerDay);
            wizard.AbilityScores.SetScore(AbilityScoreTypes.Intelligence, 16);
            Assert.Equal(6, ray.UsesPerDay);
        }
Example #7
0
        public void RoundsPerDayBasedOnLevel()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var change = new ChangeShape();

            wizard.Add(change);
            Assert.Equal(1, change.RoundsPerDay);
            wizard.SetLevel(15);
            Assert.Equal(15, change.RoundsPerDay);
        }
Example #8
0
        public void DontUseOpposingSchoolSpellsForAvailableSpellList()
        {
            var wizard    = CharacterTestTemplates.Wizard().WithWizardCasting();
            var casting   = wizard.Get <WizardCasting>();
            var oppSchool = ArcaneSchool.CreateForTesting("Evocation", false);

            casting.SetOppositionSchools(
                new IArcaneSchool[] { oppSchool }
                );
        }
Example #9
0
        public void SelectsAFocusedSchool()
        {
            var wizard  = CharacterTestTemplates.Wizard().WithWizardCasting().WithSkills();
            var select  = new SelectArcaneSchool();
            var casting = wizard.Get <WizardCasting>();

            select.ExecuteStep(wizard);
            Assert.NotNull(casting.FocusSchool);
            Assert.NotNull(wizard.Get <IArcaneSchool>());
        }
Example #10
0
        public void UsesPerDayDeterminedByIntelligence()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var hand   = new HandOfTheApprentice();

            wizard.Add(hand);
            Assert.Equal(3, hand.UsesPerDay);
            wizard.AbilityScores.SetScore(AbilityScoreTypes.Intelligence, 16);
            Assert.Equal(6, hand.UsesPerDay);
        }
Example #11
0
        public void ProvidesABonusToInitiative()
        {
            var character  = CharacterTestTemplates.Wizard().FullInitialize();
            var forewarned = new Forewarned();

            character.Add(forewarned);
            Assert.Equal(1, character.Initiative.TotalValue);
            character.SetLevel(6);

            Assert.Equal(3, character.Initiative.TotalValue);
        }
Example #12
0
 public EnchantingSmileTests()
 {
     wizard = CharacterTestTemplates.Wizard().WithSkills(
         new string [] {
         "Bluff",
         "Diplomacy",
         "Intimidate"
     });
     smile = new EnchantingSmile();
     wizard.Add(smile);
 }
Example #13
0
        public void AddsHalfLevelAtLeastOneDamageToSpells()
        {
            var wizard  = CharacterTestTemplates.Wizard();
            var intense = new IntenseSpells();

            wizard.Add(intense);
            Assert.Equal(1, intense.BonusDamage);
            wizard.SetLevel(10);
            Assert.Equal(5, intense.BonusDamage);
            Assert.Equal("Intense Spells (+5 spell damage)", intense.DisplayString());
        }
Example #14
0
        public void RoundsPerDayBasedOnLevel()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var wall   = new ElementalWall();

            wizard.Add(wall);
            Assert.Equal(1, wall.RoundsPerDay);
            wizard.SetLevel(10);
            Assert.Equal(10, wall.RoundsPerDay);
            Assert.Equal("Elemental Wall (10 rounds/day)", wall.DisplayString());
        }
Example #15
0
        public void GetThirtyFeetTeleportPerLevel()
        {
            var wizard   = CharacterTestTemplates.Wizard();
            var dimSteps = new DimensionalSteps();

            wizard.Add(dimSteps);
            Assert.Equal(30, dimSteps.Distance);
            wizard.SetLevel(10);
            Assert.Equal(300, dimSteps.Distance);
            Assert.Equal("Dimensional Steps (300 ft/day)", dimSteps.DisplayString());
        }
Example #16
0
        public void SelectsUniqueListOfSpellsDependingOnAvailableSlots()
        {
            var character    = CharacterTestTemplates.Wizard().WithWizardCasting().FillSpellbook();
            var spellCasting = character.Get <ISpellCasting>();

            var prepareSpells = new PrepareSpells();

            prepareSpells.ExecuteStep(character);
            Assert.Equal(3, spellCasting.GetReadySpells(0).Count());
            Assert.Equal(2, spellCasting.GetReadySpells(1).Count());
        }
Example #17
0
        public void RoundsPerDayBasedOnLevel()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var field  = new InvisibilityField();

            wizard.Add(field);
            Assert.Equal(1, field.RoundsPerDay);
            wizard.SetLevel(10);
            Assert.Equal(10, field.RoundsPerDay);
            Assert.Equal("Invisibility Field (10 rounds/day)", field.DisplayString());
        }
Example #18
0
        public void ProvideExtraRoundsEqualToHalfLevelsMinimumOne()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var summon = new SummonersCharm();

            wizard.Add(summon);
            Assert.Equal(1, summon.Duration);
            wizard.SetLevel(10);
            Assert.Equal(5, summon.Duration);
            Assert.Equal("Summoners Charm (5 rounds)", summon.DisplayString());
        }
Example #19
0
        public void RoundsPerDayBasedOnCharacterLevel()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var aura   = new AuraOfDespair();

            wizard.Add(aura);
            Assert.Equal(1, aura.RoundsPerDay);
            wizard.SetLevel(12);
            Assert.Equal(12, aura.RoundsPerDay);
            Assert.Equal("Aura Of Despair (12 rounds/day)", aura.DisplayString());
        }
Example #20
0
        public void ExtraRoundsBasedOnSourceLevel()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var extend = new ExtendedIllusions();

            wizard.Add(extend);
            Assert.Equal(1, extend.Duration);
            wizard.SetLevel(10);
            Assert.Equal(5, extend.Duration);
            Assert.Equal("Extended Illusions (5 rounds)", extend.DisplayString());
        }
Example #21
0
        public void ShouldGrantEnergyAbsorptionEqualToThreeTimesLevel()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var absorp = new EnergyAbsorption();

            wizard.Add(absorp);
            Assert.Equal(3, absorp.Amount);
            wizard.SetLevel(10);
            Assert.Equal(30, absorp.Amount);
            Assert.Equal("Energy Absorption (30 pts/day)", absorp.DisplayString());
        }
Example #22
0
        public void PreparesSpellsFromMultipleSpellCastingClassesIfAvailable()
        {
            var character = CharacterTestTemplates.Wizard().WithWizardCasting().WithDivineCasting().FillSpellbook();
            var scWizard  = character.Get <WizardCasting>();
            var scCleric  = character.Get <DivineCasting>();

            var prepSpells = new PrepareSpells();

            prepSpells.ExecuteStep(character);
            Assert.Equal(3, scWizard.GetReadySpells(0).Count());
            Assert.Equal(3, scCleric.GetReadySpells(0).Count());
        }
Example #23
0
        public void GrantsBonusBasedOnCharacterLevel()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var div    = new DivinersFortune();

            wizard.Add(div);
            Assert.Equal(1, div.Bonus);
            wizard.SetLevel(10);
            Assert.Equal(5, div.Bonus);
            Assert.Equal(3, div.UsesPerDay);
            wizard.AbilityScores.SetScore(AbilityScoreTypes.Intelligence, 16);
            Assert.Equal(6, div.UsesPerDay);
        }
Example #24
0
        public void TimesPerDayBasedOnIntelligence()
        {
            var wizard        = CharacterTestTemplates.Wizard();
            var configuration = new MemoryStore();

            configuration.SetValue("base-ability", "intelligence");
            var dazing = new DazingTouch(configuration);

            wizard.Add(dazing);
            Assert.Equal(3, dazing.UsesPerDay);
            wizard.AbilityScores.SetScore(AbilityScoreTypes.Intelligence, 16);
            Assert.Equal(6, dazing.UsesPerDay);
        }
Example #25
0
        public void DamageAndUsesPerDayDeterminedByLevelAndAbility()
        {
            var wizard = CharacterTestTemplates.Wizard();
            var fist   = new TelekineticFist();

            wizard.Add(fist);

            Assert.Equal("1d4", fist.Damage.ToString());
            wizard.SetLevel(10);
            Assert.Equal("1d4+5", fist.Damage.ToString());

            wizard.AbilityScores.SetScore(AbilityScoreTypes.Intelligence, 16);
            Assert.Equal(6, fist.UsesPerDay);
        }
Example #26
0
        public void Does1d4PlusIntenseSpellsDamage()
        {
            var wizard  = CharacterTestTemplates.Wizard();
            var intense = new IntenseSpells();
            var force   = new ForceMissile();

            wizard.Add(intense);
            wizard.Add(force);

            Assert.Equal("1d4+1", force.Damage.ToString());
            Assert.Equal(3, force.UsesPerDay);

            Assert.Equal("Force Missile 1d4+1 (3/day)", force.DisplayString());
        }
Example #27
0
        public AddSpellsToSpellbookTests()
        {
            var configuration = new MemoryStore();

            configuration.SetValue(
                "spells",
                new string[] { "all", "3" }
                );

            var step = new AddSpellsToSpellbook(configuration);

            wizard = CharacterTestTemplates.Wizard().WithWizardCasting();
            step.ExecuteStep(wizard);
        }
Example #28
0
        public void AMinimumValueCanBeProvidedForFiguringOutTheCalculation()
        {
            string yaml      = @"---
name: strength
modifier-type: bonus
rate: 2
minimum: 1
class: wizard";
            var    modifier  = new ClassLevelModifier(yaml.ParseYaml());
            var    character = CharacterTestTemplates.Wizard();

            character.Add(modifier);
            Assert.Equal(1, modifier.Modifier);
        }
Example #29
0
        public void CalculatesTheModifierBasedOnTheNumberOfLevelsDividedByTheRate()
        {
            string yaml      = @"---
name: strength
modifier-type: bonus
rate: 2
class: wizard";
            var    modifier  = new ClassLevelModifier(yaml.ParseYaml());
            var    character = CharacterTestTemplates.Wizard();

            character.Add(modifier);
            Assert.Equal(0, modifier.Modifier);
            character.SetLevel(6);
            Assert.Equal(3, modifier.Modifier);
        }
Example #30
0
        public void IfOpposingSchoolThenDoNotAllowCasting()
        {
            var rule    = new IgnoreSpellsOfOpposingSchools();
            var wizard  = CharacterTestTemplates.Wizard().WithWizardCasting();
            var casting = wizard.Get <WizardCasting>();
            var school  = ArcaneSchool.CreateForTesting("evocation", false);

            casting.SetOppositionSchools(new IArcaneSchool[] { school });
            wizard.Add(rule);

            var ignoreSpell = new Spell("Fireball", "evocation");
            var allowSpell  = new Spell("Entangle", "transmutation");

            Assert.False(rule.CanCastSpell(ignoreSpell));
            Assert.True(rule.CanCastSpell(allowSpell));
        }