Search in sources :

Example 26 with PlayerCharacter

use of pcgen.core.PlayerCharacter in project pcgen by PCGen.

the class SystemHP method isD20ModernMassive.

/**
	 * Returns true if the damage done is Massive damage under the 
	 * d20 Modern system
	 * 
	 * @param cbt
	 * @param damage
	 * @return true if the damage done is Massive damage under the 
	 * d20 Modern system
	 */
public static boolean isD20ModernMassive(Combatant cbt, int damage) {
    if (cbt instanceof PcgCombatant) {
        PcgCombatant pcgcbt = (PcgCombatant) cbt;
        PlayerCharacter pc = pcgcbt.getPC();
        PCStat stat = Globals.getContext().getReferenceContext().silentlyGetConstructedCDOMObject(PCStat.class, "CON");
        if (damage > pc.getTotalStatFor(stat)) {
            return true;
        }
    } else {
        if (damage > cbt.getHP().getAttribute().getValue()) {
            return true;
        }
    }
    return false;
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter) PCStat(pcgen.core.PCStat)

Example 27 with PlayerCharacter

use of pcgen.core.PlayerCharacter in project pcgen by PCGen.

the class ClassSkillListFacet method levelChanged.

@Override
public void levelChanged(ClassLevelChangeEvent lce) {
    if ((lce.getOldLevel() == 0) && (lce.getNewLevel() > 0)) {
        PCClass cl = lce.getPCClass();
        CharID id = lce.getCharID();
        TransitionChoice<ClassSkillList> csc = cl.get(ObjectKey.SKILLLIST_CHOICE);
        if (csc == null) {
            ClassSkillList l = cl.get(ObjectKey.CLASS_SKILLLIST);
            if (l != null) {
                defaultClassSkillListFacet.add(id, cl, l, cl);
            }
        } else {
            PlayerCharacter pc = trackingFacet.getPC(id);
            for (ClassSkillList st : csc.driveChoice(pc)) {
                add(id, cl, st, cl);
            }
        }
    } else if ((lce.getOldLevel() > 0) && (lce.getNewLevel() == 0)) {
        removeAllFromSource(lce.getCharID(), lce.getPCClass());
    }
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter) PCClass(pcgen.core.PCClass) CharID(pcgen.cdom.enumeration.CharID) ClassSkillList(pcgen.cdom.list.ClassSkillList)

Example 28 with PlayerCharacter

use of pcgen.core.PlayerCharacter in project pcgen by PCGen.

the class TemplateInputFacet method remove.

public void remove(CharID id, PCTemplate obj) {
    unconditionalTemplateFacet.remove(id, obj);
    PlayerCharacter pc = trackingFacet.getPC(id);
    if (pc.isAllowInteraction()) {
        templateSelectionFacet.remove(id, obj);
    }
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter)

Example 29 with PlayerCharacter

use of pcgen.core.PlayerCharacter in project pcgen by PCGen.

the class DomainInputFacet method remove.

public void remove(CharID id, Domain obj) {
    PlayerCharacter pc = trackingFacet.getPC(id);
    /*
		 * TODO This order of operations differs from Race and Template - is
		 * there a reason selection is first here and second there? Arguably
		 * this is correct since directSet is doing the selection last, so
		 * first-in first-out implies avoiding that issue
		 */
    if (pc.isAllowInteraction()) {
        domainSelectionFacet.remove(id, obj);
    }
    domainFacet.remove(id, obj);
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter)

Example 30 with PlayerCharacter

use of pcgen.core.PlayerCharacter in project pcgen by PCGen.

the class DomainInputFacet method importSelection.

public void importSelection(CharID id, Domain obj, String choice, ClassSource source) {
    PlayerCharacter pc = trackingFacet.getPC(id);
    if (ChooseActivation.hasNewChooseToken(obj)) {
        ChoiceManagerList<?> aMan = ChooserUtilities.getChoiceManager(obj, pc);
        String[] assoc = choice.split(",", -1);
        for (String string : assoc) {
            if (string.startsWith("FEAT?")) {
                int openloc = string.indexOf('(');
                int closeloc = string.lastIndexOf(')');
                string = string.substring(openloc + 1, closeloc);
            }
            processImport(id, obj, aMan, string, source);
        }
    } else {
        directSet(id, obj, null, source);
    }
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter)

Aggregations

PlayerCharacter (pcgen.core.PlayerCharacter)438 PreParserFactory (pcgen.persistence.lst.prereq.PreParserFactory)89 PCClass (pcgen.core.PCClass)61 LoadContext (pcgen.rules.context.LoadContext)58 Ability (pcgen.core.Ability)54 Equipment (pcgen.core.Equipment)41 PCTemplate (pcgen.core.PCTemplate)38 EquipSet (pcgen.core.character.EquipSet)32 BonusObj (pcgen.core.bonus.BonusObj)29 Race (pcgen.core.Race)28 CharID (pcgen.cdom.enumeration.CharID)25 ExportHandler (pcgen.io.ExportHandler)24 Test (org.junit.Test)20 ArrayList (java.util.ArrayList)16 PreClassTester (plugin.pretokens.test.PreClassTester)16 CDOMObject (pcgen.cdom.base.CDOMObject)15 Skill (pcgen.core.Skill)14 CNAbility (pcgen.cdom.content.CNAbility)13 URI (java.net.URI)11 URISyntaxException (java.net.URISyntaxException)11