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;
const char* PokemonSamer[6] = {
"Charizard", "Umbreon", "Mew", "Arcanine", "Espurr", "Luxaray"
};
struct stats {
int health
int attack
};
stats Charizard, Umbreon, Mew, Arcanine, Espurr, Luxaray, Slowking, Weavile;
int main()
{
string mystr;
string Samer;
string Trainer;
Charizard.health=25;
Charizard.attack-15;
Umbreaon.health=20;
Umbreaon.attack=10;
Mew.health=30;
Mew.attack=20;
Arcanine.health=20;
Arcanine.attack=20;
Espurr.health=15;
Espurr.attack=25;
Luxaray.health=18;
Luaray.attack=20;
Slowking.health=45;
Slowking.attack=8;
Weavile.health=15;
Weavile.attack=25;
cout << "Musician Samer wants to battle!" "\n";
cout << "Go, ";
srand((unsigned)time(0));
Samer=PokemonSamer[rand() % 6];
cout << Samer << "!" << "\n";
cout << "Please Choose your Pokemon: \n";
cout << "Charizard, Slowking, Weavile \n";
getline(cin, mystr);
stringstream(mystr) >> Trainer;
cout << Trainer << ", I choose you! \n";
cout << "\n";
cout << "Would you like to attack? (yes or no) \n";
getline(cin, mystr);
system("PAUSE");
}
|