闯(1.7)
#include<conio.h> #include<bits/stdc++.h> #include<windows.h> #define CIN freopen("CON","r",stdin); #define COUT freopen("CON","w",stdout); #define PN a[0].name #define PL a[0].level #define PK a[0].kill #define PF a[0].fy #define PS a[0].sudu #define PJ a[0].jineng #define PM a[0].money #define PZ a[0].zhuangbei #define PB a[0].blood #define PBJ a[0].baoji #define PX a[0].xixue #define PE a[0].ex #define PSB a[0].shanbi #define CR SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED); #define CG SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN) #define CY SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN); #define CB SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE); #define CP SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_BLUE); #define CQ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN |FOREGROUND_BLUE); #define PFK printf("%c%c",0xa8,0x80); #define SY system("cls"); using namespace std; struct player { string name; int shanbi,level,blood,kill,fy,sudu,jnj,jineng[50],jns,money,zhuangbei[70],zbss,baoji,xixue,ex; bool yaowu[50]; int xiaoguo[50]; int daoju[50]; int zb_le[120]; int jn_le[120]; }a[1]; int game=1; string na; bool dll,wrong; string map_name[10]={"","谷村","桃林","大烟山"}; string jineng_name[100]={"","破甲","雷击","自强","迷惑","快斩","必杀","毒雾","悟道"}; bool boss[10][100]; string boss_name[10][12]={"御宝司一","御宝司二","御宝将","梨士一","梨士二","梨长","柳灵一","柳灵二","柳精","村霸一","村霸二","村长", "武者一","武者二","武者三","武师","桃师一","桃师二","桃师三","桃女","剑士一","剑士二","剑士三","剑狂", "猛虎一","猛虎二","猛虎三","虎王","毒虫一","毒虫二","毒虫三","蛊","道人一","道人二","道人三","烟山灵仙"}; int boss_blood[10][12]= {60,62,65,50,52,55,70,75,80,50,70,90,130,135,140,150,100,110,120,140,110,120,140,160,200,220,240,260,180,190,210,250,400,450,500,600}; int boss_kill[10][12]= {2,3,4,10,10,10,8,9,10,20,22,25,13,14,15,18,13,15,17,19,30,32,35,40,40,43,46,50,45,48,51,54,60,62,66,70}; int boss_fy[10][12]= {2,3,4,4,4,4,5,6,7,8,8,10,13,14,15,16,13,15,17,19,12,15,17,20,20,25,30,40,33,35,37,40,60,62,66,70}; int boss_sudu[10][12]= {2,3,4,4,4,4,5,6,7,8,8,10,8,10,12,15,11,12,13,16,14,15,17,19,40,44,47,50,60,62,65,70,60,62,66,70}; int boss_jineng[10][12]={0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8}; int boss_jinengr[10][12]={0,0,0,0,0,0,0,0,20,0,0,20,0,0,0,30,0,0,0,28,0,0,0,33,0,0,0,40,0,0,0,45,0,0,0,60}; int boss_shanbi[10][12]={2,3,4,3,3,3,7,8,10,10,10,10,11,13,14,15,20,21,22,25,15,18,22,25,30,33,35,38,40,43,46,50,60,62,66,70}; int boss_baoji[10][12]= {2,3,4,4,4,4,5,7,8,10,12,14,12,13,14,15,13,14,16,17,21,23,25,28,30,32,34,36,40,43,45,48,60,62,66,70}; int boss_xx[10][12]= {2,3,4,3,3,3,6,7,8,9,9,11,10,11,12,14,11,13,13,15,14,17,20,23,40,42,45,47,60,62,67,70,60,62,66,70}; int boss_killp[10][12]= {1,1,1,2,2,2,3,3,3,4,4,5,5,5,5,6,5,5,5,5,6,6,6,7,8,8,8,9,8,8,8,8,10,10,10,10}; int boss_bloodp[10][12]= {4,4,4,5,6,7,7,7,7,8,9,12,12,13,13,15,13,14,14,14,15,15,16,17,17,18,18,18,17,17,18,18,18,18,18,18}; int boss_fyp[10][12]= {1,1,1,2,2,3,3,3,3,4,4,5,5,6,6,6,5,5,5,5,4,4,5,6,7,7,7,8,7,7,7,7,8,8,8,8}; int boss_sudup[10][12]= {1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,3,3,3,3,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7}; int boss_jinengp[10][12]={0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,0}; int boss_moneyp[10][12]= {5,5,5,5,5,5,5,5,5,5,5,10, 8,8,8,12,8,8,8,12,8,8,8,15, 10,10,10,18,10,10,10,20}; int boss_exp[10][12]= {50,100,150,200,250,300,500,700,800,900,1000,1200,1500,2000,1400,1500,1600,1800,1400,1600,1800,2000,2000,2100,2200,2300,2400,2500,2500,2600,3000}; int boss_sbp[10][12]= {0,0,0,1,1,0,1,1,1,1,1,2,1,1,2,2,3,4,4,5,3,3,3,5,5,5,5,3,3,3,3}; int gk[10],mapsum=3; int lev[150]={0,50,100,150,200,300,500,800,1000,1200,1500,2000,2500,3000,7000,10000,11000,12000,13000,14000}; string zhuangbei_name[120]={"石斧","轻剑","飞刀","重刃","长弓","冲锋","彗星"}; int zbget[120]={0,3,6,9,12,14,16},wqs=7,jns=8,maptg; bool mapp[4]; string yw_name[120]={"","大力丸","铁身丸","疾行丸","活血散","光华丹"}; int yaowu_jiage[120]={0,20,20,20,20,50}; string dj_name[120]={"","武书","淬炼石","决令","雷灵","仙丹"}; int daoju_jiage[120]={0,20,20,20,50,20}; int wq_wl[16][11]={0,0,0,0,0,0,0,0,0,0,0, 5,0,10,0,20,30,0,0,0,0,0, 8,3,14,0,24,36,0,0,0,0,0, 11,5,18,5,30,45,0,0,0,0,0, 15,8,22,8,36,55,0,0,0,0,0, 20,11,28,11,42,62,0,0,0,0,0}; float wq_bj[16][11]={0,0,0,0,0,0,0,0,0,0,0, 1,1.3,1,1.6,1.2,1.4,2.2,1,1,1,1, 1,1.5,1,1.8,1.4,1.5,2.5,1,1,1,1, 1,1.8,1,2.1,1.5,1.9,2.9,1,1,1,1, 1,2.2,1,2.4,1.8,2.3,3.2,1,1,1,1, 1,2.5,1,2.6,2.3,2.6,3.7,1,1,1,1}; int zbup[50]={0,0,1,2,4,5}; int jnup[50]={0,0,1,2,4,6}; float pj[6]={0,1,1.3,1.6,1.9,2.3}; float lj[6]={0,0.5,0.55,0.6,0.65,0.7}; float zq[6]={0,1.2,1.25,1.3,1.35,1.4}; float mh[6]={0,0.9,0.85,0.8,0.75,0.7}; float kz1[6]={0,0.1,0.11,0.12,0.13,0.14}; float kz2[6]={0,1.2,1.3,1.4,1.5,1.6}; int bs[6]={0,200,230,250,280,300}; float dw[6]={0,1.2,1.5,1.7,2,2.5}; float wd1[6]={0,0.6,0.55,0.5,0.45,0.4}; float wd2[6]={0,2.3,2.6,3,3.5,4}; float wd3[6]={0,100,150,210,250,300}; int zble=5; int jnle=5; bool zb[120]; int yws=5,djs=5; void star(int n) { CY; for(int i=1;i<=n;i++)cout<<"★";cout<<endl; CR; } void fight() { SY if(gk[maptg]==12)maptg++; printf("请选择你要挑战的地图:\n"); for(int i=1;i<=maptg+1;i++) { cout<<i<<"."<<map_name[i]<<endl; } int o; cin>>o; if(o==0)return; if(o>maptg+1) { SY printf("指令无效!"); Sleep(1000); fight(); return; } SY printf("通关数:%d\n",gk[--o]); printf("请选择你要挑战的对手:\n"); for(int i=0;i<=min(11,gk[o]);i++)cout<<i+1<<"."<<boss_name[o][i]<<"\n"; int p; cin>>p; if(p>gk[o]+1) { SY printf("指令无效!"); Sleep(1000); fight(); return; } else if(p==0)return; else { bool f=0; p--; int t=PB,k=boss_blood[o][p],pf=PF,pk=PK,bk1=boss_kill[o][p],bf=boss_fy[o][p]; while(t>0&&k>0) { for(int i=1;i<=max(0,PS/boss_sudu[o][p])+rand()%1+1;i++) { int g=0; if(k<=0||t<=0)break; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED); cout<<"你的血量:\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; cout<<'|'; for(int i=1;i<=max(0,t*20/PB);i++)printf("%c%c",0xa8,0x80); for(int i=max(0,t*20/PB)*2+1;i<=40;i++)cout<<' '; cout<<'|'; cout<<max(0,t)<<'/'<<PB<<"\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN); cout<<boss_name[o][p]<<"的血量:\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; cout<<'|'; for(int i=1;i<=max(0,k*20/boss_blood[o][p]);i++)printf("%c%c", 0xa8, 0x80); for(int i=max(0,k*20/boss_blood[o][p])*2+1;i<=40;i++)cout<<' '; cout<<'|'; cout<<max(0,k)<<'/'<<boss_blood[o][p]<<"\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN); if(rand()%100+1<a[0].jnj&&a[0].jns) { int h=PJ[rand()%a[0].jns+1]; cout<<PN<<"对"<<boss_name[o][p]<<"使用了"<<jineng_name[h]<<"\n"; if(h==1) { cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<PK*pj[a[0].jn_le[1]]<<"点伤害\n"; k-=PK*pj[a[0].jn_le[1]]; } if(h==2) { int i=k*lj[a[0].jn_le[2]]; cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<i<<"点伤害\n"; k-=i; } if(h==3) { t*=zq[a[0].jn_le[3]]; pk*=zq[a[0].jn_le[3]]; pf*=zq[a[0].jn_le[3]]; cout<<PN<<"的血量,攻击力,防御提升了"<<(zq[a[0].jn_le[3]]-1)*100<<"%!!\n"; } if(h==4) { bk1*=mh[a[0].jn_le[4]]; cout<<boss_name[o][p]<<"的攻击力降低了"<<(1-mh[a[0].jn_le[4]])*100<<"%!!\n"; } if(h==5) { int i=k*kz1[a[0].jn_le[5]]+pk*kz2[a[0].jn_le[5]]; cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<i<<"点伤害\n"; i=k*(kz1[a[0].jn_le[5]]-0.01)+pk*(kz2[a[0].jn_le[5]]-0.1); cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<i<<"点伤害\n"; i=k*(kz1[a[0].jn_le[5]]-0.02)+pk*(kz2[a[0].jn_le[5]]-0.2); cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<i<<"点伤害\n"; i=k*(kz1[a[0].jn_le[5]]-0.03)+pk*(kz2[a[0].jn_le[5]]-0.3); cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<i<<"点伤害\n"; k-=k*(kz1[a[0].jn_le[5]]*4-0.06)+pk*(kz2[a[0].jn_le[5]]*4-0.6); } if(h==6) { cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<bs[a[0].jn_le[6]]<<"点伤害\n"; k-=bs[a[0].jn_le[6]]; } if(h==7) { cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<dw[a[0].jn_le[7]]*pk<<"点伤害\n"; cout<<PN<<"回复了"<<2*dw[a[0].jn_le[7]]*pk<<"点血量\n"; k-=dw[a[0].jn_le[7]]*pk; t+=2*dw[a[0].jn_le[7]]*pk; } if(h==8) { cout<<PN<<"使"<<boss_name[o][p]<<"的防御降低了"<<(1-wd1[a[0].jn_le[8]])*100<<"%\n"; cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<wd2[a[0].jn_le[8]]*pk<<"点伤害\n"; cout<<PN<<"回复了"<<wd3[a[0].jn_le[8]]<<"点血量\n"; bf*=wd1[a[0].jn_le[8]]; k-=wd2[a[0].jn_le[8]]*pk; t+=wd3[a[0].jn_le[8]]; } } else { int ff=rand()%2; string ss; if(a[0].zbss&&ff==1){g=rand()%a[0].zbss+1;ss=zhuangbei_name[PZ[g]];} else ss="普通攻击"; cout<<PN<<"对"<<boss_name[o][p]<<"使用了"<<ss<<"\n"; if(rand()%100+1<boss_shanbi[o][p]){printf("对手闪避了你的攻击!!\n");Sleep(500);continue;} int qq=ss!="普通攻击"?wq_wl[a[0].zb_le[PZ[g]]][PZ[g]]:0,pp=ss!="普通攻击"?wq_bj[a[0].zb_le[PZ[g]]][PZ[g]]:1; int w=max(0,pk-bf)+rand()%pk/3+1,y=1; bool f=rand()%100+1<=PBJ?1:0; if(f)y=1.8+((rand()%2)-0.5)*0.14; w*=y*pp; w+=qq; cout<<PN<<"对"<<boss_name[o][p]<<"造成了"<<w<<"点伤害\n"; t+=w*PX/100; if(t>PB)t=PB; k-=w; } if(t>PB)t=PB; Sleep(500); } for(int i=1;i<=max(0,boss_sudu[o][p]/PS)+rand()%1+1;i++) { if(t<=0||k<=0)break; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED); cout<<"你的血量:\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; cout<<'|'; for(int i=1;i<=max(0,t*20/PB);i++)printf("%c%c",0xa8,0x80); for(int i=max(0,t*20/PB)*2+1;i<=40;i++)cout<<' '; cout<<'|'; cout<<max(0,t)<<'/'<<PB<<"\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN); cout<<boss_name[o][p]<<"的血量:\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; cout<<'|'; for(int i=1;i<=max(0,k*20/boss_blood[o][p]);i++)printf("%c%c", 0xa8, 0x80); for(int i=max(0,k*20/boss_blood[o][p])*2+1;i<=40;i++)cout<<' '; cout<<'|'; cout<<max(0,k)<<'/'<<boss_blood[o][p]<<"\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN); if(rand()%100+1<boss_jinengr[o][p]) { int h=boss_jineng[o][p]; cout<<boss_name[o][p]<<"对"<<PN<<"使用了"<<jineng_name[h]<<"\n"; if(h==1) { cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<bk1<<"点伤害\n"; t-=bk1; } if(h==2) { int i=t*0.5; cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<i<<"点伤害\n"; t-=i; } if(h==3) { k*=1.2; bk1*=1.2; bf*=1.2; cout<<boss_name[o][p]<<"的血量,攻击力,防御提升了20%!!\n"; } if(h==4) { pk*=0.9; cout<<"你的攻击力降低了10%!!\n"; } if(h==5) { int i=t*0.1+bk1*1.2; cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<i<<"点伤害\n"; i=t*0.09+bk1*1.1; cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<i<<"点伤害\n"; i=t*0.08+bk1; cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<i<<"点伤害\n"; i=t*0.07+bk1*0.9; cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<i<<"点伤害\n"; t-=t*0.34+bk1*4.2; } if(h==6) { cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<200<<"点伤害\n"; t-=200; } if(h==7) { cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<1.2*bk1<<"点伤害\n"; cout<<boss_name[o][p]<<"回复了"<<2.4*bk1<<"点血量\n"; t-=1.2*bk1; k+=2.4*bk1; } if(h==8) { cout<<boss_name[o][p]<<"使"<<PN<<"的防御降低了"<<"50%\n"; cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<bk1*3<<"点伤害\n"; cout<<boss_name[o][p]<<"回复了"<<210<<"点血量\n"; pf*=0.5; t-=3*bk1; k+=210; } } else { if(rand()%100+1<PSB){printf("你闪避了对手的攻击!!\n");Sleep(500);continue;} int x=max(0,bk1-pf)+rand()%10+1,q=1; bool g=rand()%100+1<=boss_baoji[o][p]?1:0; if(g)q=1.8+((rand()%2)-0.5)*0.14; x*=q; cout<<boss_name[o][p]<<"对"<<PN<<"造成了"<<x<<"点伤害\n"; k+=x*boss_xx[o][p]/100; if(k>boss_blood[o][p])k=boss_blood[o][p]; t-=x; } if(k>boss_blood[o][p])k=boss_blood[o][p]; Sleep(500); } } for(int i=1;i<=5;i++) { if(a[0].yaowu[i]) { a[0].xiaoguo[i]--; if(a[0].xiaoguo[i]==0) { a[0].yaowu[i]=0; if(i==1)PK-=10; if(i==2)PF-=10; if(i==3)PS-=10; if(i==4)PB-=30; if(i==5)a[0].jnj-=5; } } } cout<<"战斗结束...\n"; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED); cout<<"你的血量:\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; cout<<'|'; for(int i=1;i<=max(0,t*20/PB);i++)printf("%c%c",0xa8,0x80); for(int i=max(0,t*20/PB)*2+1;i<=40;i++)cout<<' '; cout<<'|'; cout<<max(0,t)<<'/'<<PB<<"\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN); cout<<boss_name[o][p]<<"的血量:\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; cout<<'|'; for(int i=1;i<=max(0,k*20/boss_blood[o][p]);i++)printf("%c%c", 0xa8, 0x80); for(int i=max(0,k*20/boss_blood[o][p])*2+1;i<=40;i++)cout<<' '; cout<<'|'; cout<<max(0,k)<<'/'<<boss_blood[o][p]<<"\n"; cout<<" "; for(int i=1;i<=40;i++)cout<<'-'; cout<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN); Sleep(1000); if(t<=0)cout<<"你被击倒了!\n",Sleep(3000); else { cout<<"你战胜了"<<boss_name[o][p]<<endl; if(p==gk[o]) { gk[o]++; PB+=boss_bloodp[o][p]; PK+=boss_killp[o][p]; PS+=boss_sudup[o][p]; PF+=boss_fyp[o][p]; if(boss_jinengp[o][p]&&PN!="test")PJ[++a[0].jns]=boss_jinengp[o][p],a[0].jn_le[boss_jinengp[o][p]]=1; PM+=boss_moneyp[o][p]; PE+=boss_exp[o][p]; PSB+=boss_sbp[o][p]; } int o; o=getchar(); o=getchar(); return; } return; } return; } void boss_look() { SY printf("请选择你要查看的地图:\n"); for(int i=1;i<=mapsum;i++) { cout<<i<<"."<<map_name[i]<<endl; } int o; cin>>o; if(o==0)return; if(o>mapsum+1) { SY printf("指令无效!"); Sleep(1000); return; } SY printf("通关数:%d\n",gk[--o]); printf("请选择你要查看的对手:\n"); for(int i=0;i<12;i++)cout<<i+1<<"."<<boss_name[o][i]<<"\n"; int p; cin>>p; if(p>12) { SY printf("指令无效!"); Sleep(1000); return; } p--; SY CG; cout<<boss_name[o][p]<<"的血量上限:"; for(int i=1;i<=(boss_blood[o][p]/10);i++)PFK cout<<boss_blood[o][p]; cout<<endl; CB; cout<<boss_name[o][p]<<"的攻击力:"; for(int i=1;i<=boss_kill[o][p];i++)PFK cout<<boss_kill[o][p]; cout<<endl; CY; cout<<boss_name[o][p]<<"的速度:"; for(int i=1;i<=boss_sudu[o][p];i++)PFK cout<<boss_sudu[o][p]; cout<<endl; CP; cout<<boss_name[o][p]<<"的防御:"; for(int i=1;i<=boss_fy[o][p];i++)PFK cout<<boss_fy[o][p]; cout<<endl; CQ; cout<<boss_name[o][p]<<"的闪避:"; for(int i=1;i<=boss_shanbi[o][p];i++)PFK cout<<boss_shanbi[o][p]; cout<<endl; CR; cout<<boss_name[o][p]<<"的暴击几率:"; for(int i=1;i<=boss_baoji[o][p];i++)PFK cout<<boss_baoji[o][p]; cout<<endl; CG; cout<<boss_name[o][p]<<"的吸血:"; for(int i=1;i<=boss_xx[o][p];i++)PFK cout<<boss_xx[o][p]; cout<<endl; cout<<boss_name[o][p]<<"的技能:"; cout<<jineng_name[boss_jineng[o][p]]; cout<<endl; cout<<boss_name[o][p]<<"的战力:"<<boss_blood[o][p]/2+boss_kill[o][p]*4+boss_fy[o][p]*4+boss_sudu[o][p]*5+boss_shanbi[o][p]*7+boss_xx[o][p]*7+boss_baoji[o][p]*7+((bool)boss_jineng[o][p])*12<<endl; int d; d=getchar(); d=getchar(); return; } void zb_look() { SY for(int i=0;i<wqs;i++) { cout<<i+1<<"."<<zhuangbei_name[i]<<endl; for(int j=1;j<=zble;j++) { cout<<j<<"星基础伤害增加"<<wq_wl[j][i]<<" 暴击系数为"<<wq_bj[j][i]<<endl; } } int d; d=getchar(); d=getchar(); return; } void jn_look() { SY for(int i=1;i<=jns;i++) { cout<<i<<"."<<jineng_name[i]<<endl; for(int j=1;j<=jnle;j++) { if(i==1)cout<<"对敌人造成"<<pj[j]*100<<"%玩家攻击力点伤害\n"; if(i==2)cout<<"对敌人造成"<<lj[j]*100<<"%敌人当前血量点伤害\n"; if(i==3)cout<<"自身生命值、攻击力及防御提高"<<zq[j]*100-100<<"%\n"; if(i==4)cout<<"使敌人的攻击力降低"<<100-mh[j]*100<<"%\n"; if(i==5)cout<<"对敌人造成4次伤害,总伤害值为对方当前血量的"<<(kz1[j]*4-0.06)*100<<"%加自身攻击力的"<<(kz2[j]*4-0.6)*100<<"%\n"; if(i==6)cout<<"对敌人造成"<<bs[j]<<"点伤害\n"; if(i==7)cout<<"对敌人造成"<<dw[j]*100<<"%玩家攻击力点伤害,自身回复双倍于造成伤害的血量\n"; if(i==8)cout<<"降低敌人防御"<<100-wd1[j]*100<<"%,对敌人造成"<<wd2[j]*100<<"%玩家攻击力点伤害,自身回复"<<wd3[j]<<"点血量\n"; } } int d; d=getchar(); d=getchar(); return; } void tujian() { SY cout<<"您想要查询:1.关卡 2.装备 3.技能\n"; int g; cin>>g; if(g==0)return; if(g>3) { cout<<"指令无效!!\n"; Sleep(2000); return; } if(g==1)boss_look(); if(g==2)zb_look(); if(g==3)jn_look(); } void zhuangtai() { int p=0; SY cout<<"你的等级:"<<PL<<endl; CR; cout<<"你的经验值:"; for(int i=1;i<=PE/max(1,lev[PL]/20);i++)PFK cout<<PE; cout<<endl; CG; cout<<"你的血量上限:"; for(int i=1;i<=min(20,PB/10);i++)PFK cout<<PB; cout<<endl; CB; cout<<"你的攻击力:"; for(int i=1;i<=PK;i++)PFK cout<<PK; cout<<endl; CY; cout<<"你的速度:"; for(int i=1;i<=PS;i++)PFK cout<<PS; cout<<endl; CP; cout<<"你的防御:"; for(int i=1;i<=PF;i++)PFK cout<<PF; cout<<endl; CQ; cout<<"你的闪避:"; for(int i=1;i<=PSB;i++)PFK cout<<PSB; cout<<endl; CR; cout<<"你的暴击几率:"; for(int i=1;i<=PBJ;i++)PFK cout<<PBJ; cout<<endl; CG; cout<<"你的吸血:"; for(int i=1;i<=PX;i++)PFK cout<<PX; cout<<endl; int zbb=0; cout<<"你的装备数:"<<a[0].zbss<<endl; cout<<"你的装备:\n"; for(int i=1;i<=a[0].zbss;i++)zbb+=a[0].zb_le[PZ[i]],CG,cout<<zhuangbei_name[PZ[i]],star(a[0].zb_le[PZ[i]]); cout<<"你的技能数:"<<a[0].jns<<endl; cout<<"你的技能:\n"; int jnn=0; for(int i=1;i<=a[0].jns;i++)jnn+=a[0].jn_le[PJ[i]],cout<<jineng_name[PJ[i]],star(a[0].jn_le[PJ[i]]); CG; cout<<"你的技能触发几率:"<<a[0].jnj<<endl; cout<<"你的药物:\n"; for(int i=1;i<=yws;i++) { if(a[0].yaowu[i]) { cout<<yw_name[i]; cout<<"(剩余"<<a[0].xiaoguo[i]<<"轮)\n"; } } cout<<"你的银两:"<<PM<<endl; cout<<"你的战力:"<<PL+PB/2+PK*4+PF*4+PS*5+PSB*7+PX*7+PBJ*7+zbb*a[0].zbss*12+jnn*a[0].jns*15+a[0].jnj*20<<endl; int o; o=getchar(); o=getchar(); return; } void yaowu() { SY cout<<"药物列表:\n"; for(int i=1;i<=yws;i++) { cout<<i<<':'; cout<<yw_name[i]<<endl; cout<<"功效:"; if(i==1)cout<<"力量在3轮内增加10点\n"; if(i==2)cout<<"防御在3轮内增加10点\n"; if(i==3)cout<<"速度在3轮内增加10点\n"; if(i==4)cout<<"血量在3轮内增加30点\n"; if(i==5)cout<<"技能触发几率在3轮内增加5%\n"; cout<<"价格:"; cout<<yaowu_jiage[i]<<"银两\n"; } int t; cin>>t; if(t==0)return; if(t>yws) { cout<<"指令无效!!\n"; Sleep(2000); return; } SY cout<<"请问您要购买多少?\n"; int l; cin>>l; SY if(PM>=l*yaowu_jiage[t])cout<<"购买成功!!\n",PM-=l*yaowu_jiage[t]; else {cout<<"您的余额不足!!\n";Sleep(2000);return;} if(t==1&&a[0].yaowu[1]==0)PK+=10; if(t==2&&a[0].yaowu[2]==0)PF+=10; if(t==3&&a[0].yaowu[3]==0)PS+=10; if(t==4&&a[0].yaowu[4]==0)PB+=30; if(t==5&&a[0].yaowu[5]==0)a[0].jnj+=5; a[0].yaowu[t]=1; a[0].xiaoguo[t]+=l*3; Sleep(2000); } void daoju() { SY cout<<"道具列表:\n"; for(int i=1;i<=djs;i++) { cout<<i<<':'; cout<<dj_name[i]<<endl; cout<<"作用:"; if(i==1)cout<<"提高升级武器成功率(10%)\n"; if(i==2)cout<<"升级武器必要物资\n"; if(i==3)cout<<"提高升级技能成功率(10%)\n"; if(i==4)cout<<"提高升级技能成功率(30%)\n"; if(i==5)cout<<"升级技能必要物资\n"; cout<<"价格:"; cout<<daoju_jiage[i]<<"银两\n"; } int t; cin>>t; if(t==0)return; if(t>djs) { cout<<"指令无效!!\n"; Sleep(2000); return; } SY cout<<"请问您要购买多少?\n"; int l; cin>>l; SY if(PM>=l*daoju_jiage[t])cout<<"购买成功!!\n",PM-=l*daoju_jiage[t]; else {cout<<"您的余额不足!!\n";Sleep(2000);return;} a[0].daoju[t]+=l; Sleep(2000); } void shop() { SY cout<<"请问您要购买什么?\n1.药物 2.道具\n"; int h; cin>>h; if(h==0)return; if(h==1) { yaowu(); } else { daoju(); } } void bag() { SY for(int i=1;i<=djs;i++) { if(a[0].daoju[i])cout<<dj_name[i]<<" 数量:"<<a[0].daoju[i]<<endl; } getchar();getchar(); return; } void used(int h) { int wj=100-10*a[0].zb_le[PZ[h]]; int uu=zbup[a[0].zb_le[PZ[h]]+1]; for(;;) { SY cout<<"输入666可以开始打磨\n"; cout<<"你准备打磨的武器:"<<zhuangbei_name[PZ[h]],star(a[0].zb_le[PZ[h]]); cout<<"本次升级的成功几率:"<<wj<<"%"<<endl; cout<<"升级所需:"<<uu<<"个淬炼石\n"; cout<<"你拥有的升级道具:\n"; int t=0; for(int i=1;i<=2;i++) { cout<<i<<"."<<dj_name[i]<<" 数量:"<<a[0].daoju[i]<<endl; } int y; cin>>y; if(y==0)return; if(y==666) { if(uu>0) { SY cout<<"淬炼石不足!!\n"; Sleep(2000); continue; } else { if(rand()%100+1<=wj) { SY cout<<"打磨成功!!\n"; cout<<"您的"<<zhuangbei_name[PZ[h]]<<"提升到了"<<++a[0].zb_le[PZ[h]]<<"级!!\n"; Sleep(2000); return; } else { SY cout<<"打磨失败!!\n"; Sleep(2000); return; } } } if(y>2) { SY cout<<"指令无效!!\n"; Sleep(2000); continue; } if(a[0].daoju[y]) { SY; cout<<"请问您要使用多少?\n"; int l; cin>>l; if(a[0].daoju[y]>=l)cout<<"使用成功!!\n"; else {cout<<"数量不足!!\n";continue;} Sleep(2000); a[0].daoju[y]-=l; if(y==1)wj+=l*10; if(y==2)uu-=l; } else { SY cout<<"材料不足!!"<<endl; Sleep(2000); } } } void dm() { SY cout<<"注意事项:请一次性加入所有物资,若加入后未打磨而退出,使用的道具将不会返还。\n"; cout<<"请选择你要打磨的武器:\n"; for(int i=1;i<=a[0].zbss;i++){CQ;cout<<i<<"."<<zhuangbei_name[PZ[i]],star(a[0].zb_le[PZ[i]]);} int h; cin>>h; if(h==0)return; if(h>a[0].zbss) { cout<<"指令无效!!\n"; Sleep(2000); return; } used(h); } void usdx(int h) { int wj=100-10*a[0].jn_le[PJ[h]]; int uu=jnup[a[0].jn_le[PJ[h]]+1]; for(;;) { SY cout<<"输入666可以开始修炼\n"; cout<<"你准备修炼的技能:"<<jineng_name[PJ[h]],star(a[0].jn_le[PJ[h]]); cout<<"本次升级的成功几率:"<<wj<<"%"<<endl; cout<<"升级所需:"<<uu<<"个仙丹\n"; cout<<"你拥有的升级道具:\n"; int t=0; for(int i=3;i<=5;i++) { cout<<i-2<<"."<<dj_name[i]<<" 数量:"<<a[0].daoju[i]<<endl; } int y; cin>>y; if(y==0)return; if(y==666) { if(uu>0) { SY cout<<"仙丹不足!!\n"; Sleep(2000); continue; } else { if(rand()%100+1<=wj) { SY cout<<"修炼成功!!\n"; cout<<"您的"<<jineng_name[PJ[h]]<<"提升到了"<<++a[0].jn_le[PJ[h]]<<"级!!\n"; Sleep(2000); return; } else { SY cout<<"修炼失败!!\n"; Sleep(2000); return; } } } if(y>3) { SY cout<<"指令无效!!\n"; Sleep(2000); continue; } if(a[0].daoju[y+2]) { SY; cout<<"请问您要使用多少?\n"; int l; cin>>l; if(a[0].daoju[y+2]>=l)cout<<"使用成功!!\n"; else {cout<<"数量不足!!\n";continue;} Sleep(2000); a[0].daoju[y+2]-=l; if(y==1)wj+=l*10; if(y==2)wj+=l*30; if(y==3)uu-=l; } else { SY cout<<"材料不足!!"<<endl; Sleep(2000); } } } void xl() { SY cout<<"注意事项:请一次性加入所有物资,若加入后未修炼而退出,使用的道具将不会返还。\n"; cout<<"请选择你要修炼的技能:\n"; for(int i=1;i<=a[0].jns;i++){CQ;cout<<i<<"."<<jineng_name[PJ[i]],star(a[0].jn_le[PJ[i]]);} int h; cin>>h; if(h==0)return; if(h>a[0].jns) { cout<<"指令无效!!\n"; Sleep(2000); return; } usdx(h); } void zc() { SY cout<<"请输入你的用户名:"; cin>>na; if(na=="back")return; cout<<"请输入你的密码(空格表示结束):"; string mi; char m; while(m=getch()) { if(m==' ')break; mi+=m; cout<<"*"; } cout<<endl; cout<<"请再次确认你的密码(空格表示结束):"; string ma; char a; while(a=getch()) { if(a==' ')break; ma+=a; cout<<"*"; } cout<<endl; getchar();getchar(); if(mi==ma) { SY cout<<"注册成功!!\n"; string s; freopen("用户资料.txt","r",stdin); freopen("新注册用户暂存资料.txt","w",stdout); while(getline(cin,s))cout<<s<<endl; cout<<na<<endl<<mi<<endl; wrong=1; COUT Sleep(2000); exit(0); } else { SY cout<<"注册失败!!两次密码不匹配!!\n"; Sleep(2000); return; } } void dl() { SY cout<<"请输入你的用户名:"; cin>>na; if(na=="back")return; cout<<"请输入你的密码(空格表示结束):"; string mima; char m; while(m=getch()) { if(m==' ')break; mima+=m; cout<<"*"; } freopen("用户资料.txt","r",stdin); string NAME,MIMA; bool yes=0; while(cin>>NAME>>MIMA) { if(NAME==na) { yes=1; if(MIMA==mima) { SY cout<<"登录成功!!\n"; CIN dll=1; Sleep(2000); return; } else { SY cout<<"密码错误!!\n"; wrong=1; CIN Sleep(2000); exit(0); } } } if(yes==0) { SY cout<<"无此用户!!请先注册。\n"; wrong=1; CIN Sleep(2000); exit(0); } } void sm() { SY cout<<"游戏说明(请在阅读完后在开始游戏,你可以在进入游戏后从“说明”中再次查看本说明):\n"; cout<<"1.退出指令:挑战模式及其细况、图鉴模式、商店模式及其细况、修炼模式以及打磨模式为0,本模式、状态模式、图鉴细况以及背包模式为任意键\n"; cout<<"2.在战斗模式中,每打通一个地图可获得100银两资助,每战胜一个未战胜过的角色,将会获得属性增加(详细请参看图鉴)。战斗胜利后按任意键退出,失败后2秒自动退出。\n"; cout<<"3.在进入模式时请按照数字输入,如果输入其他导致数据丢失及系统卡住,后果自负。\n"; cout<<"4.在保存并退出后请使用保存系统.exe保存数据。\n"; cout<<"5.其余说明请参看各模式内的文字。\n"; getchar();getchar(); } void in() { SY system("color 0B"); for(;;) { SY; cout<<" 欢迎来到闯!(V 1.7 制作:唯创C++游戏开发集团)"<<endl<<"1.注册(当系统显示注册成功后,系统将自动退出,请使用注册系统.exe,再重新按F11进入) \n2.登录(如密码错误或系统无法查找到该用户,系统将自动退出,请重新按F11进入)"<<endl; int a; cin>>a; if(a==1)zc(); else dl(); if(dll==1||wrong==1)break; } } void gx() { SY cout<<"更新中...\n版本1.7更新内容:完成注册及登录功能!!\n加载中..."; for(int i=1;i<=35;i++){PFK;Sleep(200);} } void esc() { SY freopen("用户数据.txt","r",stdin); freopen("暂存用户数据.txt","w",stdout); string s; int lun=0; while(getline(cin,s)) { if(s==PN)lun=9; if(lun!=0){lun--;continue;} cout<<s<<endl; } cout<<PN<<"\n"<<PL<<" "<<PE<<" "<<PB<<" "<<PK<<" "<<PF<<" "<<PS<<" "<<PSB<<" "<<PBJ<<" "<<PX<<" "<<a[0].jnj<<" "<<PM<<endl; cout<<a[0].zbss<<endl; cout<<1<<" "; for(int i=1;i<=a[0].zbss;i++)cout<<PZ[i]<<" "<<a[0].zb_le[PZ[i]]<<" "; cout<<endl; cout<<a[0].jns<<endl; cout<<1<<" "; for(int i=1;i<=a[0].jns;i++)cout<<PJ[i]<<" "<<a[0].jn_le[PJ[i]]<<" "; cout<<endl; for(int i=1;i<=mapsum;i++)cout<<gk[i-1]<<" "; cout<<endl; for(int i=1;i<=yws;i++)cout<<a[0].yaowu[i]<<" "<<a[0].xiaoguo[i]<<" "; cout<<endl; for(int i=1;i<=djs;i++)cout<<a[0].daoju[i]<<" "; cout<<endl; COUT cout<<"数据保存成功!!"; Sleep(2000); exit(0); } void work() { SY if(wrong==1)return; PN=na; cout<<"请问是首次使用该账号游戏吗?0否 1是\n"; cin>>game; if(game==1) { PB=70; PL=1; PK=5; PF=5; PS=5; PBJ=2; PX=3; PM=50; PSB=3; return; } freopen("用户数据.txt","r",stdin); string s; while(getline(cin,s)) { if(s==na) { int p; cin>>PL>>PE>>PB>>PK>>PF>>PS>>PSB>>PBJ>>PX>>a[0].jnj>>PM; cin>>a[0].zbss; cin>>p; for(int i=1;i<=a[0].zbss;i++)cin>>PZ[i]>>a[0].zb_le[PZ[i]]; cin>>a[0].jns; cin>>p; for(int i=1;i<=a[0].jns;i++)cin>>PJ[i]>>a[0].jn_le[PJ[i]]; for(int i=1;i<=mapsum;i++)cin>>gk[i-1]; for(int i=1;i<=yws;i++)cin>>a[0].yaowu[i]>>a[0].xiaoguo[i]; for(int i=1;i<=djs;i++)cin>>a[0].daoju[i]; CIN break; } } } void begin() { SY for(;;) { SY system("color 0B"); while(PE>=lev[PL]) { SY cout<<"你的等级提升至"<<PL+1<<"级!!\n"; PL++; PE-=lev[PL-1]; int y=rand()%wqs; if(zbget[y]<PL&&!zb[y]&&PN!="test") { cout<<"你获得了新装备"<<zhuangbei_name[y]<<"!!\n"; zb[y]=1; PZ[++a[0].zbss]=y; a[0].zb_le[y]=1; Sleep(2000); break; } else { cout<<"你的血量提高了5点!!\n你的技能触发几率提高了1点!!\n"; PB+=5; a[0].jnj++; } Sleep(2000); } /*for(int i=1;i<=mapsum;i++) if(gk[i-1]==12&&mapp[i]==0) { mapp[i]=1; cout<<"鉴于你完成"<<map_name[i]<<"副本,表现出色,得到了来自闯会的100银两资助!!\n"; Sleep(2000); PM+=100; }*/ SY printf("请选择你要做的事\n1.挑战 2.状态 3.图鉴 4.商店 5.背包 6.打磨 7.修炼 8.说明 9.保存并退出\n"); int c; cin>>c; if(c==1)fight(); else if(c==4)shop(); else if(c==3)tujian(); else if(c==2)zhuangtai(); else if(c==5)bag(); else if(c==6)dm(); else if(c==7)xl(); else if(c==8)sm(); else if(c==9)esc(); else { SY cout<<"指令:"<<c<<endl; printf("指令无效!"); Sleep(1000); continue; } } } int main() { system("color 0B"); srand(time(0)); in(); //gx(); work(); begin(); return 0; }
#include<bits/stdc++.h> using namespace std; int main() { freopen("暂存用户数据.txt","r",stdin); freopen("用户数据.txt","w",stdout); string s; while(getline(cin,s))cout<<s<<endl; freopen("暂存用户数据.txt","w",stdout); return 0; }
#include<bits/stdc++.h> using namespace std; int main() { freopen("新注册用户暂存资料.txt","r",stdin); freopen("用户资料.txt","w",stdout); string s; while(cin>>s)cout<<s<<endl; freopen("新注册用户暂存资料.txt","w",stdout); return 0; }