Search in sources :

Example 21 with InitHolder

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);
}
Also used : InitHolder(gmgen.plugin.InitHolder)

Example 22 with InitHolder

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);
    }
}
Also used : InitHolder(gmgen.plugin.InitHolder)

Example 23 with InitHolder

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);
            }
        }
    }
}
Also used : PcgCombatant(gmgen.plugin.PcgCombatant) InitHolder(gmgen.plugin.InitHolder)

Example 24 with InitHolder

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);
    }
}
Also used : HyperlinkEvent(javax.swing.event.HyperlinkEvent) ListSelectionEvent(javax.swing.event.ListSelectionEvent) ActionEvent(java.awt.event.ActionEvent) Event(gmgen.plugin.Event) InitHolder(gmgen.plugin.InitHolder)

Example 25 with InitHolder

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();
}
Also used : List(java.util.List) InitHolderList(gmgen.plugin.InitHolderList) ArrayList(java.util.ArrayList) InitHolder(gmgen.plugin.InitHolder)

Aggregations

InitHolder (gmgen.plugin.InitHolder)31 PcgCombatant (gmgen.plugin.PcgCombatant)18 XMLCombatant (plugin.initiative.XMLCombatant)13 Combatant (gmgen.plugin.Combatant)11 InitHolderList (gmgen.plugin.InitHolderList)7 ArrayList (java.util.ArrayList)7 Event (gmgen.plugin.Event)6 ActionEvent (java.awt.event.ActionEvent)6 HyperlinkEvent (javax.swing.event.HyperlinkEvent)6 ListSelectionEvent (javax.swing.event.ListSelectionEvent)6 List (java.util.List)5 Vector (java.util.Vector)2 Element (org.jdom2.Element)2 SaveModel (plugin.initiative.SaveModel)2 Spell (gmgen.plugin.Spell)1 SystemHP (gmgen.plugin.SystemHP)1 SystemInitiative (gmgen.plugin.SystemInitiative)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 Writer (java.io.Writer)1