Ejemplo n.º 1
0
 @Override
 public void setBonus(int bonus) {
   String initiativeVar =
       ControlUtilities.getControlToken(Globals.getContext(), CControl.INITIATIVE);
   if (initiativeVar == null) {
     this.incrementalBonus = bonus - display.processOldInitiativeMod();
   } else {
     this.incrementalBonus = bonus - ((Number) pc.getGlobal(initiativeVar)).intValue();
   }
   setCurrentInitiative(roll + getModifier() + mod);
 }
Ejemplo n.º 2
0
 @Override
 public int getBonus() {
   String initiativeVar =
       ControlUtilities.getControlToken(Globals.getContext(), CControl.INITIATIVE);
   String initiativeStatVar =
       ControlUtilities.getControlToken(Globals.getContext(), CControl.INITIATIVESTAT);
   if (initiativeVar == null) {
     PCStat dex =
         Globals.getContext()
             .getReferenceContext()
             .silentlyGetConstructedCDOMObject(PCStat.class, "DEX");
     return display.processOldInitiativeMod() - pc.getStatModFor(dex) + incrementalBonus;
   }
   return ((Number) pc.getGlobal(initiativeVar)).intValue()
       - ((Number) pc.getGlobal(initiativeStatVar)).intValue()
       + incrementalBonus;
 }