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) ); }
public GraveTouchTests() { wizard = CharacterTestTemplates.Wizard(); var configuration = new MemoryStore(); configuration.SetValue("base-ability", "intelligence"); touch = new GraveTouch(configuration); wizard.Add(touch); }
public void UsesPerDayDeterminedByLevel() { var wizard = CharacterTestTemplates.Wizard(); var meta = new MetamagicMastery(); wizard.Add(meta); wizard.SetLevel(12); Assert.Equal(3, meta.UsesPerDay); }
public void EvilCreaturesTakeCommandUndead() { var wizard = CharacterTestTemplates.Wizard(); wizard.Alignment = CharacterAlignment.ChaoticEvil; var power = new PowerOverUndead(); wizard.Add(power); AssertCharacter.HasFeatToken("Command Undead", wizard); }
public void GoodCreaturesTakeTurnUndead() { var wizard = CharacterTestTemplates.Wizard(); wizard.Alignment = CharacterAlignment.ChaoticGood; var power = new PowerOverUndead(); wizard.Add(power); AssertCharacter.HasFeatToken("Turn Undead", wizard); }
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); }
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); }
public void DontUseOpposingSchoolSpellsForAvailableSpellList() { var wizard = CharacterTestTemplates.Wizard().WithWizardCasting(); var casting = wizard.Get <WizardCasting>(); var oppSchool = ArcaneSchool.CreateForTesting("Evocation", false); casting.SetOppositionSchools( new IArcaneSchool[] { oppSchool } ); }
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>()); }
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); }
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); }
public EnchantingSmileTests() { wizard = CharacterTestTemplates.Wizard().WithSkills( new string [] { "Bluff", "Diplomacy", "Intimidate" }); smile = new EnchantingSmile(); wizard.Add(smile); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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); }
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); }
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); }
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()); }
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); }
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); }
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); }
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)); }