Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. /roll {?{How many Dice?}d6!!}>?{What is the Target Number?}
  2.  
  3. var DCount=?{How many Dice?}; //asks the user for the number of dice
  4. var TN=?{What is the Target Number?};//asks the user for the target number
  5. var BN=TN*2; //defines double the target number (called a Boon)
  6. var SCount=0; //used to count Successes
  7. var BCount=0; //used to count Boons
  8. var CCount=0; //used to count Complications (nat 1)
  9. var Test=0; //used to store die rolls
  10. var NTest=0; //used for totaling exploding dice
  11.  
  12. //This loop is used to roll and check all the Dice
  13. var i=1;
  14. for(i<DCount){
  15. Test=[[1d6]];
  16. NTest=Test;
  17. while(Test=6){ //this loop is for exploding dice
  18. Test=[[1d6]];
  19. NTest+=Test;
  20. };
  21. if(NTest>=TN){SCount++};
  22. if(NTest=1){CCount++);
  23. if(NTest>=BN){BCount++};
  24. };
  25. //I then need to output the results, but I don't know the syntax
  26. //but I want it to be something like this
  27. //You rolled [SCount] Successes, [CCount] Complications, and [BCount]Boons.
  28. //If there is an easy way to show the individual die-rolls that would be good too
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement