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);
}
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();
}
Aggregations