use of pcgen.core.Race in project pcgen by PCGen.
the class SizeFacetTest method testGetFromTemplateLowerOverridesDefault.
@Test
public void testGetFromTemplateLowerOverridesDefault() {
rfacet.set(id, new Race());
PCTemplate t1 = new PCTemplate();
t1.put(FormulaKey.SIZE, FormulaFactory.getFormulaFor(1));
tfacet.add(id, t1, this);
facet.update(id);
assertEquals(1, facet.sizeInt(id));
tfacet.remove(id, t1, this);
facet.update(id);
assertEquals(2, facet.sizeInt(id));
}
use of pcgen.core.Race in project pcgen by PCGen.
the class SizeFacetTest method testGetWithNegativeBonus.
@Test
public void testGetWithNegativeBonus() {
assertEquals(2, facet.sizeInt(id));
assertEquals(2, facet.racialSizeInt(id));
Race r = new Race();
r.put(FormulaKey.SIZE, FormulaFactory.getFormulaFor(3));
rfacet.set(id, r);
facet.update(id);
assertEquals(3, facet.sizeInt(id));
assertEquals(3, facet.racialSizeInt(id));
bonusInfo.put(altid, -2.0);
// No pollution
facet.update(id);
assertEquals(3, facet.sizeInt(id));
assertEquals(3, facet.racialSizeInt(id));
bonusInfo.put(id, -2.0);
facet.update(id);
assertEquals(1, facet.sizeInt(id));
assertEquals(3, facet.racialSizeInt(id));
PCTemplate t1 = new PCTemplate();
t1.setName("PCT");
t1.put(FormulaKey.SIZE, FormulaFactory.getFormulaFor(1));
tfacet.add(id, t1, this);
facet.update(id);
assertEquals(0, facet.sizeInt(id));
assertEquals(1, facet.racialSizeInt(id));
PCTemplate t2 = new PCTemplate();
t2.setName("Other");
t2.put(FormulaKey.SIZE, FormulaFactory.getFormulaFor(4));
tfacet.add(id, t2, this);
facet.update(id);
assertEquals(2, facet.sizeInt(id));
assertEquals(4, facet.racialSizeInt(id));
tfacet.remove(id, t2, this);
facet.update(id);
assertEquals(0, facet.sizeInt(id));
assertEquals(1, facet.racialSizeInt(id));
bonusInfo.clear();
facet.update(id);
assertEquals(1, facet.sizeInt(id));
assertEquals(1, facet.racialSizeInt(id));
}
use of pcgen.core.Race in project pcgen by PCGen.
the class SizeFacetTest method testAvoidPollution.
@Test
public void testAvoidPollution() {
Race r = new Race();
r.put(FormulaKey.SIZE, FormulaFactory.getFormulaFor(3));
rfacet.set(id, r);
facet.update(id);
assertEquals(2, facet.sizeInt(altid));
assertEquals(2, facet.racialSizeInt(altid));
}
use of pcgen.core.Race in project pcgen by PCGen.
the class StatIntegrationTest method testWithNothingInRace.
@Test
public void testWithNothingInRace() {
Race r = new Race();
rfacet.set(id, r);
testNonAbilityUnset();
testLockUnset();
}
use of pcgen.core.Race in project pcgen by PCGen.
the class StatIntegrationTest method testNonStatToStatOverrideNonAbilityLockComplex.
@Test
public void testNonStatToStatOverrideNonAbilityLockComplex() {
testNonAbilityUnset();
Race r = new Race();
causeLockNonAbility(r, stat1);
rfacet.set(id, r);
PCTemplate t1 = new PCTemplate();
causeUnLockNonAbility(t1, stat1);
tfacet.add(id, t1, tsource);
testNonAbilityUnset();
testLockUnsetConditional();
}
Aggregations