public SpontaneousCastingTests() { spellList = SpellList.CreateForTesting("bard"); spellList.Add(0, "cantrip1"); spellList.Add(0, "cantrip2"); spellList.Add(1, "level1.1"); spellList.Add(1, "level1.2"); spellList.Add(2, "level2.1"); spellList.Add(2, "level2.2"); bard = CharacterTestTemplates.BardyBard(); spellCasting = new SpontaneousCasting(configuration, EntityGateway <SpellList> .LoadWithSingleItem(spellList)); bard.Add(spellCasting); }
public static CharacterSheet WithSpontaneousCasting(this CharacterSheet character, int spellsPerLevel) { var spellcastingConfigurationYaml = @"--- list: " + character.Class.Name + @" spell-type: arcane casting-ability: charisma spell-slots: 1: [4, 1] 2: [5, 2] 3: [6, 3, 2] spells-known: 1: [4, 2] 2: [5, 3] 3: [6, 4, 1] "; var spellcastingConfiguration = spellcastingConfigurationYaml.ParseYaml(); var spellList = CreateGenericSpellList(character.Class.Name, spellsPerLevel); var spellCasting = new SpontaneousCasting(spellcastingConfiguration, EntityGateway <SpellList> .LoadWithSingleItem(spellList)); character.Add(spellCasting); return(character); }