Guest User

Untitled

a guest
May 28th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. public void roll() {
  2.         lastRoll.clear(); //clear out the last roll results
  3.         lastSuccess = 0;
  4.        
  5.         for (int i=0;i<diceAmmount;i++) {
  6.             boolean roteChance;
  7.             if (rote == true) {
  8.                 roteChance = true;
  9.             }
  10.             else {
  11.                 roteChance = false;
  12.             }
  13.             boolean keepGoing = true;
  14.             LinkedList<Integer> currentDie = new LinkedList<Integer>();
  15.             lastRoll.add(i, currentDie);
  16.             while(keepGoing) {
  17.                 int result = Die.roll();
  18.                 currentDie.add(result);
  19.                 if (result >= threshold) {
  20.                     lastSuccess++;
  21.                 }
  22.                 if (result < reroll) {
  23.                     if (roteChance != false)
  24.                         keepGoing = false;
  25.                     else {
  26.                         roteChance = false;
  27.                     }
  28.                 }
  29.             }
  30.            
  31.         }
  32.     }
Add Comment
Please, Sign In to add comment