Advertisement
heroofhyla

5e encounter budget

Jul 25th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.11 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class EncPlan {
  5.     int partycount;
  6.     int[] levels;
  7.     int enemycount;
  8.     int[] CRs;
  9.    
  10.     int[] medExpTarget = {50,100,150,250,500,
  11.             600,750,900,1100,1200,1600,2000,
  12.             2200,2500,2800,3200,3900,4200,4900,5700};
  13.     int[] hardExpTarget = {75,150,225,375,750,900,
  14.             1100,1400,1600,1900,2400,3000,3400,3800,4300,
  15.             4800,5900,6300,7300,8500};
  16.     double[] multipliers = {.5, 1, 1.5, 2, 2.5, 3, 4};
  17.     String[] monstCountDesc = {"1 monster", "2 monsters", "3-6 monsters", "7-10 monsters", "11-14 monsters"};
  18.    
  19.     public static void main(String[] args){
  20.        
  21.         EncPlan e = new EncPlan();
  22.         try(Scanner s = new Scanner(System.in)){
  23.             System.out.println("Enter party count");
  24.             e.partycount = s.nextInt();
  25.             System.out.println("Enter level of each party member.");
  26.             e.levels = new int[e.partycount];
  27.             for (int i = 0; i < e.levels.length; ++i){
  28.                 e.levels[i] = s.nextInt();
  29.             }
  30.            
  31.             int medExpBudget = 0;
  32.             for (int i = 0; i < e.levels.length; ++i){
  33.                 medExpBudget += e.medExpTarget[e.levels[i] - 1];
  34.             }
  35.            
  36.             int hardExpBudget = 0;
  37.             for (int i = 0; i < e.levels.length; ++i){
  38.                 hardExpBudget += e.hardExpTarget[e.levels[i] - 1];
  39.             }
  40.  
  41.             System.out.println("For medium encounters, shoot for one of the following:");
  42.             for (int i = 0; i < e.monstCountDesc.length; ++i){
  43.                 int multiplierIndex = i+1;
  44.                 if (e.partycount < 3) ++multiplierIndex;
  45.                 if (e.partycount > 5) --multiplierIndex;
  46.                 double currMult = e.multipliers[multiplierIndex];
  47.                 double budget = medExpBudget/currMult;
  48.                 System.out.println(e.monstCountDesc[i] + " worth a total of " + (int)budget + " exp.");
  49.  
  50.             }
  51.            
  52.             System.out.println("\n\nFor hard encounters, shoot for one of the following:");
  53.             for (int i = 0; i < e.monstCountDesc.length; ++i){
  54.                 int multiplierIndex = i+1;
  55.                 if (e.partycount < 3) ++multiplierIndex;
  56.                 if (e.partycount > 5) --multiplierIndex;
  57.                 double currMult = e.multipliers[multiplierIndex];
  58.                 double budget = hardExpBudget/currMult;
  59.                 System.out.println(e.monstCountDesc[i] + " worth a total of " + (int)budget + " exp.");
  60.  
  61.             }
  62.  
  63.            
  64.         }
  65.        
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement