use of pcgen.core.Race in project pcgen by PCGen.
the class ClassLevelCommandTest method setUp.
/**
* @throws Exception
* @see pcgen.AbstractCharacterTestCase#setUp()
*/
@Override
protected void setUp() throws Exception {
super.setUp();
Campaign customCampaign = new Campaign();
customCampaign.setName("Unit Test");
customCampaign.setName("KEY_Unit Test");
customCampaign.addToListFor(ListKey.DESCRIPTION, new Description("Unit Test data"));
// Create the monseter class type
GameMode gamemode = SettingsHandler.getGame();
gamemode.addClassType("Monster CRFORMULA:0 ISMONSTER:YES XPPENALTY:NO");
gamemode.setSkillMultiplierLevels("4");
gamemode.setMaxNonEpicLevel(20);
CDOMDirectSingleRef<SizeAdjustment> mediumRef = CDOMDirectSingleRef.getRef(medium);
// Create the Nymph race
nymphRace = new Race();
nymphRace.setName("Nymph");
nymphRace.addToListFor(ListKey.HITDICE_ADVANCEMENT, Integer.MAX_VALUE);
nymphRace.put(FormulaKey.SIZE, new FixedSizeFormula(mediumRef));
Globals.getContext().getReferenceContext().importObject(nymphRace);
// Create the humanoid class
humanoidClass = new PCClass();
humanoidClass.setName("Humanoid");
humanoidClass.addToListFor(ListKey.TYPE, Type.getConstant("Monster"));
Globals.getContext().getReferenceContext().importObject(humanoidClass);
nymphClass = new PCClass();
nymphClass.setName("Nymph");
nymphClass.addToListFor(ListKey.TYPE, Type.getConstant("Monster"));
Globals.getContext().getReferenceContext().importObject(nymphClass);
megaCasterClass = new PCClass();
megaCasterClass.setName("MegaCaster");
BuildUtilities.setFact(megaCasterClass, "SpellType", "Arcane");
Globals.getContext().unconditionallyProcess(megaCasterClass, "SPELLSTAT", "CHA");
megaCasterClass.put(ObjectKey.SPELLBOOK, false);
megaCasterClass.put(ObjectKey.MEMORIZE_SPELLS, false);
Globals.getContext().getReferenceContext().importObject(megaCasterClass);
}
use of pcgen.core.Race in project pcgen by PCGen.
the class NaturalWeaponFacetTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
CDOMObject cdo1 = new PCTemplate();
cdo1.setName("Template1");
CDOMObject cdo2 = new Race();
cdo2.setName("Race1");
Equipment st1 = new Equipment();
st1.setName("Prof1");
Equipment st2 = new Equipment();
st1.setName("Prof2");
cdo1.addToListFor(ListKey.NATURAL_WEAPON, st1);
cdo2.addToListFor(ListKey.NATURAL_WEAPON, st2);
source = new CDOMObject[] { cdo1, cdo2 };
target = new Equipment[] { st1, st2 };
}
use of pcgen.core.Race in project pcgen by PCGen.
the class DamageReductionFacetTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
CDOMObject cdo1 = new PCTemplate();
cdo1.setName("Templ");
CDOMObject cdo2 = new Race();
cdo2.setName("Race");
DamageReduction dr1 = new DamageReduction(FormulaFactory.getFormulaFor(4), "good");
DamageReduction dr2 = new DamageReduction(FormulaFactory.getFormulaFor(2), "bad");
cdo1.addToListFor(ListKey.DAMAGE_REDUCTION, dr1);
cdo2.addToListFor(ListKey.DAMAGE_REDUCTION, dr2);
source = new CDOMObject[] { cdo1, cdo2 };
target = new DamageReduction[] { dr1, dr2 };
}
use of pcgen.core.Race in project pcgen by PCGen.
the class AnyQualifierTokenTest method initializeObjects.
private void initializeObjects() {
s1 = new Race();
s1.setName("s1");
primaryContext.getReferenceContext().importObject(s1);
s2 = new Race();
s2.setName("s2");
primaryContext.getReferenceContext().importObject(s2);
primaryContext.unconditionallyProcess(s2, "TYPE", "Masterful");
s3 = new Race();
s3.setName("s3");
primaryContext.getReferenceContext().importObject(s3);
primaryContext.unconditionallyProcess(s3, "TYPE", "Masterful");
}
use of pcgen.core.Race in project pcgen by PCGen.
the class SizeFacet method calcRacialSizeInt.
private int calcRacialSizeInt(CharID id) {
SizeFacetInfo info = getConstructingInfo(id);
int iSize = SizeUtilities.getDefaultSizeAdjustment().get(IntegerKey.SIZEORDER);
Race race = raceFacet.get(id);
if (race != null) {
// get the base size for the race
Formula size = race.getSafe(FormulaKey.SIZE);
iSize = formulaResolvingFacet.resolve(id, size, "").intValue();
// with something like SIZE:L
for (PCTemplate template : templateFacet.getSet(id)) {
Formula sizeFormula = template.get(FormulaKey.SIZE);
if (sizeFormula != null) {
iSize = formulaResolvingFacet.resolve(id, sizeFormula, template.getKeyName()).intValue();
}
}
}
info.racialSizeInt = iSize;
return iSize;
}
Aggregations