use of pcgen.core.Skill in project pcgen by PCGen.
the class SkillChoice method getSkill.
/**
* Gets the skill associated with this chioce. If this choice is a group
* of choices, the specific skill will be selected randomly.
*
* @return A <tt>Skill</tt>
*/
public Skill getSkill() {
final Skill skill = theSkillList.getRandomValue();
theSkillList.add(skill, NPCGenerator.getSubSkillWeightAdd());
return skill;
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class PCCountSkillsTermEvaluator method resolve.
@Override
public Float resolve(PlayerCharacter pc) {
int count = 0;
//TODO This is a bug, it assumes export
final List<Skill> skills = pc.getDisplay().getPartialSkillList(View.VISIBLE_EXPORT);
SkillFilter filter = SkillFilter.getByToken(filterToken);
if (filter == null || filter == SkillFilter.Selected) {
filter = pc.getSkillFilter();
}
for (Skill sk : skills) {
if (pc.includeSkill(sk, filter) && sk.qualifies(pc, null)) {
count++;
}
}
return (float) count;
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class TotalSkillRankFacet method bonusChange.
@Override
public void bonusChange(SkillRankChangeEvent srce) {
CharID id = srce.getCharID();
Skill skill = srce.getSkill();
double newBonus = srce.getNewVal().doubleValue();
float rank = skillRankFacet.getRank(id, skill);
set(id, skill, rank + newBonus);
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class TotalSkillRankFacet method rankChanged.
@Override
public void rankChanged(pcgen.cdom.facet.SkillRankFacet.SkillRankChangeEvent srce) {
CharID id = srce.getCharID();
Skill skill = srce.getSkill();
float newRank = srce.getNewRank();
double bonus = bonusSkillRankChangeFacet.getRank(id, skill);
set(id, skill, newRank + bonus);
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class SkillListToCostFacet method dataAdded.
@Override
public void dataAdded(ScopeFacetChangeEvent<CharID, PCClass, ClassSkillList> dfce) {
CharID id = dfce.getCharID();
ClassSkillList skilllist = dfce.getCDOMObject();
Collection<Skill> set = masterSkillFacet.getSet(id.getDatasetID(), skilllist);
if (set != null) {
PCClass pcc = dfce.getScope();
for (Skill s : set) {
add(id, pcc, SkillCost.CLASS, s, skilllist);
}
}
}
Aggregations