Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * SirYe's Glimmershot Calculator
- */
- public class abilityDamageCalculator
- {
- private static KeyboardReader reader = new KeyboardReader();
- private static double wpF, cpF, pierceF, finalCalc, critPlus = 1.5;
- private static boolean tensionBow;
- public static void calculate(){
- System.out.println("This is the damage calculator");
- wpRatio();
- cpRatio();
- enemyCalculations();
- }
- public static void wpRatio(){
- double ratio = reader.readDouble("What is the WP ratio? (input 0 for none, make sure it's in decimal form): ");
- double wp = reader.readDouble("What is the total WP? (include basic attacks if applicable(Kestrel)): ");
- double pierce = reader.readDouble("Total pierce? (decimal form): ");
- critPlus += reader.readDouble("increase in crit damage? (decimal form): ");
- while(true){
- int tensionB = reader.readInt("Is there a tension Bow?(1 for yes, 0 for no): ");
- if (tensionB == 1){
- wpF -= 180;
- tensionBow = true;
- break;
- }
- else if (tensionB == 0)
- break;
- else
- System.out.println("Invalid Response");
- }
- if (ratio <= 0.01)
- return;
- pierceF = pierce;
- wpF = wp*ratio;
- }
- public static void cpRatio(){
- double cp = reader.readDouble("What is total CP? ");
- double baseCp = reader.readDouble("Is there a base Cp damage? ");
- double ratio = reader.readDouble("What is the CP ratio? (input 0 for none, make sure it's in decimal form): ");
- cpF = baseCp+(cp*ratio);
- if (ratio <= 0.01)
- return;
- }
- public static void enemyCalculations(){
- double armor = reader.readDouble("How much armor does the enemy have? ");
- double shield = reader.readDouble("How much shield does the enemy have? ");
- double wpMultiplier = 1 - pierceF;
- double damageCalcWeapon = (wpMultiplier*wpF)/(1 + (armor/100.0));
- double damageCalcTensionBow = (wpMultiplier*180.0)/(1 + (armor/100.0));
- double cpCalc = (cpF)/(1 + (shield/100.0));
- if (tensionBow = true)
- finalCalc = (critPlus)*(damageCalcWeapon + pierceF*wpF) + damageCalcTensionBow + (pierceF*180);
- System.out.println(finalCalc + " WP Damage with crit activated!\n "+cpCalc + "CP Damage");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement