예제 #1
0
        private Creature GenerateAndAssertCreature(string creatureName, string template)
        {
            var creature = creatureGenerator.Generate(creatureName, template);

            creatureAsserter.AssertCreature(creature);

            return(creature);
        }
예제 #2
0
        public void CanGenerateSpellsForThoseWhoCastAsSpellcaster(string creatureName)
        {
            var creature = creatureGenerator.Generate(creatureName, CreatureConstants.Templates.None);

            creatureAsserter.AssertCreature(creature);

            Assert.That(creature.Magic, Is.Not.Null);
            Assert.That(creature.Magic.Caster, Is.Not.Empty);
            Assert.That(creature.Magic.CasterLevel, Is.Positive);
            Assert.That(creature.Magic.CastingAbility, Is.Not.Null);
            Assert.That(creature.Abilities.Values, Contains.Item(creature.Magic.CastingAbility), creature.Magic.CastingAbility.Name);
            Assert.That(creature.Magic.ArcaneSpellFailure, Is.InRange(0, 100));
            Assert.That(creature.Magic.Domains, Is.Not.Null);

            if (creature.Magic.CastingAbility.FullScore > 10)
            {
                Assert.That(creature.Magic.KnownSpells, Is.Not.Empty.And.All.Not.Null, $"{creature.Magic.CastingAbility.Name}: {creature.Magic.CastingAbility.FullScore}");
                Assert.That(creature.Magic.SpellsPerDay, Is.Not.Empty.And.All.Not.Null, $"{creature.Magic.CastingAbility.Name}: {creature.Magic.CastingAbility.FullScore}");
            }
            else
            {
                Assert.That(creature.Magic.KnownSpells, Is.Empty, $"{creature.Magic.CastingAbility.Name}: {creature.Magic.CastingAbility.FullScore}");
                Assert.That(creature.Magic.SpellsPerDay, Is.Empty, $"{creature.Magic.CastingAbility.Name}: {creature.Magic.CastingAbility.FullScore}");
            }
        }