diff --git a/game.cpp b/game.cpp index c3d0306334d100c1837b138b6d7e04c6ba96dd21..78ccbed53d1bb60e1d2a1ab8ceb929b41dde5505 100644 --- a/game.cpp +++ b/game.cpp @@ -62,24 +62,27 @@ int zhuangbei[N]; -struct op { +struct op +{ string name; string lei; string fangyu; string gongji; } equip_attributes[N]; -struct xh { +struct xh +{ int cnn; string bag; } bags[N]; -struct xu { +struct xu +{ int cnn; string boxx; } boxs[N]; -bool jineng[100]= {0,1}; // +bool jineng[100]= {0,1,0,0,0,0,0}; // int grade=1; int blood[101]= {0,100}; int experience[101]; @@ -92,7 +95,8 @@ bool ops[N]; string head,body,trousers,shoes; int shushen; -int main() { +int main() +{ start(); pretreatment(); cout<>option; - if(option==1) { + if(option==1) + { maps(); - if(exits==1) { + if(exits==1) + { return 0; } main12(); - } else if(option==2) { + } + else if(option==2) + { bag(); main12(); - } else if(option==3) { + } + else if(option==3) + { cout<<"已删除" <>name; } -void pretreatment() { +void pretreatment() +{ int num=1; - for(int i=100; i<=10000; i+=100) { + for(int i=100; i<=10000; i+=100) + { blood[num]=i; experience[num]=i; attack[num]=5+(i/100)*2; defense[num]+=i/100; num++; } - for(int i=1; i<=100; i++) { + for(int i=1; i<=100; i++) + { bags[i-1].cnn=i; } } -void board() { +void board() +{ cout<>option; - if(option==1) { + if(option==1) + { lingdong(); main12(); - } else if(option==2) { + } + else if(option==2) + { zhanchang(); main12(); - } else if(option==3) { + } + else if(option==3) + { shenming(); main12(); - } else if(option==4) { + } + else if(option==4) + { huo(); main12(); - } else if(option==5) { + } + else if(option==5) + { bin(); main12(); - } else if(option==6) { + } + else if(option==6) + { jin(); main12(); - } else if(option==7) { + } + else if(option==7) + { shu(); main12(); - } else if(option==8) { + } + else if(option==8) + { lu(); main12(); - } else { + } + else + { exits=1; } } -void bag() { //bug +void bag() //bug +{ int sum=0; - for(int i=0; i<=20; i++) { - for(int j=0; j<5; j++) { + for(int i=0; i<=20; i++) + { + for(int j=0; j<5; j++) + { if(!flag_bag[i]) cout<>option; - if(option==1) { + if(option==1) + { cout<<"请输入丢弃的序号"; cin>>option; - for(int i=0; i<100; i++) { - if(option==bags[i].cnn) { + for(int i=0; i<100; i++) + { + if(option==bags[i].cnn) + { flag_bag[i]=1; - for(int j=i+1; j<100; j++) { + for(int j=i+1; j<100; j++) + { bags[j].cnn--; } cout<<"丢弃成功"; @@ -231,10 +284,13 @@ void bag() { //bug } } -void box() { +void box() +{ int sum=0; - for(int i=0; i<20; i++) { - for(int j=0; j<5; j++) { + for(int i=0; i<20; i++) + { + for(int j=0; j<5; j++) + { if(!flag_box[i]) cout<>option; - if(option==1) { - Sleep(1000); + if(option==1) + { + Sleep(500); cout<<"请输入丢弃的序号"; cin>>option; - for(int i=0; i<100; i++) { - if(option==bags[i].cnn) { + for(int i=0; i<100; i++) + { + if(option==bags[i].cnn) + { flag_box[i]=1; - for(int j=i+1; j<100; j++) { + for(int j=i+1; j<100; j++) + { bags[j].cnn--; } cout<<"丢弃成功"; @@ -260,55 +320,72 @@ void box() { } } -int main12() { - if(grade==0) { +int main12() +{ + if(grade==0) + { grade++; } - if(jinyan>=experience[grade]) { + if(jinyan>=experience[grade]) + { grade++; jinyan-=experience[grade-1]; } - if(exits==1) { + if(exits==1) + { return 0; } board(); cin>>option; - if(option==1) { + if(option==1) + { maps(); system("cls"); - if(exits==1) { + if(exits==1) + { return 0; } main12(); - } else if(option==2) { + } + else if(option==2) + { bag(); system("cls"); main12(); - } else if(option==3) { + } + else if(option==3) + { box(); system("cls"); main12(); - } else if(option==4) { + } + else if(option==4) + { equips(); system("cls"); main12(); - } else if(option==5) { + } + else if(option==5) + { skill_board(); system("cls"); main12(); } } -void lingdong() { +void lingdong() +{ cout<<"欢迎来到灵洞"<>option; - if(option==1) { + if(option==1) + { cout<<"你遇见了——"<>times; - for(int i=1; i<=times; i++) { + for(int i=1; i<=times; i++) + { cout<>option; int exits1=0; - if(option==1) { - while(!exits1) { + if(option==1) + { + while(!exits1) + { cout<<"挖矿中..."<>option; - if(option==2) { + if(option==2) + { exits1=1; } } - } else { + } + else + { cout<<"你遇到了---"<3){ + if(grade>3) + { grade-=3; - }else{ + } + else + { grade=1; } shushen=0; - } + } cout<<"1.撸树 2.闲逛(与恶魔干架)"; cin>>option; int exits1=0; - if(option==1) { - while(!exits1) { + if(option==1) + { + while(!exits1) + { cout<<"撸树中..."<>option; - if(option==1){ + if(option==1) + { cout<<"你成功逃跑"<>option; - if(option==2) { + if(option==2) + { exits1=1; } } - } else { + } + else + { cout<<"你遇到了---"<> n; - if(n == 1) { + if(n == 1) + { ten(); - } else if(n == 2) { + } + else if(n == 2) + { eleven(); - } else if(n == 3) { + } + else if(n == 3) + { twelve(); - } else if(n == 4) { + } + else if(n == 4) + { thirteen(); - } else if(n == 5) { + } + else if(n == 5) + { forteen(); } }