#include <iostream>
#include <ctime>
#include <cstdlib>
#include <unistd.h>
using namespace std;
int randVal(int min,int max){
return (rand() % (max - min + 1) + min);
}
int main(){
srand(time(NULL));
int bb1,bb2,bb3,hh,aa,HE,ll,tp,na,at;
int bb4,bb5,bb6,hh2,aa2,HE2,ll2,tp2,na2,at2;
string Mhead[] = {"( 0 ^ 0 )","| 0 * 0 |","( =^_^= )","( >_< ) ","(<@> <@>)"};
string Mbody1[] = {"1#####1","[[[]]] "};
string Mbody2[] = {"1#####1","[[[]]] "};
string Mbody3[] = {"1#####1","[[[]]] ","| | "," _/|_ "};
string Mname[] = {"Abra","Aipom","Amaura","Arbok","Archen","Aron","Bagon","Beedrill","Beldum","Bayleef","baltoy","Cacnea","Cascoon","Delphox","CHARIZARD",
"Deino","Deerling","Ditto","Dragonair","Drampa","Drowzee","Dustox","Electrabuzz","Emboar","Fearow","Golem","Grimer","Guzzlord","Hypno","Inkay","Invysaur",
"Jolteon","Jynx","Koffinf","Lapras","Latias","Latios","Charmander","Mew","Nidioking","Nidoqueen","Onix","Pichu","Pikachu"};
string Mtype[] = {"Fire","Water","Earth","Air"};
HE = randVal(1,1000);
ll = randVal(1,100);
HE *= ll;
tp = randVal(0,3);
na = randVal(0,43);
aa = randVal(0,500);
at = randVal(0,1000);
cout<<"input 0,1,2,3, or 4 \n";
cin>>hh;
if(hh < 0 || hh > 4){
cout<<"INVALID INPUT!! re-enter \n";
cin>>hh;
if(hh < 0 || hh > 4){
cout<<"really...";
sleep(3);
return 0;
}
}
cout<<"Now, input 1 or 0 \n";
cin>>bb1;
if(bb1 < 0 || bb1 > 1){
cout<<"INVALID INPUT!! re-enter \n";
cin>>bb1;
if(bb1 < 0 || bb1 > 1){
cout<<"really...";
sleep(3);
return 0;
}
}
cout<<"again \n";
cin>>bb2;
if(bb2 < 0 || bb2 > 1){
cout<<"INVALID INPUT!! re-enter \n";
cin>>bb2;
if(bb2 < 0 || bb2 > 1){
cout<<"really...";
sleep(3);
return 0;
}
}
cout<<"once more, BUT this time 0,1,2, or 3! \n";
cin>>bb3;
if(bb3 < 0 || bb3 > 3){
cout<<"INVALID INPUT!! re-enter \n";
cin>>bb3;
if(bb3 < 0 || bb3 > 3){
cout<<"really...";
sleep(3);
return 0;
}
}
cout<<"-------------------- \n";
cout<<"YOUR MONSTER \n \n";
cout<<Mhead[hh]<<endl;
cout<<Mbody1[bb1]<<endl<<Mbody2[bb2]<<endl<<Mbody3[bb3]<<endl<<endl;
cout<<"Name: "<<Mname[na]<<endl;
cout<<"Level: "<<ll<<endl;
cout<<"Type: "<<Mtype[tp]<<endl;
cout<<"Health: "<<HE<<endl;
cout<<"Armour: "<<aa<<endl;
cout<<"Attack: "<<at<<endl;
sleep(4);
cout<<"-------------------- \n";
cout<<"HOSTILE MONSTER \n \n";
HE2 = randVal(1,1000);
ll2 = randVal(1,100);
HE2 *= ll2;
tp2 = randVal(0,3);
na2 = randVal(0,43);
aa2 = randVal(0,500);
at2 = randVal(0,1000);
bb4 = randVal(0,1);
bb5 = randVal(0,1);
bb6 = randVal(0,2);
hh2 = randVal(0,1);
cout<<Mhead[hh2]<<endl;
cout<<Mbody1[bb4]<<endl<<Mbody2[bb5]<<endl<<Mbody3[bb6]<<endl<<endl;
cout<<"Name: "<<Mname[na2]<<endl;
cout<<"Level: "<<ll2<<endl;
cout<<"Type: "<<Mtype[tp2]<<endl;
cout<<"Health: "<<HE2<<endl;
cout<<"Armour: "<<aa2<<endl;
cout<<"Attack: "<<at2<<endl;
sleep(4);
cout<<"-------------------- \n";
cout<<" !!!FIGHT!!! \n";
cout<<Mhead[hh]<<" "<<Mhead[hh2]<<endl;
cout<<Mbody1[bb1]<<" "<<Mbody1[bb4]<<endl;
cout<<Mbody2[bb2]<<" vs "<<Mbody2[bb5]<<endl;
cout<<Mbody3[bb3]<<" "<<Mbody3[bb6]<<endl;
HE += aa;
HE2 += aa2;
ll /= 2;
ll2 /= 2;
HE += aa;
HE2 += aa2;
while(HE > 0 || HE2 > 0){
if(tp == tp2){
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 1 && tp2 == 2){
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 1 && tp2 == 3){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 1 && tp2 == 0){
at *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 0 && tp2 == 1){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 0 && tp2 == 2){
at *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 0 && tp2 == 3){
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 2 && tp2 == 0){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 2 && tp2 == 1){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 2 && tp2 == 3){
at *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 3 && tp2 == 0){
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 3 && tp2 == 1){
at *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 3 && tp2 == 2){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
}
cout<<endl;
if(HE <= 0){
cout<<"YOUR MONSTER LOST \n";
cout<<"Their health is "<<HE2<<endl;
cout<<"Your health is "<<HE<<endl;
}
if(HE2 <= 0){
cout<<"YOUR MONSTER WON!!!! \n";
cout<<"Your health is "<<HE<<endl;
cout<<"Their health is "<<HE2<<endl;
}
string endGAME;
cout<<"type end to quit \n";
cin>>endGAME;
return 0;
}
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <unistd.h>
using namespace std;
int randVal(int min,int max){
return (rand() % (max - min + 1) + min);
}
int main(){
srand(time(NULL));
int bb1,bb2,bb3,hh,aa,HE,ll,tp,na,at;
int bb4,bb5,bb6,hh2,aa2,HE2,ll2,tp2,na2,at2;
string Mhead[] = {"( 0 ^ 0 )","| 0 * 0 |","( =^_^= )","( >_< ) ","(<@> <@>)"};
string Mbody1[] = {"1#####1","[[[]]] "};
string Mbody2[] = {"1#####1","[[[]]] "};
string Mbody3[] = {"1#####1","[[[]]] ","| | "," _/|_ "};
string Mname[] = {"Abra","Aipom","Amaura","Arbok","Archen","Aron","Bagon","Beedrill","Beldum","Bayleef","baltoy","Cacnea","Cascoon","Delphox","CHARIZARD",
"Deino","Deerling","Ditto","Dragonair","Drampa","Drowzee","Dustox","Electrabuzz","Emboar","Fearow","Golem","Grimer","Guzzlord","Hypno","Inkay","Invysaur",
"Jolteon","Jynx","Koffinf","Lapras","Latias","Latios","Charmander","Mew","Nidioking","Nidoqueen","Onix","Pichu","Pikachu"};
string Mtype[] = {"Fire","Water","Earth","Air"};
HE = randVal(1,1000);
ll = randVal(1,100);
HE *= ll;
tp = randVal(0,3);
na = randVal(0,43);
aa = randVal(0,500);
at = randVal(0,1000);
cout<<"input 0,1,2,3, or 4 \n";
cin>>hh;
if(hh < 0 || hh > 4){
cout<<"INVALID INPUT!! re-enter \n";
cin>>hh;
if(hh < 0 || hh > 4){
cout<<"really...";
sleep(3);
return 0;
}
}
cout<<"Now, input 1 or 0 \n";
cin>>bb1;
if(bb1 < 0 || bb1 > 1){
cout<<"INVALID INPUT!! re-enter \n";
cin>>bb1;
if(bb1 < 0 || bb1 > 1){
cout<<"really...";
sleep(3);
return 0;
}
}
cout<<"again \n";
cin>>bb2;
if(bb2 < 0 || bb2 > 1){
cout<<"INVALID INPUT!! re-enter \n";
cin>>bb2;
if(bb2 < 0 || bb2 > 1){
cout<<"really...";
sleep(3);
return 0;
}
}
cout<<"once more, BUT this time 0,1,2, or 3! \n";
cin>>bb3;
if(bb3 < 0 || bb3 > 3){
cout<<"INVALID INPUT!! re-enter \n";
cin>>bb3;
if(bb3 < 0 || bb3 > 3){
cout<<"really...";
sleep(3);
return 0;
}
}
cout<<"-------------------- \n";
cout<<"YOUR MONSTER \n \n";
cout<<Mhead[hh]<<endl;
cout<<Mbody1[bb1]<<endl<<Mbody2[bb2]<<endl<<Mbody3[bb3]<<endl<<endl;
cout<<"Name: "<<Mname[na]<<endl;
cout<<"Level: "<<ll<<endl;
cout<<"Type: "<<Mtype[tp]<<endl;
cout<<"Health: "<<HE<<endl;
cout<<"Armour: "<<aa<<endl;
cout<<"Attack: "<<at<<endl;
sleep(4);
cout<<"-------------------- \n";
cout<<"HOSTILE MONSTER \n \n";
HE2 = randVal(1,1000);
ll2 = randVal(1,100);
HE2 *= ll2;
tp2 = randVal(0,3);
na2 = randVal(0,43);
aa2 = randVal(0,500);
at2 = randVal(0,1000);
bb4 = randVal(0,1);
bb5 = randVal(0,1);
bb6 = randVal(0,2);
hh2 = randVal(0,1);
cout<<Mhead[hh2]<<endl;
cout<<Mbody1[bb4]<<endl<<Mbody2[bb5]<<endl<<Mbody3[bb6]<<endl<<endl;
cout<<"Name: "<<Mname[na2]<<endl;
cout<<"Level: "<<ll2<<endl;
cout<<"Type: "<<Mtype[tp2]<<endl;
cout<<"Health: "<<HE2<<endl;
cout<<"Armour: "<<aa2<<endl;
cout<<"Attack: "<<at2<<endl;
sleep(4);
cout<<"-------------------- \n";
cout<<" !!!FIGHT!!! \n";
cout<<Mhead[hh]<<" "<<Mhead[hh2]<<endl;
cout<<Mbody1[bb1]<<" "<<Mbody1[bb4]<<endl;
cout<<Mbody2[bb2]<<" vs "<<Mbody2[bb5]<<endl;
cout<<Mbody3[bb3]<<" "<<Mbody3[bb6]<<endl;
HE += aa;
HE2 += aa2;
ll /= 2;
ll2 /= 2;
HE += aa;
HE2 += aa2;
while(HE > 0 || HE2 > 0){
if(tp == tp2){
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 1 && tp2 == 2){
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 1 && tp2 == 3){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 1 && tp2 == 0){
at *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 0 && tp2 == 1){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 0 && tp2 == 2){
at *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 0 && tp2 == 3){
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 2 && tp2 == 0){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 2 && tp2 == 1){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 2 && tp2 == 3){
at *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 3 && tp2 == 0){
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 3 && tp2 == 1){
at *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
if(tp == 3 && tp2 == 2){
at2 *= 1.2;
HE -= at2;
HE2 -= at;
cout<<"You attacked for "<<at<<endl;
cout<<"Their health is "<<HE2<<endl;
cout<<"They attacked for "<<at<<endl;
cout<<"Your health is "<<HE<<endl;
sleep(2);
}
}
cout<<endl;
if(HE <= 0){
cout<<"YOUR MONSTER LOST \n";
cout<<"Their health is "<<HE2<<endl;
cout<<"Your health is "<<HE<<endl;
}
if(HE2 <= 0){
cout<<"YOUR MONSTER WON!!!! \n";
cout<<"Your health is "<<HE<<endl;
cout<<"Their health is "<<HE2<<endl;
}
string endGAME;
cout<<"type end to quit \n";
cin>>endGAME;
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks