提交 8e2f4e07 编写于 作者: struct_cym's avatar struct_cym

Update game.cpp

上级 db266d33
......@@ -78,12 +78,12 @@ struct xu{
string boxx;
}boxs[N];
bool jineng[100];
bool jineng[100]={0,1}; //
int grade=1;
int blood[101]={0,100};
int experience[101];
string name;
int option,attribute,flag_box[N],flag_bag[N],exits,savage,times,attack=1,defense=1;
int option,attribute,flag_box[N],flag_bag[N],exits,savage,times,attack=5,defense=1;
int jinyan;
int baoji=5;
int sum_level[101]={};
......@@ -95,7 +95,7 @@ int main(){
start();
pretreatment();
cout<<endl<<"请输入你所要的属性"<<endl;
cout<<"1.金 2.木 3.水 4.火 5.土";
cout<<"1.金 2.木 3.水 4.火 5.土"<<endl;
cin>>attribute;
board();
cin>>option;
......@@ -327,7 +327,7 @@ void lingdong(){
}
}
while(true){
int sum=0;
int y1=boss_shanghai(x);
tema-=y1+jianshang(defense);
cout<<"碧水金睛兽打出了"<<y1<<"点伤害"<<endl;
......@@ -339,6 +339,27 @@ void lingdong(){
grade--;
return;
}
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1&&sum==5){
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack;
cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int y2=shanghai(attack);
temb-=y2;
temb+=jianshang(temf);
......@@ -346,6 +367,7 @@ void lingdong(){
Sleep(1000);
cout<<"碧水金睛兽还剩"<<temb<<"滴血";
Sleep(1000);
sum++;
if(temb<=0){
cout<<"你赢了";
int n=rand()%20+1;
......@@ -388,6 +410,7 @@ void lingdong(){
}
}
while(true){
int sum=0;
int y1=boss_shanghai(x);
tema-=y1+jianshang((int)defense);
cout<<"太古龙象打出了"<<y1<<"点伤害"<<endl;
......@@ -400,6 +423,27 @@ void lingdong(){
return;
}
cout<<endl;
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1&&sum==5){
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack;
cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int y2=shanghai((int)attack);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
......@@ -417,8 +461,9 @@ void lingdong(){
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
cout<<endl;
sum++;
}
}
}else if(option==2){
......@@ -504,7 +549,7 @@ void huo(){
}
}else{
cout<<"你遇到了---"<<endl;
int n=rand()%2;
int n=rand()%1;
if(n==0){
double x=rand()%20;
cout<<"熔岩虫"<<" "<<"等级:"<<x<<endl;
......@@ -534,6 +579,7 @@ void huo(){
}
}
while(true){
int sum=0;
int y1=shanghai(x);
tema-=y1+jianshang((int)defense);
cout<<"熔岩虫打出了"<<y1<<"点伤害"<<endl;
......@@ -546,12 +592,34 @@ void huo(){
return;
}
cout<<endl;
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1&&sum==5){
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack;
cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int y2=shanghai((int)attack);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1000);
cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
sum++;
if(temb<=0){
cout<<"你赢了"<<endl;
cout<<"你获得了 熔岩宝石";
......@@ -596,6 +664,7 @@ void huo(){
}
}
while(true){
int sum=0;
int y1=shanghai(x);
tema-=y1+jianshang((int)defense);
cout<<"熔岩地龙打出了"<<y1<<"点伤害"<<endl;
......@@ -610,10 +679,32 @@ void huo(){
cout<<endl;
int y2=shanghai((int)attack);
temb-=y2+jianshang(temf);
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1&&sum==5){
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack;
cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1000);
cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
sum++;
if(temb<=0){
cout<<"你赢了"<<endl;
int n=rand()%10+1;
......@@ -652,7 +743,7 @@ void lu(){
int shanghai(double gong){
int bao=0;
int n=10*((double)gong/100);
int n=ceil(10*((double)gong/100));
int op=rand()%100+1;
for(int i=1;i<=baoji;i++){
ops[i]=1;
......@@ -671,7 +762,7 @@ int jianshang(double fang){
int boss_shanghai(double gong){
int bao=0;
int n=10*((double)gong/100);
int n=ceil(10*((double)gong/100));
int op=rand()%100+1;
for(int i=1;i<=baoji;i++){
ops[i]=1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册