/* * Dire_Storm * Gunner DPS Calculator * 11 July 2016 */ #include <iostream> #include <iomanip> #include <string> const int weapons = 33; struct Gun{ // Gunner's weapon std::string name; // Name of gun int AT_min; // Minimum ATtack damage int AT_max; // Maximum ATtack damage int AGI_min; // Fastest rate of fire (minimum number of frames between shots) int AGI_max; // Slowest rate of fire (maximum number of frames between shots) int PC; // Projectile count }; struct Character{ // Gunner character int STR; // STRength stat in Gunner int DEX; // DEXterity stat in Gunner }; // Sets values to each Gun (Gun catalogue) void setGuns(Gun Guns[]){ Guns[0].name = "Gun"; Guns[0].AT_min = 2; Guns[0].AT_max = 6; Guns[0].AGI_min = 20; Guns[0].AGI_max = 30; Guns[0].PC = 1; Guns[1].name = "Handgun"; Guns[1].AT_min = 8; Guns[1].AT_max = 12; Guns[1].AGI_min = 20; Guns[1].AGI_max = 30; Guns[1].PC = 1; Guns[2].name = "Submachine-gun"; Guns[2].AT_min = 4; Guns[2].AT_max = 8; Guns[2].AGI_min = 5; Guns[2].AGI_max = 10; Guns[2].PC = 1; Guns[3].name = "Shotgun"; Guns[3].AT_min = 1; Guns[3].AT_max = 20; Guns[3].AGI_min = 50; Guns[3].AGI_max = 60; Guns[3].PC = 5; Guns[4].name = "Rifle"; Guns[4].AT_min = 20; Guns[4].AT_max = 40; Guns[4].AGI_min = 50; Guns[4].AGI_max = 60; Guns[4].PC = 1; /*Guns[5].name = "Grenade"; Guns[5].AT_min = 8; Guns[5].AT_max = 12; Guns[5].AGI_min = 70; Guns[5].AGI_max = 80; Guns[5].PC = 1;*/ /*Guns[6].name = "Laser Gun"; Guns[6].AT_min = 8; Guns[6].AT_max = 12; Guns[6].AGI_min = 20; Guns[6].AGI_max = 30; Guns[6].PC = 1;*/ /*Guns[7].name = "Bazooka"; Guns[7].AT_min = 40; Guns[7].AT_max = 60; Guns[7].AGI_min = 80; Guns[7].AGI_max = 90; Guns[7].PC = 1;*/ Guns[8].name = "Homing Laser"; Guns[8].AT_min = 8; Guns[8].AT_max = 12; Guns[8].AGI_min = 20; Guns[8].AGI_max = 30; Guns[8].PC = 2; Guns[9].name = "Beretta"; Guns[9].AT_min = 24; Guns[9].AT_max = 36; Guns[9].AGI_min = 20; Guns[9].AGI_max = 30; Guns[9].PC = 1; Guns[10].name = "Uzi"; Guns[10].AT_min = 12; Guns[10].AT_max = 24; Guns[10].AGI_min = 5; Guns[10].AGI_max = 10; Guns[10].PC = 1; Guns[11].name = "Remington"; Guns[11].AT_min = 1; Guns[11].AT_max = 40; Guns[11].AGI_min = 50; Guns[11].AGI_max = 60; Guns[11].PC = 7; Guns[12].name = "Sniper Rifle"; Guns[12].AT_min = 60; Guns[12].AT_max = 80; Guns[12].AGI_min = 50; Guns[12].AGI_max = 60; Guns[12].PC = 1; /*Guns[13].name = "Grenade Launcher"; Guns[13].AT_min = 12; Guns[13].AT_max = 24; Guns[13].AGI_min = 70; Guns[13].AGI_max = 80; Guns[13].PC = 1;*/ /*Guns[14].name = "Laser Beam Gun"; Guns[14].AT_min = 16; Guns[14].AT_max = 24; Guns[14].AGI_min = 20; Guns[14].AGI_max = 30; Guns[14].PC = 1;*/ /*Guns[15].name = "Cannon"; Guns[15].AT_min = 80; Guns[15].AT_max = 120; Guns[15].AGI_min = 80; Guns[15].AGI_max = 90; Guns[15].PC = 1;*/ Guns[16].name = "Homing Laser Beam"; Guns[16].AT_min = 8; Guns[16].AT_max = 12; Guns[16].AGI_min = 20; Guns[16].AGI_max = 30; Guns[16].PC = 5; Guns[17].name = "3-Round Burst"; Guns[17].AT_min = 24; Guns[17].AT_max = 36; Guns[17].AGI_min = 20; Guns[17].AGI_max = 30; Guns[17].PC = 3; Guns[18].name = "Missile"; Guns[18].AT_min = 300; Guns[18].AT_max = 500; Guns[18].AGI_min = 160; Guns[18].AGI_max = 180; Guns[18].PC = 1; Guns[19].name = "Mini Uzi"; Guns[19].AT_min = 12; Guns[19].AT_max = 24; Guns[19].AGI_min = 5; Guns[19].AGI_max = 10; Guns[19].PC = 2; Guns[20].name = "Scattergun"; Guns[20].AT_min = 1; Guns[20].AT_max = 80; Guns[20].AGI_min = 50; Guns[20].AGI_max = 60; Guns[20].PC = 9; Guns[21].name = "Hunting Gun"; Guns[21].AT_min = 140; Guns[21].AT_max = 160; Guns[21].AGI_min = 50; Guns[21].AGI_max = 60; Guns[21].PC = 1; /*Guns[22].name = "M9 Grenade"; Guns[22].AT_min = 18; Guns[22].AT_max = 48; Guns[22].AGI_min = 20; Guns[22].AGI_max = 30; Guns[22].PC = 1;*/ /*Guns[23].name = "Power Laser Gun"; Guns[23].AT_min = 24; Guns[23].AT_max = 36; Guns[23].AGI_min = 20; Guns[23].AGI_max = 30; Guns[23].PC = 1;*/ /*Guns[24].name = "Napalm Bomb"; Guns[24].AT_min = 0; Guns[24].AT_max = 0; Guns[24].AGI_min = 160; Guns[24].AGI_max = 180; Guns[24].PC = 1;*/ /*Guns[25].name = "Wave Cannon"; Guns[25].AT_min = 120; Guns[25].AT_max = 180; Guns[25].AGI_min = 80; Guns[25].AGI_max = 90; Guns[25].PC = 1;*/ Guns[26].name = "Pierce Homing"; Guns[26].AT_min = 12; Guns[26].AT_max = 16; Guns[26].AGI_min = 20; Guns[26].AGI_max = 30; Guns[26].PC = 7; Guns[27].name = "Magnum"; Guns[27].AT_min = 80; Guns[27].AT_max = 120; Guns[27].AGI_min = 20; Guns[27].AGI_max = 30; Guns[27].PC = 1; Guns[28].name = "Micro Uzi"; Guns[28].AT_min = 16; Guns[28].AT_max = 32; Guns[28].AGI_min = 5; Guns[28].AGI_max = 10; Guns[28].PC = 3; Guns[29].name = "Triple Shotgun"; Guns[29].AT_min = 1; Guns[29].AT_max = 120; Guns[29].AGI_min = 50; Guns[29].AGI_max = 60; Guns[29].PC = 15; Guns[30].name = "Rail Gun"; Guns[30].AT_min = 300; Guns[30].AT_max = 320; Guns[30].AGI_min = 50; Guns[30].AGI_max = 60; Guns[30].PC = 1; /*Guns[31].name = "Napalm Gun"; Guns[31].AT_min = 26; Guns[31].AT_max = 96; Guns[31].AGI_min = 70; Guns[31].AGI_max = 80; Guns[31].PC = 1;*/ /*Guns[32].name = "Slow Laser Gun"; Guns[32].AT_min = 32; Guns[32].AT_max = 48; Guns[32].AGI_min = 20; Guns[32].AGI_max = 30; Guns[32].PC = 1;*/ } // Sets values to the Gunner character void getStats(Character &Gunner1, int &LVL){ std::cout << "Enter characters' level: "; std::cin >> LVL; std::cout << LVL << std::endl; Gunner1.STR = LVL - 1; // Evenly distribute STR and DEX Gunner1.DEX = LVL - 1; } // Calculates DPS for each gun equipped on the gunner character // How to get DPS: (AT + STR*2%) * (AGI / 2%*DEX) void calcDPS(Character Gunner1, Gun Guns[], int LVL){ float DPS; // Damage per 60 frames float DPS_max = 0; // Maximum DPS int DPS_max_STR, DPS_max_DEX; // STR and DEX allocation for maximum DPS int AGImin, AGImax; // Minimum and maximum ATtack damage float AGI; // Average AGIlity (number of frames between shots) int ATmin, ATmax; // Minimum and maximum ATtack damage float AT; // Average ATtack damage int range = (LVL - 1) * 2; // Range of stats to calculate (currently set to go from 0 to max) for (int i = 0; i < weapons; i++){ // Runs for the number of weapons if (Guns[i].name == "") continue; // Skip over commented out Guns for (int k = 0; k <= range; k++){ // Loop for going through full range of STR/DEX // Calculates average AT ATmin = Guns[i].AT_min * (1 + 0.02 * (Gunner1.STR - (range/2 - k))); // Minimum AT calculation ATmax = Guns[i].AT_max * (1 + 0.02 * (Gunner1.STR - (range/2 - k))); // Maximum AT calculation AT = (ATmin + ATmax) / 2.; // Average AT calculation // Calculates average AGI AGImin = Guns[i].AGI_min / (1 + 0.02 * (Gunner1.DEX + range/2 - k)); // Minimum AGI calculation if (AGImin < 5) AGImin = 5; // AGImin caps at 5 AGImax = Guns[i].AGI_max / (1 + 0.02 * (Gunner1.DEX + range/2 - k)); // Maximum AGI calculation if (AGImax < 10) AGImax = 10; // AGImin caps at 10 AGI = (AGImin + AGImax) / 2.; // Average AGI calculation // Calculates average DPS DPS = AT * (60 / AGI); // Calculates maximum DPS if (DPS > DPS_max){ DPS_max = DPS; // Store maximum DPS DPS_max_STR = Gunner1.STR - (range/2 - k); // Store STR parameter of maximum DPS DPS_max_DEX = Gunner1.DEX + (range/2 - k); // Store DEX parameter of maximum DPS } } // Outputs table of optimum STR/DEX allocation for maximum DPS of each Gun std::cout << "DPS max for " << std::setw(17) << Guns[i].name << ": "; std::cout << "STR " << std::setw(3) << DPS_max_STR; // STR std::cout << " DEX " << std::setw(3) << DPS_max_DEX; // DEX std::cout << " DPS = " << DPS_max * Guns[i].PC << std::endl; // DPS DPS_max = DPS_max_STR = DPS_max_DEX = 0; // Reset maximums } std::cout << std::endl; } int main(){ Character Gunner1; // Gunner character Gun Guns[weapons]; // Array of guns to calculate int LVL; // Level of your team setGuns(Guns); getStats(Gunner1, LVL); while (LVL){ calcDPS(Gunner1, Guns, LVL); getStats(Gunner1, LVL); } return 0; }
15 14 13 12 11 10 9 1 0
Enter characters' level: 15 DPS max for Gun: STR 25 DEX 3 DPS = 15.6522 DPS max for Handgun: STR 19 DEX 9 DPS = 39.5122 DPS max for Submachine-gun: STR 25 DEX 3 DPS = 72 DPS max for Shotgun: STR 15 DEX 13 DPS = 94.186 DPS max for Rifle: STR 15 DEX 13 DPS = 54.4186 DPS max for Homing Laser: STR 19 DEX 9 DPS = 79.0244 DPS max for Beretta: STR 15 DEX 13 DPS = 121.579 DPS max for Uzi: STR 28 DEX 0 DPS = 220 DPS max for Remington: STR 15 DEX 13 DPS = 258.837 DPS max for Sniper Rifle: STR 15 DEX 13 DPS = 126.977 DPS max for Homing Laser Beam: STR 19 DEX 9 DPS = 197.561 DPS max for 3-Round Burst: STR 15 DEX 13 DPS = 364.737 DPS max for Missile: STR 15 DEX 13 DPS = 232.836 DPS max for Mini Uzi: STR 28 DEX 0 DPS = 440 DPS max for Scattergun: STR 15 DEX 13 DPS = 659.302 DPS max for Hunting Gun: STR 15 DEX 13 DPS = 272.093 DPS max for Pierce Homing: STR 22 DEX 6 DPS = 390.698 DPS max for Magnum: STR 15 DEX 13 DPS = 410.526 DPS max for Micro Uzi: STR 27 DEX 1 DPS = 876 DPS max for Triple Shotgun: STR 15 DEX 13 DPS = 1643.02 DPS max for Rail Gun: STR 15 DEX 13 DPS = 562.326 Enter characters' level: 14 DPS max for Gun: STR 0 DEX 26 DPS = 15 DPS max for Handgun: STR 13 DEX 13 DPS = 39.4737 DPS max for Submachine-gun: STR 25 DEX 1 DPS = 72 DPS max for Shotgun: STR 10 DEX 16 DPS = 91.4634 DPS max for Rifle: STR 10 DEX 16 DPS = 52.6829 DPS max for Homing Laser: STR 13 DEX 13 DPS = 78.9474 DPS max for Beretta: STR 13 DEX 13 DPS = 118.421 DPS max for Uzi: STR 25 DEX 1 DPS = 216 DPS max for Remington: STR 10 DEX 16 DPS = 250.976 DPS max for Sniper Rifle: STR 10 DEX 16 DPS = 122.927 DPS max for Homing Laser Beam: STR 13 DEX 13 DPS = 197.368 DPS max for 3-Round Burst: STR 13 DEX 13 DPS = 355.263 DPS max for Missile: STR 13 DEX 13 DPS = 225.672 DPS max for Mini Uzi: STR 25 DEX 1 DPS = 432 DPS max for Scattergun: STR 10 DEX 16 DPS = 638.78 DPS max for Hunting Gun: STR 10 DEX 16 DPS = 263.415 DPS max for Pierce Homing: STR 13 DEX 13 DPS = 386.842 DPS max for Magnum: STR 13 DEX 13 DPS = 396.316 DPS max for Micro Uzi: STR 25 DEX 1 DPS = 864 DPS max for Triple Shotgun: STR 10 DEX 16 DPS = 1591.46 DPS max for Rail Gun: STR 13 DEX 13 DPS = 544.884 Enter characters' level: 13 DPS max for Gun: STR 0 DEX 24 DPS = 14.5455 DPS max for Handgun: STR 13 DEX 11 DPS = 37.5 DPS max for Submachine-gun: STR 19 DEX 5 DPS = 64 DPS max for Shotgun: STR 10 DEX 14 DPS = 88.2353 DPS max for Rifle: STR 15 DEX 9 DPS = 50.8696 DPS max for Homing Laser: STR 13 DEX 11 DPS = 75 DPS max for Beretta: STR 11 DEX 13 DPS = 113.684 DPS max for Uzi: STR 23 DEX 1 DPS = 208 DPS max for Remington: STR 10 DEX 14 DPS = 242.118 DPS max for Sniper Rifle: STR 15 DEX 9 DPS = 118.696 DPS max for Homing Laser Beam: STR 13 DEX 11 DPS = 187.5 DPS max for 3-Round Burst: STR 11 DEX 13 DPS = 341.053 DPS max for Missile: STR 11 DEX 13 DPS = 218.507 DPS max for Mini Uzi: STR 23 DEX 1 DPS = 416 DPS max for Scattergun: STR 15 DEX 9 DPS = 616.304 DPS max for Hunting Gun: STR 11 DEX 13 DPS = 254.651 DPS max for Pierce Homing: STR 13 DEX 11 DPS = 367.5 DPS max for Magnum: STR 11 DEX 13 DPS = 383.684 DPS max for Micro Uzi: STR 24 DEX 0 DPS = 840 DPS max for Triple Shotgun: STR 11 DEX 13 DPS = 1538.37 DPS max for Rail Gun: STR 11 DEX 13 DPS = 527.442 Enter characters' level: 12 DPS max for Gun: STR 0 DEX 22 DPS = 14.5455 DPS max for Handgun: STR 13 DEX 9 DPS = 36.5854 DPS max for Submachine-gun: STR 19 DEX 3 DPS = 64 DPS max for Shotgun: STR 15 DEX 7 DPS = 85.2632 DPS max for Rifle: STR 15 DEX 7 DPS = 49.2632 DPS max for Homing Laser: STR 13 DEX 9 DPS = 73.1707 DPS max for Beretta: STR 9 DEX 13 DPS = 110.526 DPS max for Uzi: STR 21 DEX 1 DPS = 204 DPS max for Remington: STR 9 DEX 13 DPS = 234.419 DPS max for Sniper Rifle: STR 15 DEX 7 DPS = 114.947 DPS max for Homing Laser Beam: STR 13 DEX 9 DPS = 182.927 DPS max for 3-Round Burst: STR 9 DEX 13 DPS = 331.579 DPS max for Missile: STR 9 DEX 13 DPS = 211.343 DPS max for Mini Uzi: STR 21 DEX 1 DPS = 408 DPS max for Scattergun: STR 15 DEX 7 DPS = 596.842 DPS max for Hunting Gun: STR 15 DEX 7 DPS = 246.316 DPS max for Pierce Homing: STR 13 DEX 9 DPS = 358.537 DPS max for Magnum: STR 9 DEX 13 DPS = 371.053 DPS max for Micro Uzi: STR 22 DEX 0 DPS = 828 DPS max for Triple Shotgun: STR 15 DEX 7 DPS = 1487.37 DPS max for Rail Gun: STR 9 DEX 13 DPS = 510 Enter characters' level: 11 DPS max for Gun: STR 0 DEX 20 DPS = 13.7143 DPS max for Handgun: STR 13 DEX 7 DPS = 34.8837 DPS max for Submachine-gun: STR 19 DEX 1 DPS = 64 DPS max for Shotgun: STR 10 DEX 10 DPS = 82.4176 DPS max for Rifle: STR 10 DEX 10 DPS = 47.4725 DPS max for Homing Laser: STR 13 DEX 7 DPS = 69.7674 DPS max for Beretta: STR 7 DEX 13 DPS = 107.368 DPS max for Uzi: STR 19 DEX 1 DPS = 196 DPS max for Remington: STR 9 DEX 11 DPS = 226.517 DPS max for Sniper Rifle: STR 7 DEX 13 DPS = 110.93 DPS max for Homing Laser Beam: STR 13 DEX 7 DPS = 174.419 DPS max for 3-Round Burst: STR 7 DEX 13 DPS = 322.105 DPS max for Missile: STR 7 DEX 13 DPS = 204.179 DPS max for Mini Uzi: STR 19 DEX 1 DPS = 392 DPS max for Scattergun: STR 7 DEX 13 DPS = 577.674 DPS max for Hunting Gun: STR 13 DEX 7 DPS = 238.105 DPS max for Pierce Homing: STR 7 DEX 13 DPS = 342.632 DPS max for Magnum: STR 7 DEX 13 DPS = 358.421 DPS max for Micro Uzi: STR 19 DEX 1 DPS = 792 DPS max for Triple Shotgun: STR 13 DEX 7 DPS = 1440 DPS max for Rail Gun: STR 13 DEX 7 DPS = 493.263 Enter characters' level: 10 DPS max for Gun: STR 0 DEX 18 DPS = 13.3333 DPS max for Handgun: STR 9 DEX 9 DPS = 33.6585 DPS max for Submachine-gun: STR 13 DEX 5 DPS = 60 DPS max for Shotgun: STR 5 DEX 13 DPS = 80.2326 DPS max for Rifle: STR 5 DEX 13 DPS = 46.0465 DPS max for Homing Laser: STR 9 DEX 9 DPS = 67.3171 DPS max for Beretta: STR 5 DEX 13 DPS = 102.632 DPS max for Uzi: STR 17 DEX 1 DPS = 192 DPS max for Remington: STR 5 DEX 13 DPS = 219.767 DPS max for Sniper Rifle: STR 5 DEX 13 DPS = 107.442 DPS max for Homing Laser Beam: STR 9 DEX 9 DPS = 168.293 DPS max for 3-Round Burst: STR 5 DEX 13 DPS = 307.895 DPS max for Missile: STR 9 DEX 9 DPS = 197.352 DPS max for Mini Uzi: STR 17 DEX 1 DPS = 384 DPS max for Scattergun: STR 5 DEX 13 DPS = 558.837 DPS max for Hunting Gun: STR 11 DEX 7 DPS = 230.526 DPS max for Pierce Homing: STR 5 DEX 13 DPS = 331.579 DPS max for Magnum: STR 5 DEX 13 DPS = 347.368 DPS max for Micro Uzi: STR 18 DEX 0 DPS = 768 DPS max for Triple Shotgun: STR 11 DEX 7 DPS = 1392.63 DPS max for Rail Gun: STR 11 DEX 7 DPS = 477.474 Enter characters' level: 9 DPS max for Gun: STR 0 DEX 16 DPS = 12.973 DPS max for Handgun: STR 13 DEX 3 DPS = 32.6087 DPS max for Submachine-gun: STR 13 DEX 3 DPS = 60 DPS max for Shotgun: STR 5 DEX 11 DPS = 77.5281 DPS max for Rifle: STR 10 DEX 6 DPS = 44.5361 DPS max for Homing Laser: STR 13 DEX 3 DPS = 65.2174 DPS max for Beretta: STR 7 DEX 9 DPS = 99.5122 DPS max for Uzi: STR 15 DEX 1 DPS = 184 DPS max for Remington: STR 5 DEX 11 DPS = 212.36 DPS max for Sniper Rifle: STR 10 DEX 6 DPS = 103.918 DPS max for Homing Laser Beam: STR 13 DEX 3 DPS = 163.043 DPS max for 3-Round Burst: STR 7 DEX 9 DPS = 298.537 DPS max for Missile: STR 10 DEX 6 DPS = 190.728 DPS max for Mini Uzi: STR 15 DEX 1 DPS = 368 DPS max for Scattergun: STR 7 DEX 9 DPS = 540 DPS max for Hunting Gun: STR 9 DEX 7 DPS = 222.947 DPS max for Pierce Homing: STR 10 DEX 6 DPS = 322.326 DPS max for Magnum: STR 10 DEX 6 DPS = 334.884 DPS max for Micro Uzi: STR 16 DEX 0 DPS = 756 DPS max for Triple Shotgun: STR 10 DEX 6 DPS = 1345.36 DPS max for Rail Gun: STR 9 DEX 7 DPS = 461.684 Enter characters' level: 1 DPS max for Gun: STR 0 DEX 0 DPS = 9.6 DPS max for Handgun: STR 0 DEX 0 DPS = 24 DPS max for Submachine-gun: STR 0 DEX 0 DPS = 48 DPS max for Shotgun: STR 0 DEX 0 DPS = 57.2727 DPS max for Rifle: STR 0 DEX 0 DPS = 32.7273 DPS max for Homing Laser: STR 0 DEX 0 DPS = 48 DPS max for Beretta: STR 0 DEX 0 DPS = 72 DPS max for Uzi: STR 0 DEX 0 DPS = 144 DPS max for Remington: STR 0 DEX 0 DPS = 156.545 DPS max for Sniper Rifle: STR 0 DEX 0 DPS = 76.3636 DPS max for Homing Laser Beam: STR 0 DEX 0 DPS = 120 DPS max for 3-Round Burst: STR 0 DEX 0 DPS = 216 DPS max for Missile: STR 0 DEX 0 DPS = 141.176 DPS max for Mini Uzi: STR 0 DEX 0 DPS = 288 DPS max for Scattergun: STR 0 DEX 0 DPS = 397.636 DPS max for Hunting Gun: STR 0 DEX 0 DPS = 163.636 DPS max for Pierce Homing: STR 0 DEX 0 DPS = 235.2 DPS max for Magnum: STR 0 DEX 0 DPS = 240 DPS max for Micro Uzi: STR 0 DEX 0 DPS = 576 DPS max for Triple Shotgun: STR 0 DEX 0 DPS = 990 DPS max for Rail Gun: STR 0 DEX 0 DPS = 338.182 Enter characters' level: 0