use of pcgen.core.GameMode in project pcgen by PCGen.
the class CharacterLevelsFacadeImplTest method before.
@Before
public void before() throws Exception {
delegate = new MockUIDelegate();
todoManager = new TodoManager();
final GameMode gameMode = SettingsHandler.getGame();
dataSetFacade = new MockDataSetFacade(gameMode);
}
use of pcgen.core.GameMode in project pcgen by PCGen.
the class DataLoadTest method getBasicSources.
private static List<SourceSelectionFacade> getBasicSources() {
List<SourceSelectionFacade> basicSources = new ArrayList<>();
for (Campaign campaign : Globals.getCampaignList()) {
if (campaign.showInMenu()) {
SourceSelectionFacade sourceSelection = FacadeFactory.createSourceSelection(campaign.getGameModes().getElementAt(0), Collections.singletonList(campaign), campaign.getName());
basicSources.add(sourceSelection);
}
}
for (GameMode mode : SystemCollections.getUnmodifiableGameModeList()) {
String title = mode.getDefaultSourceTitle();
if (title == null && !mode.getDefaultDataSetList().isEmpty()) {
title = mode.getName();
}
if (!mode.getDefaultDataSetList().isEmpty()) {
List<CampaignFacade> qcamps = new ArrayList<>();
List<String> sources = mode.getDefaultDataSetList();
for (String string : sources) {
Campaign camp = Globals.getCampaignKeyed(string);
assertNotNull("Cannot find source " + string + " for game mode " + mode, camp);
qcamps.add(camp);
}
basicSources.add(FacadeFactory.createSourceSelection(mode, qcamps, mode.getDefaultSourceTitle()));
}
}
return basicSources;
}
use of pcgen.core.GameMode in project pcgen by PCGen.
the class IconTokenTest method testInValidSyntax.
public void testInValidSyntax() throws Exception {
GameMode gameMode = SettingsHandler.getGame();
IconToken token = new IconToken();
assertFalse("Parse should fail", token.parse(gameMode, "Eyegear:preview/summary/images/icon_eye.png", uri));
assertFalse("Parse should fail", token.parse(gameMode, "Eyegear|preview/summary/images|icon_eye.png", uri));
}
use of pcgen.core.GameMode 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.GameMode in project pcgen by PCGen.
the class AbstractTokenModelTest method setUpContext.
protected void setUpContext() throws PersistenceLayerException {
ChooserFactory.pushChooserClassname(RandomChooser.class.getName());
TokenRegistration.clearTokens();
TokenRegistration.register(AUTO_LANG_TOKEN);
TokenRegistration.register(ABILITY_VISIBLE_TOKEN);
TokenRegistration.register(AUTO_TOKEN);
TokenRegistration.register(CHOOSE_TOKEN);
TokenRegistration.register(CHOOSE_LANG_TOKEN);
TokenRegistration.register(ABILITY_MULT_TOKEN);
TokenRegistration.register(EQUIP_TYPE_TOKEN);
TokenRegistration.register(EQUIP_PROFICIENCY_TOKEN);
TokenRegistration.register(LANGBONUS_PRIM);
TokenRegistration.register(PC_QUAL);
TokenRegistration.register(getToken());
TokenRegistration.register(plugin.bonustokens.Feat.class);
directAbilityFacet = FacetLibrary.getFacet(DirectAbilityFacet.class);
activeEqModFacet = FacetLibrary.getFacet(ActiveEqModFacet.class);
alignmentFacet = FacetLibrary.getFacet(AlignmentFacet.class);
bioSetFacet = FacetLibrary.getFacet(BioSetFacet.class);
checkFacet = FacetLibrary.getFacet(CheckFacet.class);
classFacet = FacetLibrary.getFacet(ClassFacet.class);
classLevelFacet = FacetLibrary.getFacet(ClassLevelFacet.class);
companionModFacet = FacetLibrary.getFacet(CompanionModFacet.class);
deityFacet = FacetLibrary.getFacet(DeityFacet.class);
domainFacet = FacetLibrary.getFacet(DomainFacet.class);
expandedCampaignFacet = FacetLibrary.getFacet(ExpandedCampaignFacet.class);
languageFacet = FacetLibrary.getFacet(LanguageFacet.class);
raceFacet = FacetLibrary.getFacet(RaceInputFacet.class);
sizeFacet = FacetLibrary.getFacet(SizeFacet.class);
skillFacet = FacetLibrary.getFacet(SkillFacet.class);
statFacet = FacetLibrary.getFacet(StatFacet.class);
templateInputFacet = FacetLibrary.getFacet(TemplateInputFacet.class);
templateConsolidationFacet = FacetLibrary.getFacet(TemplateFacet.class);
weaponProfModelFacet = FacetLibrary.getFacet(WeaponProfModelFacet.class);
Globals.createEmptyRace();
Globals.setUseGUI(false);
Globals.emptyLists();
GameMode gamemode = SettingsHandler.getGame();
gamemode.clearLoadContext();
str = BuildUtilities.createStat("Strength", "STR");
str.put(VariableKey.getConstant("LOADSCORE"), FormulaFactory.getFormulaFor("STRSCORE"));
str.put(VariableKey.getConstant("OFFHANDLIGHTBONUS"), FormulaFactory.getFormulaFor(2));
dex = BuildUtilities.createStat("Dexterity", "DEX");
PCStat con = BuildUtilities.createStat("Constitution", "CON");
intel = BuildUtilities.createStat("Intelligence", "INT");
wis = BuildUtilities.createStat("Wisdom", "WIS");
cha = BuildUtilities.createStat("Charisma", "CHA");
AbstractReferenceContext ref = Globals.getContext().getReferenceContext();
lg = BuildUtilities.createAlignment("Lawful Good", "LG");
ref.importObject(lg);
ln = BuildUtilities.createAlignment("Lawful Neutral", "LN");
ref.importObject(ln);
le = BuildUtilities.createAlignment("Lawful Evil", "LE");
ref.importObject(le);
ng = BuildUtilities.createAlignment("Neutral Good", "NG");
ref.importObject(ng);
tn = BuildUtilities.createAlignment("True Neutral", "TN");
ref.importObject(tn);
ne = BuildUtilities.createAlignment("Neutral Evil", "NE");
ref.importObject(ne);
cg = BuildUtilities.createAlignment("Chaotic Good", "CG");
ref.importObject(cg);
cn = BuildUtilities.createAlignment("Chaotic Neutral", "CN");
ref.importObject(cn);
ce = BuildUtilities.createAlignment("Chaotic Evil", "CE");
ref.importObject(ce);
ref.importObject(BuildUtilities.createAlignment("None", "NONE"));
ref.importObject(BuildUtilities.createAlignment("Deity's", "Deity"));
gamemode.setBonusFeatLevels("3|3");
SettingsHandler.setGame("3.5");
ref.importObject(str);
ref.importObject(dex);
ref.importObject(con);
ref.importObject(intel);
ref.importObject(wis);
ref.importObject(cha);
fine = BuildUtilities.createSize("Fine", 0);
diminutive = BuildUtilities.createSize("Diminutive", 1);
tiny = BuildUtilities.createSize("Tiny", 2);
small = BuildUtilities.createSize("Small", 3);
medium = BuildUtilities.createSize("Medium", 4);
medium.put(ObjectKey.IS_DEFAULT_SIZE, true);
large = BuildUtilities.createSize("Large", 5);
huge = BuildUtilities.createSize("Huge", 6);
gargantuan = BuildUtilities.createSize("Gargantuan", 7);
colossal = BuildUtilities.createSize("Colossal", 8);
context = Globals.getContext();
create(Language.class, "Common");
BuildUtilities.createFact(context, "ClassType", PCClass.class);
FactDefinition<?, String> fd = BuildUtilities.createFact(context, "SpellType", PCClass.class);
fd.setSelectable(true);
context.getReferenceContext().importObject(AbilityCategory.FEAT);
SourceFileLoader.createLangBonusObject(Globals.getContext());
}
Aggregations