Search in sources :

Example 11 with Skill

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;
}
Also used : Skill(pcgen.core.Skill)

Example 12 with 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;
}
Also used : Skill(pcgen.core.Skill) SkillFilter(pcgen.cdom.enumeration.SkillFilter)

Example 13 with Skill

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);
}
Also used : Skill(pcgen.core.Skill) CharID(pcgen.cdom.enumeration.CharID)

Example 14 with Skill

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);
}
Also used : Skill(pcgen.core.Skill) CharID(pcgen.cdom.enumeration.CharID)

Example 15 with Skill

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);
        }
    }
}
Also used : Skill(pcgen.core.Skill) PCClass(pcgen.core.PCClass) CharID(pcgen.cdom.enumeration.CharID) ClassSkillList(pcgen.cdom.list.ClassSkillList)

Aggregations

Skill (pcgen.core.Skill)165 Test (org.junit.Test)60 PCClass (pcgen.core.PCClass)55 ArrayList (java.util.ArrayList)29 CDOMReference (pcgen.cdom.base.CDOMReference)24 CharID (pcgen.cdom.enumeration.CharID)23 SkillCost (pcgen.cdom.enumeration.SkillCost)16 CDOMObject (pcgen.cdom.base.CDOMObject)15 PlayerCharacter (pcgen.core.PlayerCharacter)14 ChoiceSet (pcgen.cdom.base.ChoiceSet)13 ConcretePersistentTransitionChoice (pcgen.cdom.base.ConcretePersistentTransitionChoice)13 ReferenceChoiceSet (pcgen.cdom.choiceset.ReferenceChoiceSet)13 ClassSkillChoiceActor (pcgen.cdom.helper.ClassSkillChoiceActor)13 StringTokenizer (java.util.StringTokenizer)10 ObjectMatchingReference (pcgen.cdom.reference.ObjectMatchingReference)10 Ability (pcgen.core.Ability)10 LoadContext (pcgen.rules.context.LoadContext)9 ClassSkillList (pcgen.cdom.list.ClassSkillList)8 HashSet (java.util.HashSet)7 CNAbility (pcgen.cdom.content.CNAbility)7