程序代码:
void OrdinaryAct() //正常行为菜单(移动,物品,对话,查看状态,装备,退出游戏) {//这里有个很大的bug:有的时候会没输入就跳出错误 while(1) { Setjindutiao(25); if(place.sign==0||place.sign==1||place.sign==2||place.sign==18||place.sign==19){strcpy(fujin1,bar.name);strcpy(fujin2,hotel.name);strcpy(fujin3,fsyg.name);strcpy(fujin4,"秘道");} else if(place.sign==3||place.sign==4||place.sign==5||place.sign==14){strcpy(fujin1,forest.name);strcpy(fujin2,forest1.name);strcpy(fujin3,forest2.name);strcpy(fujin4,forest3.name);} else if(place.sign==6||place.sign==7||place.sign==8||place.sign==15){strcpy(fujin1,grass.name);strcpy(fujin2,grass1.name);strcpy(fujin3,grass2.name);strcpy(fujin4,grass3.name);} else if(place.sign==11||place.sign==12||place.sign==13||place.sign==16){strcpy(fujin1,sea.name);strcpy(fujin2,sea1.name);strcpy(fujin3,sea2.name);strcpy(fujin4,sea3.name);} else if(place.sign==9||place.sign==19||place.sign==20||place.sign==21||place.sign==23){strcpy(fujin1,mlgb.name);strcpy(fujin2,cnm.name);strcpy(fujin3,fky.name);strcpy(fujin4,zysd.name);} gotoxy(1,10); printf("这里是%s",place.name); if(place.sign==0)Map("草原边上","森林边上","圣地","海边"); else if(place.sign==9)Map("草泥马平原","马勒戈壁","法克鱿大海","职业圣殿"); if(place.sign!=0) { gotoxy(12,58); printf("5、回学校"); } if(place.sign==19||place.sign==20||place.sign==21||place.sign==23) { gotoxy(12,68); printf("6、去圣地"); } gotoxy(21,4); if(place.sign!=9&&place.sign!=14&&place.sign!=15&&place.sign!=16) printf("\t附近的地点:1、%s\t2、%s\t3、%s\t4、%s\n\t菜单(m)\n",fujin1,fujin2,fujin3,fujin4); else if(place.sign==14&&place.sign==15&&place.sign==16) { gotoxy(10,28); Map2(); } gotoxy(22,0); puts("============================================================================="); puts("要去哪里?"); scanf("%c",&proof); Setjindutiao(20); if(proof=='m'||proof=='M')Menu(); else { switch(place.sign) { case 0: switch(proof) { case 'w':place=grass;system("color A0");break; case 's':place=forest;system("color 2F");break; case 'a':system("color 70"); if(yaoshi3>0) { SlowDisplay("你缓缓地向上飘去,来到了圣地\n");//bug:这里到了圣地就会掉下来 place=mountain; yaoshi3--; } else { SlowDisplay("圣地守门人发现你没有钥匙,把你扔到了山里\n"); place=mountain1; Battle(); } break; case 'd':place=sea;system("color 9F");break; case '1':place=bar;system("color 6F");break; case '2':place=hotel;system("color 1F");break; case '3':place=fsyg;system("color 4F");break; case '4':system("color 8F"); SlowDisplay("秘道纵横交错,你误打误撞地来到了"); s=SuiJi(); if(s<6) { place=mesh; printf("%s",mesh.name); Battle(); } else { place=jd;//bug:到了基地发现在机械之城 printf("%s",jd.name); Battle(); } default:MessageBox(NULL,"错误!","警告",MB_OK); } break; case 1:Yidong1();break; case 2:Yidong1();break; case 3:Yidong2();break; case 4:Yidong2();break; case 5:Yidong2();break; case 6:Yidong3();break; case 7:Yidong3();break; case 8:Yidong3();break; case 9: switch(proof) { case 'w':place=cnm;system("color A0");Battle();break; case 's':place=mlgb;system("color 7F");Battle();break; case 'a':place=fkk;system("color 9F");Battle();break; case 'd':system("color E0"); printf("勇士,有什么事:1,领悟职业技能 2,购买职业顶级装备 0,返回\n\n\n"); choose_number=1; while(choose_number) { switch(scanf("%d",&choose_number),choose_number) { case 1: SlowDisplay("1 坦克专属 万仞崩山破\n2 战士专属 大荒芜经\n3 刺客专属 地狱之魂\n4 法师专属 佛怒火莲\n5 射手专属 狂风之息\n0 返回\n以上技能来源于游戏或小说,如有侵权请找陈曦\n\n\n"); choose_number=1; while(choose_number) { scanf("%d",&choose_number); Setjindutiao(20); switch(choose_number) { case 1: if(n==1) { SlowDisplay("领悟成功\n\n\n"); wrbsp++; n++; strcpy(zyname,"万仞崩山破"); } else SlowDisplay("滚!\n\n\n"); break; case 2: if(nn==1) { SlowDisplay("领悟成功\n\n\n"); dhwj++; nn++; strcpy(zyname,"大荒芜经"); } else SlowDisplay("滚!\n\n\n"); break; case 3: if(nnn==1) { SlowDisplay("领悟成功\n\n\n"); dysls++; nnn++; strcpy(zyname,"地狱之魂"); } else SlowDisplay("滚!\n\n\n"); break; case 4: if(nnnn==1) { SlowDisplay("领悟成功\n\n\n"); fnhl++; nnnn++; strcpy(zyname,"佛怒火莲"); } else SlowDisplay("滚!\n\n\n"); break; case 5: if(nnnnn==1) { SlowDisplay("领悟成功\n\n\n"); kfzx++; nnnnn++; strcpy(zyname,"狂风之息"); } else SlowDisplay("滚!\n\n\n"); break; case 0: SlowDisplay("走你!!!\n\n\n"); OrdinaryAct() ; break; default:MessageBox(NULL,"错误!","警告",MB_OK); } } break; case 2:SlowDisplay("此部分暂未完成,下次再来吧");break; case 0: SlowDisplay("走你!!!\n\n\n"); break; } } } case '5':place=school;system("color 0F");break; default:MessageBox(NULL,"错误!","警告",MB_OK); break; case 10:Yidong5();break; case 11:Yidong4();break; case 12:Yidong4();break; case 13:Yidong4();break; case 14:Yidong2();break; case 15:Yidong3();break; case 16:Yidong4();break; case 17:if(proof=='5'){place=school;system("color 0F");}else{MessageBox(NULL,"错误!","警告",MB_OK);}break; case 18:Yidong1();break; case 19:Yidong1();break; case 20:Yidong5();break; case 21:Yidong5();break; case 22:Yidong1();break; case 23:Yidong5();break; } } } }