use of gmgen.plugin.dice.Die in project pcgen by PCGen.
the class InitHolderList method check.
/** Rolls an initiative check for the whole list */
public void check() {
Die d20 = new Dice(1, 20);
boolean pcroll = SettingsHandler.getGMGenOption(InitiativePlugin.LOG_NAME + ".rollPCInitiatives", true);
for (InitHolder c : this) {
int roll = d20.roll();
boolean doroll = true;
if (!pcroll && c instanceof Combatant) {
Combatant com = (Combatant) c;
if (com.getCombatantType().equals("PC")) {
doroll = false;
}
}
if (doroll) {
c.getInitiative().checkExtRoll(roll);
} else {
c.getInitiative().resetCurrentInitiative();
}
}
this.sort();
calculateNumberField();
}