1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
//Battle with Samer
#include <iostream>
#include <string>
#include <sstream>
#include <ctime>
#include <cstdlib>
using namespace std;
struct Opponent{
string name;
int health;
int attack;
};
struct Mystats {
string name;
int health;
int attack;
};
Opponent samer[6] = {
"Charizard", 20, 10,
"Umbreon", 15, 10,
"Mew", 25, 15,
"Arcanine", 15, 15,
"Espurr", 10, 15,
"Luxaray", 10, 10
};
Mystats trainer[3] = {
"Charizard", 20, 10,
"Slowking", 30, 6,
"Weavile", 15, 15
};
int main()
{
string mystr;
string Samer;
string Trainer;
int samer_choice;
int player_choice;
cout << "Musician Samer wants to battle! \n";
cout << "Go, ";
srand((unsigned)time(0));
samer_choice = rand() % 6;
cout << samer[samer_choice].name << "!" << "\n";
cout << "Please choose your Pokemon: \n";
cout << "Press 1 for Charizard \n";
cout << "Press 2 for Slowking \n";
cout << "Press 3 for Weavile \n";
getline(cin, mystr);
stringstream(mystr) >> player_choice;
cout << trainer[player_choice-1].name<< endl;
system("PAUSE");
}
|