Search in sources :

Example 1 with SystemInitiative

use of gmgen.plugin.SystemInitiative in project pcgen by PCGen.

the class XMLCombatant method createSystemVals.

/**
	 *
	 * <p>Creates system HP and system initiative values</p>
	 *
	 * @param dexVal
	 * @param conVal
	 * @param hpVal
	 * @param hpCurrVal
	 * @param subdual
	 * @param initBonus
	 */
private void createSystemVals(int dexVal, int conVal, int hpVal, int hpCurrVal, int subdual, int initBonus) {
    init = new SystemInitiative(new SystemAttribute("Dexterity", dexVal), initBonus);
    hitPoints = new SystemHP(new SystemAttribute("Constitution", conVal), hpVal, hpCurrVal);
    hitPoints.setSubdual(subdual);
}
Also used : SystemAttribute(gmgen.plugin.SystemAttribute) SystemInitiative(gmgen.plugin.SystemInitiative) SystemHP(gmgen.plugin.SystemHP)

Example 2 with SystemInitiative

use of gmgen.plugin.SystemInitiative in project pcgen by PCGen.

the class Initiative method pasteNew.

/**  pastes the copied combatant
	 * @param toPaste
	 */
private void pasteNew(InitHolder toPaste) {
    if (toPaste instanceof XMLCombatant) {
        XMLCombatant cb = (XMLCombatant) toPaste;
        SystemInitiative init = cb.getInitiative();
        SystemHP hitPoints = cb.getHP();
        String name = initList.getUniqueName(cb.getName());
        InitHolder newCbt = new XMLCombatant(name, toPaste.getPlayer(), init.getAttribute().getValue(), hitPoints.getAttribute().getValue(), hitPoints.getMax(), hitPoints.getCurrent(), hitPoints.getSubdual(), init.getBonus(), cb.getCombatantType(), cb.getCR());
        initList.add(newCbt);
    }
    if (toPaste instanceof PcgCombatant) {
    //			PcgCombatant cb = (PcgCombatant) toPaste;
    //			PCGen_Frame1.getInst().loadPCFromFile(
    //				new File(cb.getPC().getFileName()), false, true);
    // As character exists in pcgen it is automatically added in to the init list
    }
    refreshTable();
}
Also used : SystemInitiative(gmgen.plugin.SystemInitiative) PcgCombatant(gmgen.plugin.PcgCombatant) SystemHP(gmgen.plugin.SystemHP) XMLCombatant(plugin.initiative.XMLCombatant) InitHolder(gmgen.plugin.InitHolder)

Aggregations

SystemHP (gmgen.plugin.SystemHP)2 SystemInitiative (gmgen.plugin.SystemInitiative)2 InitHolder (gmgen.plugin.InitHolder)1 PcgCombatant (gmgen.plugin.PcgCombatant)1 SystemAttribute (gmgen.plugin.SystemAttribute)1 XMLCombatant (plugin.initiative.XMLCombatant)1