use of gmgen.plugin.InitHolder in project pcgen by PCGen.
the class Initiative method castSpell.
/** Calls up the CastSpell dialog, passing in the data for the first selected combatant, if there is one
* sets the name of the spell as requested.
*/
private void castSpell() {
final List<InitHolder> selectedList = getSelected();
while (!selectedList.isEmpty()) {
final InitHolder iH = selectedList.remove(0);
castSpell("", iH, null);
return;
}
initList.sort();
refreshTable();
castSpell("", null, null);
}
use of gmgen.plugin.InitHolder in project pcgen by PCGen.
the class Initiative method doNonLethal.
/**
* Do an amount of non-lethal damage to the selected combatants
*
*@param damage The amount of damage to do
*/
private void doNonLethal(int damage) {
final List<InitHolder> selectedList = getSelected();
while (!selectedList.isEmpty()) {
InitHolder iH = selectedList.remove(0);
doNonLethal(damage, iH);
}
}
use of gmgen.plugin.InitHolder in project pcgen by PCGen.
the class Initiative method removePcgCombatant.
/**
* Remove the pcg combatant
* @param pc
*/
public void removePcgCombatant(PlayerCharacter pc) {
for (int i = 0; i < initList.size(); i++) {
InitHolder iH = initList.get(i);
if (iH instanceof PcgCombatant) {
PcgCombatant c = (PcgCombatant) iH;
if (c.getPC() == pc) {
initList.remove(iH);
removeTab(iH);
}
}
}
}
use of gmgen.plugin.InitHolder in project pcgen by PCGen.
the class Initiative method refreshEventTab.
private void refreshEventTab() {
tpCombatInfo.setText("");
for (final InitHolder anInitList : initList) {
StringBuilder sb = new StringBuilder();
if (anInitList instanceof Event) {
Event evt = (Event) anInitList;
sb.append(evt.getName() + " (" + evt.getPlayer() + ")\n");
sb.append("Duration: " + evt.getDuration() + '\n');
if (evt.getEffect().isEmpty()) {
sb.append('\n');
} else {
sb.append(evt.getEffect()).append("\n\n");
}
}
tpCombatInfo.setText(tpCombatInfo.getText() + sb);
}
}
use of gmgen.plugin.InitHolder in project pcgen by PCGen.
the class Initiative method opposedSkillActionPerformed.
/**
* <p>
* Handles button press for bOpposedSkill. Opens the opposed check dialog.
* </p>
* @param e
*/
private void opposedSkillActionPerformed(ActionEvent e) {
List<InitHolder> selected = getSelected();
List notSelected = getUnSelected();
OpposedCheckDialog dlg = new OpposedCheckDialog(GMGenSystem.inst, selected, notSelected);
dlg.setModal(true);
dlg.setVisible(true);
dlg.dispose();
}
Aggregations