use of pcgen.core.AbilityCategory in project pcgen by PCGen.
the class KitAbilities method apply.
@Override
public void apply(PlayerCharacter aPC) {
for (CNAbilitySelection cnas : abilitiesToAdd) {
aPC.addAbility(cnas, UserSelection.getInstance(), UserSelection.getInstance());
if (isFree()) {
AbilityCategory category = catRef.get();
aPC.adjustAbilities(category, BigDecimal.ONE);
}
}
}
use of pcgen.core.AbilityCategory in project pcgen by PCGen.
the class VFeatListToken method getAbilityList.
/**
* @see pcgen.io.exporttoken.AbilityListToken#getAbilityList(pcgen.core.PlayerCharacter, pcgen.core.AbilityCategory)
*/
@Override
protected MapToList<Ability, CNAbility> getAbilityList(PlayerCharacter pc, final AbilityCategory aCategory) {
final MapToList<Ability, CNAbility> listOfAbilities = new HashMapToList<>();
Collection<AbilityCategory> allCats = SettingsHandler.getGame().getAllAbilityCategories();
for (AbilityCategory aCat : allCats) {
if (aCat.getParentCategory().equals(aCategory)) {
for (CNAbility cna : pc.getPoolAbilities(aCat, Nature.VIRTUAL)) {
listOfAbilities.addToListFor(cna.getAbility(), cna);
}
}
}
return listOfAbilities;
}
use of pcgen.core.AbilityCategory in project pcgen by PCGen.
the class VAbilityListToken method getAbilityList.
/**
* @see pcgen.io.exporttoken.AbilityListToken#getAbilityList(pcgen.core.PlayerCharacter, pcgen.core.AbilityCategory)
*/
@Override
protected MapToList<Ability, CNAbility> getAbilityList(PlayerCharacter pc, final AbilityCategory aCategory) {
final MapToList<Ability, CNAbility> listOfAbilities = new HashMapToList<>();
Collection<AbilityCategory> allCats = SettingsHandler.getGame().getAllAbilityCategories();
for (AbilityCategory aCat : allCats) {
if (AbilityCategory.ANY.equals(aCategory) || aCat.getParentCategory().equals(aCategory)) {
for (CNAbility cna : pc.getPoolAbilities(aCat, Nature.VIRTUAL)) {
listOfAbilities.addToListFor(cna.getAbility(), cna);
}
}
}
return listOfAbilities;
}
use of pcgen.core.AbilityCategory in project pcgen by PCGen.
the class VAbilityToken method getAbilityList.
/**
* @see pcgen.io.exporttoken.AbilityToken#getAbilityList(pcgen.core.PlayerCharacter, pcgen.core.AbilityCategory)
*/
@Override
protected MapToList<Ability, CNAbility> getAbilityList(PlayerCharacter pc, final AbilityCategory aCategory) {
final MapToList<Ability, CNAbility> listOfAbilities = new HashMapToList<>();
Collection<AbilityCategory> allCats = SettingsHandler.getGame().getAllAbilityCategories();
for (AbilityCategory aCat : allCats) {
if (AbilityCategory.ANY.equals(aCategory) || aCat.getParentCategory().equals(aCategory)) {
for (CNAbility cna : pc.getPoolAbilities(aCat, Nature.VIRTUAL)) {
listOfAbilities.addToListFor(cna.getAbility(), cna);
}
}
}
return listOfAbilities;
}
use of pcgen.core.AbilityCategory in project pcgen by PCGen.
the class AbilityListTokenTest method setUp.
/*
* @see TestCase#setUp()
*/
@Override
protected void setUp() throws Exception {
super.setUp();
// Make some ability categories and add them to the game mode
AbilityCategory bardCategory = Globals.getContext().getReferenceContext().constructNowIfNecessary(AbilityCategory.class, "BARDIC");
Ability ab1 = TestHelper.makeAbility("Perform (Dance)", AbilityCategory.FEAT, "General.Fighter");
ab1.put(ObjectKey.MULTIPLE_ALLOWED, Boolean.FALSE);
ab1.put(ObjectKey.VISIBILITY, Visibility.DEFAULT);
addAbility(AbilityCategory.FEAT, ab1);
Ability ab2 = TestHelper.makeAbility("Perform (Dance)", "BARDIC", "General.Bardic");
ab2.put(ObjectKey.MULTIPLE_ALLOWED, Boolean.FALSE);
addAbility(bardCategory, ab2);
Ability ab3 = TestHelper.makeAbility("Perform (Oratory)", AbilityCategory.FEAT, "General.Fighter");
ab3.put(ObjectKey.MULTIPLE_ALLOWED, Boolean.FALSE);
addAbility(AbilityCategory.FEAT, ab3);
Ability ab4 = TestHelper.makeAbility("Silent Step", AbilityCategory.FEAT, "General");
ab4.put(ObjectKey.MULTIPLE_ALLOWED, Boolean.FALSE);
addAbility(AbilityCategory.FEAT, ab4);
}
Aggregations