use of plugin.lsttokens.race.MoncskillToken in project pcgen by PCGen.
the class RaceTargetSaveRestoreTest method testRaceMonCSkill.
@Test
public void testRaceMonCSkill() {
PCClass monclass = create(PCClass.class, "MonClass");
new TypeLst().parseToken(context, monclass, "Monster");
new HdToken().parseToken(context, monclass, "8");
new IsmonsterToken().parseToken(context, monclass, "YES");
Skill monskill = create(Skill.class, "MonSkill");
new ExclusiveToken().parseToken(context, monskill, "Yes");
Race monster = create(Race.class, "Monster");
Race other = create(Race.class, "Other");
Skill skill = create(Skill.class, "MySkill");
new ExclusiveToken().parseToken(context, skill, "Yes");
new MoncskillToken().parseToken(context, monster, "LIST");
new SkillToken().parseToken(context, monster, "MonSkill|MySkill");
finishLoad();
pc.setRace(monster);
pc.incrementClassLevel(1, monclass);
pc.setHP(pc.getActiveClassLevel(monclass, 0), 3);
final Runnable cleanup = getPreEqualityCleanup();
Runnable fullcleanup = new Runnable() {
public void run() {
if (cleanup != null) {
cleanup.run();
}
//TODO need this to create the spell support :/
PCClass cl = context.getReferenceContext().silentlyGetConstructedCDOMObject(PCClass.class, "MonClass");
reloadedPC.getSpellSupport(cl);
}
};
runRoundRobin(fullcleanup);
assertEquals(SkillCost.CLASS, pc.getSkillCostForClass(monskill, monclass));
assertEquals(SkillCost.CLASS, reloadedPC.getSkillCostForClass(monskill, monclass));
reloadedPC.setRace(other);
reloadedPC.setDirty(true);
assertEquals(SkillCost.EXCLUSIVE, reloadedPC.getSkillCostForClass(monskill, monclass));
}
Aggregations