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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
#include<iostream>
#include<cstdlib>
#include <stdlib.h>
#include<ctime>
#include<windows.h>
#include<math.h>
void Menu();
using namespace std;
class stats
{
public:
int HP, MP, ATTK, Mhp, Mattk, Distance, Bhp, Bmp, Battk, currentGold, level, exp;
stats()
{
HP = 10; //base hp
MP = 5; //base mp
ATTK = 2; //base attack
Mhp = 20; //base mobs attack
Mattk = 2; //base mobs attack
Distance =10; //base distance
Bhp = 100; //base boss hp
Bmp = 100; //base boss mp
Battk = 4; //base boss attack
currentGold = 250; //base gold 250
level = 1; //base level of all including mobs and boss
exp = 0; //base experience
}
};
class itemprice
{
public:
int HP_Potion, MP_Potion, Attack_Potion, Helmet, Armour, Leggings, Boots, Arms, Sword;
itemprice()
{
HP_Potion = 25;
MP_Potion = 25;
Attack_Potion = 30;
Helmet = 500;
Armour = 500;
Leggings = 500;
Boots = 500;
Arms = 500;
Sword = 1000;
}
};
string pname;
void animate1(string msg1) //animate the text print by letter
{
int x;
for(int x=0; msg1[x] != '\0'; x++)
{
Sleep(90);
cout <<msg1[x];
if( msg1[x] == ' ')
Sleep(50);
if( msg1[x] == '\n')
Sleep(1000);
}
}
void animate2(string name) //animate the another print by letter
{
int z;
for(int z=0; name[z] != '\0'; z++)
{
Sleep(90);
cout <<name[z];
if( name[z] == ' ')
Sleep(50);
}
}
void centerstring2(string a)
{
int l=a.length();
int pos=(int)((30-1)/2);
for(int i=0;i<pos;i++)
cout<<" ";
cout<<a;
}
void centerstring(string s)
{
int l=s.length();
int pos=(int)((80-l)/2);
for(int i=0;i<pos;i++)
cout<<" ";
cout<<s;
}
int itemselect(int c_item)
{
switch(c_item)
{
case 1:
cout<< "HP Potion";
break;
case 2:
cout<< "MP Potion";
break;
case 3:
cout<< "Attack Potion";
break;
case 4:
cout<< "Helmet";
break;
case 5:
cout<< "Armour";
break;
case 6:
cout<< "Leggings";
break;
case 7:
cout<< "Boots";
break;
case 8:
cout<< "Arms";
break;
case 9:
cout<< "Sword";
break;
case 0:
break;
}
}
|