Пример #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 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));
        }
Пример #3
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);
        }
Пример #4
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);
        }
Пример #5
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);
        }