Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TODO: loading tierlists from extenel list
- // or download and parse PO's raw.zip
- // =====================================================================
- // PokeDraft Pack Generator 0.1b
- // by kobo1d
- // 07/12/2011
- // Compiler: Microsoft Visual C++ 2008
- // Main.cpp
- // =====================================================================
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- #include <time.h>
- #include "Pokemon.h"
- using namespace std;
- int lowPokes = 4;
- int midPokes = 3;
- int highPokes = 3;
- int MIN_HIGH = 1;
- int MAX_HIGH = 39;
- int MIN_MID = 40;
- int MAX_MID = 63;
- int MIN_LOW = 64;
- int MAX_LOW = 118;
- int packSize = lowPokes + midPokes + highPokes;
- int tier = 1;
- ofstream myfile;
- const int totalTiers = 5;
- char tierNames[totalTiers][10] = { "Uber", "OU", "UU", "RU", "LC"};
- int tierConfig[totalTiers][6] = {
- //MIN_HIGH, MAX_HIGH, MIN_MID, MAX_MID, MIN_LOW, MAX_LOW
- {1, 26, 27, 46, 47, 114}, // Tier 0 - Uber
- {1, 39, 40, 63, 64, 118}, // Tier 1 ...
- {1, 35, 36, 70, 71, 135},
- {1, 34, 35, 80, 31, 141},
- {1, 25, 26, 36, 37, 69},
- };
- // to add a tier increment totalTiers (and array dimension in Pokemon.h), add it's name to tierNames, its config to tierConfig and thelist of pokemon to pokemonNames from Pokemon.h
- class Pack {
- public:
- void Create(int mode, int customConfig[]) {
- int pick;
- int poke;
- int* config;
- if (mode)
- config = customConfig;
- else
- config = tierConfig[tier];
- for (pick = 0; pick < highPokes || pick < packSize; pick++){
- poke = rand() % (config[1]-config[0]) + config[0];
- cout << pokemonNames[tier][poke] << endl;
- myfile << pick << pokemonNames[tier][poke] << "\n";
- }
- for (pick = (0+highPokes); pick < (midPokes+highPokes)|| pick < packSize; pick++){
- poke = rand() % (config[3]-config[2]) + config[2];
- cout << pokemonNames[tier][poke] << endl;
- myfile << pick << pokemonNames[tier][poke] << "\n";
- }
- for (pick = (0+highPokes+midPokes); pick < packSize; pick++){
- poke = rand()% (config[5]-config[4]) + config[4];
- cout << pokemonNames[tier][poke] << endl;
- myfile << pick << pokemonNames[tier][poke] << "\n";
- }
- cout << endl;
- }
- };
- int main(void) {
- int mode = 0;
- int keepGoing = 1;
- int qtyPlayers = 0;
- int qtyPacks = 0;
- int starCount = 0;
- srand ( time(NULL) );
- cout << "kobo1d's PokeDraft Pack Generator" << endl;
- cout << "Current build uses Smogon's June 2011 Usage Stats" << endl << endl;
- do {
- myfile.open ("PackOutput.txt");
- myfile << "Pack Generator Output" << "\n";
- cout << "Simple or Advanced? " << endl;
- cout << "0 - Simple" << endl;
- cout << "1 - Advanced (custom pick borders)" << endl;
- cin >> mode;
- if (mode != 1 or mode !=0) {
- cout<<"Invalid input";
- continue;
- }
- int customConfig[6] = {1, 2, 3, 4, 5, 6};
- if (mode) {
- cout << "Number of Pokemon per pack in upper range? " << endl;
- cin >> highPokes;
- cout << "Number of Pokemon per pack in mid range? " << endl;
- cin >> midPokes;
- cout << "Number of Pokemon per pack in lower range? " << endl;
- cin >> lowPokes;
- packSize = highPokes + midPokes + lowPokes;
- if (highPokes) {
- cout << "MINIMUM usage ranking for upper range? " << endl;
- cin >> customConfig[0];
- cout << "MAXIMUM usage ranking for upper range? " << endl;
- cin >> customConfig[1];
- }
- if(midPokes) {
- cout << "MINIMUM usage ranking for mid range? " << endl;
- cin >> customConfig[2];
- cout << "MAXIMUM usage ranking for mid range? " << endl;
- cin >> customConfig[3];
- }
- if (lowPokes) {
- cout << "MINIMUM usage ranking for lower range? " << endl;
- cin >> customConfig[4];
- cout << "MAXIMUM usage ranking for lower range? " << endl;
- cin >> customConfig[5];
- }
- }
- cout << "How many packs would you like to create? ";
- cin >> qtyPacks;
- cout << "Which tier? " << endl;
- for(int i = 0; i<totalTiers; i++) {
- cout << i << " - " << tierNames[i] << endl;
- }
- cin >> tier;
- for (starCount = 0; starCount < qtyPacks; starCount++) {
- Pack newPack;
- cout << endl << "PACK " << starCount+1 << endl << endl;
- myfile << "\nPACK " << starCount+1 << "\n";
- newPack.Create(mode, customConfig);
- }
- myfile << "\n";
- myfile.close();
- cout << "Press 1 to restart program, 0 to exit: ";
- cin >> keepGoing;
- } while (keepGoing == 1);
- cout << "Most recent set of packs has been saved as PackOutput.txt, Goodbye!" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement