Advertisement
Guest User

Glimmershotcalculator

a guest
Dec 17th, 2015
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1.  
  2. /**
  3. * SirYe's Glimmershot Calculator
  4. */
  5. public class abilityDamageCalculator
  6. {
  7. private static KeyboardReader reader = new KeyboardReader();
  8. private static double wpF, cpF, pierceF, finalCalc, critPlus = 1.5;
  9. private static boolean tensionBow;
  10. public static void calculate(){
  11. System.out.println("This is the damage calculator");
  12. wpRatio();
  13. cpRatio();
  14. enemyCalculations();
  15. }
  16.  
  17. public static void wpRatio(){
  18. double ratio = reader.readDouble("What is the WP ratio? (input 0 for none, make sure it's in decimal form): ");
  19. double wp = reader.readDouble("What is the total WP? (include basic attacks if applicable(Kestrel)): ");
  20. double pierce = reader.readDouble("Total pierce? (decimal form): ");
  21. critPlus += reader.readDouble("increase in crit damage? (decimal form): ");
  22. while(true){
  23. int tensionB = reader.readInt("Is there a tension Bow?(1 for yes, 0 for no): ");
  24. if (tensionB == 1){
  25. wpF -= 180;
  26. tensionBow = true;
  27. break;
  28. }
  29. else if (tensionB == 0)
  30. break;
  31. else
  32. System.out.println("Invalid Response");
  33. }
  34. if (ratio <= 0.01)
  35. return;
  36.  
  37. pierceF = pierce;
  38. wpF = wp*ratio;
  39.  
  40. }
  41.  
  42. public static void cpRatio(){
  43. double cp = reader.readDouble("What is total CP? ");
  44. double baseCp = reader.readDouble("Is there a base Cp damage? ");
  45. double ratio = reader.readDouble("What is the CP ratio? (input 0 for none, make sure it's in decimal form): ");
  46. cpF = baseCp+(cp*ratio);
  47. if (ratio <= 0.01)
  48. return;
  49.  
  50. }
  51.  
  52. public static void enemyCalculations(){
  53. double armor = reader.readDouble("How much armor does the enemy have? ");
  54. double shield = reader.readDouble("How much shield does the enemy have? ");
  55. double wpMultiplier = 1 - pierceF;
  56. double damageCalcWeapon = (wpMultiplier*wpF)/(1 + (armor/100.0));
  57. double damageCalcTensionBow = (wpMultiplier*180.0)/(1 + (armor/100.0));
  58. double cpCalc = (cpF)/(1 + (shield/100.0));
  59. if (tensionBow = true)
  60. finalCalc = (critPlus)*(damageCalcWeapon + pierceF*wpF) + damageCalcTensionBow + (pierceF*180);
  61.  
  62. System.out.println(finalCalc + " WP Damage with crit activated!\n "+cpCalc + "CP Damage");
  63.  
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement