use of pcgen.persistence.lst.SimpleLoader in project pcgen by PCGen.
the class SpellListTokenTest method setUp.
/*
* @see TestCase#setUp()
*/
@Override
protected void setUp() throws Exception {
super.setUp();
LoadContext context = Globals.getContext();
SettingsHandler.getGame().setSpellBaseDC("10+SPELLLEVEL+BASESPELLSTAT");
SimpleLoader<BonusSpellInfo> bonusSpellLoader = new SimpleLoader<>(BonusSpellInfo.class);
try {
URI testURI = new URI("file:/" + getClass().getName() + ".java");
bonusSpellLoader.parseLine(context, "1 BASESTATSCORE:12 STATRANGE:8", testURI);
bonusSpellLoader.parseLine(context, "2 BASESTATSCORE:14 STATRANGE:8", testURI);
bonusSpellLoader.parseLine(context, "3 BASESTATSCORE:16 STATRANGE:8", testURI);
} catch (URISyntaxException e) {
throw new UnreachableError(e);
}
// Human
human = new Race();
final BonusObj bon = Bonus.newBonus(context, "FEAT|POOL|2");
human.addToListFor(ListKey.BONUS, bon);
arcaneClass = new PCClass();
arcaneClass.setName("TestArcane");
BuildUtilities.setFact(arcaneClass, "SpellType", "Arcane");
context.unconditionallyProcess(arcaneClass, "SPELLSTAT", "CHA");
arcaneClass.put(ObjectKey.SPELLBOOK, false);
arcaneClass.put(ObjectKey.MEMORIZE_SPELLS, false);
context.unconditionallyProcess(arcaneClass.getOriginalClassLevel(1), "KNOWN", "4,2,1");
context.unconditionallyProcess(arcaneClass.getOriginalClassLevel(1), "CAST", "3,1,0");
context.getReferenceContext().importObject(arcaneClass);
divineClass = new PCClass();
divineClass.setName("TestDivine");
BuildUtilities.setFact(divineClass, "SpellType", "Divine");
context.unconditionallyProcess(divineClass, "SPELLSTAT", "WIS");
divineClass.put(ObjectKey.SPELLBOOK, false);
divineClass.put(ObjectKey.MEMORIZE_SPELLS, true);
context.unconditionallyProcess(divineClass.getOriginalClassLevel(1), "CAST", "3,1,0");
context.unconditionallyProcess(divineClass, "SPELLLEVEL", "CLASS|SPELLCASTER.Divine=1|Cure Light Wounds");
context.getReferenceContext().importObject(divineClass);
context.resolveDeferredTokens();
context.getReferenceContext().buildDerivedObjects();
context.getReferenceContext().resolveReferences(null);
}
Aggregations