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 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)); }
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); }
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); }
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); }