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
|
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <ctime>
using namespace std;
#include "rpglib.h"
#ifndef _RPGLIB_H_
#define _RPGLIB_H_
int main()
{
srand(time(0));
Player player("Adeon",100,10,10,5,10,6,16);
Mob pirate("Pirate",40,5,10,2);
Mob bandit("Bandit",50,10,15,2);
Mob wildbear("Wild Bear",70,10,20,2);
Mob * mob_table[3]={&pirate,&bandit,&wildbear};
bool fight=true;
int mob_id;
char c;
while (fight)
{
mob_id=random(0,2);
Battle(player,*mob_table[mob_id]);
system("cls");
cout << "Fight again? (y/n) ->";
cin>>c;
if (c=='n' || c=='N') break;
}
system("cls");
cout << "Thank you for playing!" << endl;
system("pause");
return 0;
}
|