示例#1
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 }
                );
        }
示例#2
0
        public void UniversalistIsFlaggedToAvoidOppositionSchools()
        {
            var configuration = @"---
name: Universalist
no-opposition-schools: true
levels:
  - level: 1
    attributes:
      - attribute:
        name: Some Ability
".ParseYaml();
            var school        = new ArcaneSchool(configuration);

            Assert.True(school.NoOppositionSchools);
        }
示例#3
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));
        }
示例#4
0
        public void UniversalistSchoolsDontSelectOppositionSchools()
        {
            var wizard      = CharacterTestTemplates.Wizard().WithWizardCasting();
            var casting     = wizard.Get <WizardCasting>();
            var focusSchool = ArcaneSchool.CreateForTesting("focused", true);

            casting.SetFocusSchool(focusSchool);

            var oppSchool1 = ArcaneSchool.CreateForTesting("opp school 1", false);
            var oppSchool2 = ArcaneSchool.CreateForTesting("opp school 2", false);
            var gateway    = EntityGateway <ArcaneSchool> .LoadFromList(
                new ArcaneSchool[] { focusSchool, oppSchool1, oppSchool2 }
                );

            var step = new SelectArcaneOppositionSchools(gateway);

            step.ExecuteStep(wizard);
            Assert.Empty(casting.OppositionSchools);
        }
示例#5
0
        public void SelectsTwoOppositionSchoolsThatAreDifferentFromFocusSchool()
        {
            var wizard      = CharacterTestTemplates.Wizard().WithWizardCasting();
            var casting     = wizard.Get <WizardCasting>();
            var focusSchool = ArcaneSchool.CreateForTesting("focused", false);

            casting.SetFocusSchool(focusSchool);

            var oppSchool1 = ArcaneSchool.CreateForTesting("opp school 1", false);
            var oppSchool2 = ArcaneSchool.CreateForTesting("opp school 2", false);
            var gateway    = EntityGateway <ArcaneSchool> .LoadFromList(
                new ArcaneSchool[] { focusSchool, oppSchool1, oppSchool2 }
                );

            var step = new SelectArcaneOppositionSchools(gateway);

            step.ExecuteStep(wizard);
            AssertExtensions.Contains(oppSchool1, casting.OppositionSchools);
            AssertExtensions.Contains(oppSchool2, casting.OppositionSchools);
        }
示例#6
0
        public void DoNotUseUniversalistStyleSchoolsForOpposition()
        {
            var wizard      = CharacterTestTemplates.Wizard().WithWizardCasting();
            var casting     = wizard.Get <WizardCasting>();
            var focusSchool = ArcaneSchool.CreateForTesting("focused", false);

            casting.SetFocusSchool(focusSchool);

            var oppSchool1   = ArcaneSchool.CreateForTesting("opp school 1", false);
            var oppSchool2   = ArcaneSchool.CreateForTesting("opp school 2", false);
            var ignoreSchool = ArcaneSchool.CreateForTesting("universalist", true);
            var gateway      = EntityGateway <ArcaneSchool> .LoadFromList(
                new ArcaneSchool[] { focusSchool, oppSchool1, oppSchool2, ignoreSchool }
                );

            var step = new SelectArcaneOppositionSchools(gateway);

            step.ExecuteStep(wizard);
            AssertExtensions.Contains(oppSchool1, casting.OppositionSchools);
            AssertExtensions.Contains(oppSchool2, casting.OppositionSchools);
        }