• Bio

    这是我做的小游戏

    #include<bits/stdc++.h>
    #include<windows.h>
    #include<conio.h>
    typedef const double cd;
    typedef const int ci;
    using namespace std;
    struct phi{
    	double a,b,c,d,e;
    }C2,D2,E2,F2,G2;
    int A,B,C,A3,B3,C3,E3,mood,D,counter=0,seed=time(0);
    int A1,B1,C1,D1,A2,B2,z1,place,type=1,timeunit=250;
    int result,J,J1,J2,J3,J4;
    double z2=1;
    double E1,F1,X1,Y1,X2,Y2;
    cd AAA_C[11]={0.25,1.2,2,4,10,20,40,100,250,1000,2000};
    cd BBB_C[11]={0.05,0.06,0.12,0.4,0.6,1.5,4,10,25,50,100};
    cd CCC_C[11]={1,1.25,1.5,1.5,2,3,6,10,20,50,100};
    cd DDD_C[11]={0.01,0.01,0,0.02,0.08,0.2,0.25,0.5,1,3,5};
    cd AAA_E[11]={10,10,10,10,10,10,10,15,20,25,30};
    cd CCC_E[11]={1,1.05,1.1,1.2,1.25,1.5,2,2,2.5,4,5};
    cd AAA_D[11]={2,2,2,2,2.5,2.5,4,4,5,5,8};
    cd CCC_D[11]={1,1.2,1.25,1.5,2,2,2,2.5,3,4,5};
    cd AAA_F[11]={1,1,1,1,1,1,1,1,1.2,1.5,3};
    cd CCC_F[11]={1,1,1,1,1,1,1,1.25,1.5,2,2.5};
    cd AAA_G[11]={0.1,0.1,0.1,0.2,0.2,0.2,0.2,0.25,0.3,0.3,0.3};
    cd CCC_G[11]={1,1,1,1,1.1,1.2,1.25,1.5,2,2.5,3};
    cd zzz[11]={0.025,0.06,0.15,0.3,0.6,1,4,10,30,100,300};
    cd ca1[11]={4,2,4,5,10,10,20,30,30,25,40};
    cd ca2[11]={1,0.6,0,1,1.5,3,3,5,8,8,5};
    cd da1[11]={8,5,8,15,25,80,100,200,200,500,300};
    cd da2[11]={2,1,1,3,3,8,10,20,40,40,20};
    cd ea1[11]={40,15,40,50,100,100,400,500,1000,1000,1000};
    cd ea2[11]={1,0.8,0.2,1,3,8,6,15,40,40,20};
    cd fa1[11]={5,2,5,5,10,12,20,50,60,150,100};
    cd fa2[11]={1,0.6,0,1,1.5,3,5,8,20,20,10};
    cd ga1[11]={0.4,0.2,1,1,2,2,5,10,10,8,8};
    cd ga2[11]={1,0.6,0,1.5,2,5,5,12,20,20,15};
    cd cb1[11]={0.03,0.02,0.06,0.2,0.3,0.8,1.5,3,7.5,15,10};
    cd cb2[11]={0.3,0.3,0,0.5,1.5,5,6,15,40,75,30};
    cd db1[11]={0.1,0.05,0.15,0.5,0.8,5,8,20,40,180,100};
    cd db2[11]={0.8,0.6,0.6,2.5,3,9,20,50,200,500,300};
    cd eb1[11]={0.2,0.2,0.5,1,2,5,20,50,200,500,400};
    cd eb2[11]={0.4,0.5,0.2,1,3,10,12,40,200,400,200};
    cd fb1[11]={0.03,0.02,0.06,0.2,0.3,0.6,2,5,12,60,50};
    cd fb2[11]={0.3,0.3,0,0.5,1.5,5,8,25,100,200,100};
    cd gb1[11]={0.003,0.002,0.02,0.03,0.06,0.1,0.4,1,2,4,3};
    cd gb2[11]={0.3,0.3,0,1,2,6,10,30,120,250,200};
    cd cc1[10]={0.2,0.2,0.6,3,3,8,30,80,600,600};
    cd cc2[10]={0.2,0.2,0,0.5,0.8,3,3,8,25,40};
    cd dc1[10]={0.5,0.5,1.2,8,10,50,120,500,3000,8000};
    cd dc2[10]={0.4,0.3,0.3,1.5,1.5,5,10,30,120,200};
    cd ec1[10]={1.5,2,5,30,30,80,500,2000,12000,20000};
    cd ec2[10]={0.2,0.3,0.1,0.6,1.5,6,6,25,120,250};
    cd fc1[10]={0.2,0.2,0.6,3,3,10,30,120,1000,3000};
    cd fc2[10]={0.2,0.2,0,0.5,0.8,3,5,12,60,120};
    cd gc1[10]={0.02,0.02,0.15,0.5,0.8,1.5,8,25,150,200};
    cd gc2[10]={0.2,0.2,0,0.6,1,3,5,20,60,120};
    cd H11[10]={0,0.1,0.2,0.3,1,2,4,10,40,120};
    cd H12[10]={0,60,100,120,180,240,600,1200,2000,9000};
    cd H2[10]={0,5,15,30,120,400,2000,10000,60000,800000};
    cd H31[10]={0,0.1,0.2,0.25,0.5,1,3,6,20,80};
    cd H32[10]={0,15,25,40,100,180,240,600,3000,6000};
    cd H4[10]={0,1,3,8,30,100,400,3000,40000,300000};
    cd H5[10]={0,0.5,1.5,3,10,25,80,200,2000,10000};
    cd I[6]={0,1,1.5,4,3,1.5};
    int h[6][10];
    ci p1[12]={15000,95000,97500,99000,99500,99800,99900,99996,99999,100000};
    ci p2[5]={15000,95000,99000,99750,100000};
    ci p3[3]={5000,95000,100000};
    ci bj[11]={8000,10000,12000,15000,20000,25000,40000,50000,80000,100000,200000};
    ci ej1[11]={200,500,500,500,500,500,1000,2000,2500,10000,20000};
    ci ej2[10]={30000,60000,80000,100000,100000,150000,200000,300000,750000,2000000};
    ci q1[10]={0,36,72,120,168,243,318,498,750,10000};
    ci q2[10]={0,3,3,4,4,5,5,6,7,8};
    ci q3[10]={0,4,4,4,4,5,5,5,6,6};
    cd m1[12]={0.5,1,1.5,2,3,5,8,10,25,40,80,120};
    cd m2[5]={0.75,1,1.5,2,5};
    cd m3[3]={0.8,1,1.2};
    cd multiplier[11]={0.6,0.7,0.75,0.8,0.9,1,1.1,1.15,1.15,1.2,1.2};
    bool E=false,cheat=false;
    string name,version="1.0.1";
    void sleep(int k){
    	Sleep(k*timeunit);
    	return ;
    }
    int ran(int rn,int rm){
    	long long ans=-1;
    	srand(seed);
    	seed++;
    	while(ans<rn){
    		ans=(rand()*1073741824+rand()*32768+rand())%(rm+1);
    		counter++;
    		if(counter>100){
    			srand(seed);
    			seed=seed+rand();
    			counter=0;
    		}
    	}
    	return ans;
    }
    double boost1(){
    	if(cheat){return 1000;}
    	int i=0;
    	D=ran(1,100000);
    	while(D>p1[i]){i++;}
    	return m1[i];
    }
    double boost2(){
    	int i=0;
    	D=ran(1,100000);
    	while(D>p2[i]){i++;}
    	return m2[i];
    }
    double boost3(){
    	int i=0;
    	D=ran(1,100000);
    	while(D>p3[i]){i++;}
    	return m3[i];
    }
    void check(){
    	C2.c=C2.a*C2.b*C2.e;
    	D2.c=D2.a*D2.b*D2.e;
    	E2.c=E2.a*E2.b*E2.e;
    	F2.c=F2.a*F2.b*F2.e;
    	G2.c=G2.a*G2.b*G2.e;
    	return ;
    }
    void introduction(){
    	cout<<"游戏正在初始化..."<<endl;
    	for(int a=1;a<=5;a++){
    		for(int b=1;b<=9;b++){
    			h[a][b]=0;
    		}
    	}
    	J1=1;J2=1;J3=3;J=J4=0;
    	counter=0;type=1;place=5;
    	A3=1;B3=1;C3=1;z1=0;mood=100;
    	E1=F1=X1=Y1=1;E3=1;A2=B2=0;
    	C2.a=0.4;Y2=D2.a=0.5;X2=E2.a=1;F2.a=0.1;G2.a=0.01;
    	C2.b=D2.b=E2.b=F2.b=G2.b=C2.d=D2.d=E2.d=F2.d=G2.d=C2.e=D2.e=E2.e=F2.e=G2.e=1;
    	check();
    	system("cls");
    	cout<<"你的名字是?"<<endl;
    	cin>>name;
    	sleep(1);
    	return ;
    }
    void printmoney(){
    	int a,b,c,d;
    	cout<<"金钱:";
    	if(z1<pow(10,3)){
    		cout<<z1<<"铁币"<<endl;
    		return ;
    	}
    	if(z1<pow(10,6)){
    		c=z1/1000;d=z1%1000;
    		cout<<c<<"铜币 "<<d<<"铁币"<<endl;
    		return ;
    	}
    	if(z1<pow(10,9)){
    		b=z1/1000000;c=z1%1000000/1000;d=z1%1000;
    		cout<<b<<"银币 "<<c<<"铜币 "<<d<<"铁币"<<endl;
    		return ;
    	}
    	a=z1/1000000000;b=z1%1000000000/1000000;c=z1%1000000/1000;d=z1%1000;
    	cout<<a<<"金币 "<<b<<"银币 "<<c<<"铜币 "<<d<<"铁币"<<endl;
    	return ;
    }
    double jy(int a1,int b1){
    	if(b1==10){
    		return ej2[a1];
    	}
    	double ans=bj[a1]+b1*ej1[a1];
    	return ans;
    }
    double gjy(int a2){
    	double ans=100*pow(2,-a2/800000.0)*boost1();
    	return ans;
    }
    void training(){
    	cout<<"1、提升等级  2、提升境界"<<endl;
    	cin>>B;
    	if(B==1){
    		double p=gjy(A2);
    		A2+=p;
    		C2.a+=0.0001*ca1[A1]*boost1();
    		D2.a+=0.0001*da1[A1]*boost1();
    		E2.a+=0.0001*ea1[A1]*boost1();
    		F2.a+=0.0001*fa1[A1]*boost1();
    		G2.a+=0.0001*ga1[A1]*boost1();
    		check();
    		cout<<"你获得了"<<fixed<<setprecision(3)<<p<<"点经验"<<endl;
    		sleep(5);
    	}else if(B==2){
    		double p=gjy(B2);
    		B2+=p;
    		C2.b+=0.00001*ca2[C1]*boost1();
    		D2.b+=0.00001*da2[C1]*boost1();
    		E2.b+=0.00001*ea2[C1]*boost1();
    		F2.b+=0.00001*fa2[C1]*boost1();
    		G2.b+=0.00001*ga2[C1]*boost1();
    		check();
    		cout<<"你获得了"<<fixed<<setprecision(3)<<p<<"点经验"<<endl;
    		sleep(5);
    	}else{
    		sleep(1);
    		cout<<"请重新输入 :)"<<endl;
    		sleep(3);
    	}
    	return ;
    }
    struct shuxing{
    	int AA1,BB1,CC1,DD1,zz7;
    	double CC2,DD2,EE2,FF2,GG2,XX2,YY2;
    }GG;
    int miss(){
    	double q=1.0-pow(2,-F2.c*1.0/GG.FF2);
    	return floor(10000*q);
    }
    int mmiss(){
    	double qq=1.0-pow(2,-GG.FF2*1.0/F2.c);
    	return floor(10000*qq);
    }
    double ddmg(){
    	return GG.CC2-G2.c;
    }
    double dmg(){
    	return (C2.c*boost1()-GG.GG2)*boost1()*z2;
    }
    void refresh(){
    	system("cls");
    	cout<<name<<"  生命:"<<X2<<"   法力:"<<Y2<<endl;
    	cout<<"敌人    生命:"<<GG.XX2<<endl;
    	return ;
    }
    int fight(){
    	while(true){
    		refresh();
    		cout<<"敌方回合"<<endl;
    		sleep(1);
    		D=ran(1,10000);
    		if(D>miss()){
    			double ddmg1=ddmg();
    			X2=X2-ddmg1;
    			cout<<"你受到了"<<ddmg1<<"点伤害"<<endl;
    			sleep(1);
    			cout<<"剩余生命值:"<<fixed<<setprecision(4)<<X2<<endl<<endl;
    			if(X2<=0){
    				return 1;
    			}
    		}else{
    			cout<<"你闪开了敌方的攻击"<<endl;
    			sleep(1);
    			cout<<"剩余生命值:"<<X2<<endl<<endl;
    		}
    		sleep(3);
    		refresh();
    		cout<<"己方回合"<<endl;
    		sleep(1);
    		D=ran(1,10000);
    		double dmg1 = dmg();
    		if(D>mmiss()){
    			cout<<"你对敌方造成了"<<dmg1<<"点伤害"<<endl;
    			sleep(1);
    			GG.XX2=GG.XX2-dmg1;
    			cout<<"敌方剩余生命值"<<GG.XX2<<endl;
    			sleep(2);
    			if(GG.XX2<=0){
    				return 2;
    			}
    		}else{
    			cout<<"敌方闪开了你的攻击"<<endl;
    			sleep(2);
    		}
    		Y2=Y2-0.05*z2*z2*(dmg1+0.01);
    		if(Y2<=0){
    			D=ran(0,1);
    			if(D==0){return 3;}else{return 4;}
    		}
    	}
    }
    shuxing definition(int a1,int b1,int c1,int d1,int z7){
    	shuxing GGG;
    	GGG.AA1=a1;GGG.BB1=b1;GGG.CC1=c1;GGG.DD1=d1;
    	GGG.CC2=(AAA_C[a1]+b1*BBB_C[a1])*(CCC_C[c1]+d1*DDD_C[c1])*zzz[z7];
    	GGG.DD2=GGG.CC2*AAA_D[a1]*CCC_D[c1];
    	GGG.EE2=GGG.CC2*AAA_E[a1]*CCC_E[c1];GGG.XX2=GGG.EE2;
    	GGG.FF2=GGG.CC2*AAA_F[a1]*CCC_F[c1];GGG.YY2=GGG.FF2;
    	GGG.GG2=GGG.CC2*AAA_G[a1]*CCC_G[c1];
    	GGG.zz7=z7;
    	return GGG;
    }
    void check1(){
    	int i=0;
    	while(J>=q1[i]){i++;}
    	J1=i;
    	J2=1+((J-q1[J1-1])/q2[J1])/q3[J1];
    	J3=q2[J1]-((J-q1[J1-1])/q3[J1])%q2[J1];
    	J4=(J-q1[J1-1])%q3[J1];
    	return ;
    }
    const string ti1[36]={"白铁","黑铁","精钢","白铜","青铜","黄铜","伪银","白银","秘银","伪金","黄金","白金","铂金","暗金","黑金","伪钻",
    "钻石","精钻","星辰","明星","星耀","巨星","超巨星","繁星","月食","新月","明月","半月","皓月","满月","日食","日出","日中","冬日","夏日","烈日"};
    const string ti2[9]={"","I","II","III","IV","V","VI","VII","VIII"};
    void printtitle(){
    	if(J1<7){cout<<ti1[3*J1+J2-4];}else{cout<<ti1[6*J1+J2-25];}
    	cout<<" "<<ti2[J3]<<" "<<J4<<"星";
    	return ;
    }
    void answer(int k){
    	system("cls");
    	if(E){
    		if(k==2){
    			cout<<"你获胜了!";
    			J++;
    		}else{
    			cout<<"你落败了";
    			if(J>0){J--;}
    		}
    		check1();
    	}else{
    		if(k==1){
    			cout<<"你被打败了..."<<endl;
    		}
    		if(k==2){
    			cout<<"你击败了对手!"<<endl;
    			sleep(1);
    			D=ran(5,10)*pow(10,A1);
    			cout<<"你获得了"<<D<<"枚铁币"<<endl;
    			z1+=D;
    		}
    		if(k==3){
    			cout<<"你在战斗中体力不支,被打败了..."<<endl;
    		}
    		if(k==4){
    			cout<<"你在战斗中体力不支,趁机逃走了..."<<endl;
    		}
    	}
    	sleep(4);
    	return ;
    }
    void battle(int a1,int b1,int c1,int d1,int z7){
    	GG=definition(a1,b1,c1,d1,z7);
    	result=fight();
    	answer(result);
    	return ;
    }
    string po1[5]={"训练室","学校","市场","野外","家"};
    string po2[9]={"新手","入门","初级","初级+","中级","中级+","高级","高级+","特级"};
    const string t1[55]={"训练可以快速提升等级和境界","不建议前往高阶区域探索","探索时可能遇到高阶敌人","探索时可能遇到低阶敌人","为什么市场不开啊? 因为作者还没有想好要卖什么",
    "休息选项会耗费一天时间,使生命与法力回满","不建议在学校探索","不建议在训练室探索","更改存档名称可能导致读取失败","再过几天市场就开了吧(真的吗)","为什么战斗界面这么简陋啊? 因为作者还没想好...",
    "Happy Happy Happy~~~~~~","据说商店下周开业(真的吗)","南鑫真的好厉害吗","......6","这是你第几次看到这条Tips呢","alpha版于2024.10.28发布","防御属性可以降低你受到的伤害","敏捷属性可以帮助你闪开敌人的攻击",
    "精神属性可以使你在战斗中更加持久(?","生命属性可以让你更耐揍","生命属性可以让你成为耐摔王(?","今天你迟到了吗?","入校时间 7:30:01 :(","入校时间 14:25:01 :(","入校时间 7:30:00 :|","入校时间 14:25:00 :|",
    "入校时间 7:29:59 :)","入校时间 14:24:59 :)","想提前去吃饭~~~","原神,启动!","战斗策略可在设置修改","<0.6的战斗策略为极端保守","0.6~0.8的战斗策略为保守","0.8~1.25的战斗策略为平衡",
    "1.25~1.5的战斗策略为激进",">1.5的战斗策略为极端激进","力量药水可以短暂提高伤害","1金币=1000银币","1银币=1000铜币","1铜币=1000铁币","1阶药水价格为1铁币,2阶药水价格为10铁币, 以此类推...",
    "不同药水的价格是不同的","恢复药水较为昂贵","治疗药水较为廉价","欢迎向作者反映bug","更高的战斗策略会提高伤害,但也会大幅提高法力消耗","为什么敌人受到的伤害为0? 因为敌人的防御太高",
    "不建议设置太高的战斗策略","不要设置太低的战斗策略","崩坏:星穹铁道,启动!","各位的期中考成绩如何呀~~~(作者考萎了:(","国测快乐~~~","体测快乐~~~","体育课快乐~~~"};
    const string t2[50]={"xμ=(x,y,z,ict)","uμ=dxμ/dτ","uz'=√(1-v2/c2)*uz/(1-v*ux/c2)","E'=(E-v*px)/(1-v*ux/c2)","E=hν","F=ma","p=mv","E=mv2/2","F=dE/dx","v=dx/dt","a=dv/dt","v=dE/dp",
    "ux'=(ux-v)/(1-v*ux/c2)","uy'=√(1-v2/c2)*uy/(1-v*ux/c2)","pμ=(px,py,pz,iE/c)","dU=TdS-pdV","dH=TdS+Vdp","dF=-SdT-pdV","dG=-SdT+Vdp","U=Nu","H=Nh","F=Nf","G=Nμ","S=Ns","V=Nv",
    "dU=TdS-pdV+ΣμdN","dH=TdS+Vdp+ΣμdN","dF=-SdT-pdV+ΣμdN","dG=-SdT+Vdp+ΣμdN","dΨ=-SdT-pdV-ΣNdμ","Ψ=F-ΣμN","du=Tds-pdv","dh=Tds+vdp","df=-sdT-pdv","dμ=-sdT+vdp",
    "D=εE","B=μH","H=U+pV","F=U-TS","G=U-TS+pV","dU=TdS-pdV","F=dp/dt","m=m0/√(1-v2/c2)","j=ρv","φ=kx-ωt","x'=(x-vt)/√(1-v2/c2)","y'=y","z'=z","t'=(t-vx/c2)/√(1-v2/c2)","pμ=m0*xμ",};
    const string t3[15]={"ΣνA=0","Σνμ=0","Πp^ν=Kp(T)","U=NRT/(γ-1)","H=γNRT/(γ-1)","S=NRlnT/(γ-1)+NRlnV","S=γNRlnT/(γ-1)-NRlnp","F=NRT(1-lnT)/(γ-1)-NRTlnV","G=NRT(γ-lnT)/(γ-1)-NRTlnV",
    "u=RT/(γ-1)","h=γRT/(γ-1)","s=RlnT/(γ-1)+RlnV","s=γRlnT/(γ-1)-Rlnp","f=RT(1-lnT)/(γ-1)-RTlnV","μ=RT(γ-lnT)/(γ-1)-RTlnV"};
    void randomtips(){
    	D=ran(0,389);
    	cout<<"Tips:";
    	if(D<275){cout<<t1[D/5];}else if(D<375){cout<<t2[(D-275)/2];}else{cout<<t3[D-375];}
    	cout<<endl;
    	return ;
    }
    void tips(){
    	cout<<"你想了解什么?"<<endl;
    	cout<<"1、训练   2、探索"<<endl;
    	cin>>B;
    	if(B==1){
    		cout<<"训练会增加经验,升级时会提高各项属性"<<endl;
    		cout<<"更高的属性值可以帮助你战胜强大的敌人"<<endl;
    	}else{
    		cout<<"探索时会遇见敌人"<<endl;
    		cout<<"敌人的等级与境界与位置对应级别间差距不超过一阶"<<endl;
    	}
    	cout<<"输入1以继续"<<endl;
    	cin>>B;
    	if(B==1){
    		return ;
    	}else{
    		cout<<"呃..."<<endl;
    		sleep(3);
    		cout<<"我们还是继续吧"<<endl;
    		sleep(4);
    		return ;
    	}
    }
    void firstpage(){
    	system("cls");
    	cout<<"小游戏 1.0.0版   by LJQ(C20240186 AG20270281)"<<endl;
    	cout<<name<<endl;
    	cout<<"等级: "<<A1<<"阶"<<B1<<"级    经验: "<<A2<<"/"<<jy(A1,B1)<<endl;
    	cout<<"境界: "<<C1<<"阶"<<D1<<"级    经验: "<<B2<<"/"<<jy(C1,D1)<<endl<<endl;
    	cout<<"力量: "<<fixed<<setprecision(3)<<C2.c<<"  精神: "<<fixed<<setprecision(3)<<D2.c<<endl;
    	cout<<"生命: "<<fixed<<setprecision(3)<<E2.c<<"  敏捷: "<<fixed<<setprecision(3)<<F2.c<<endl;
    	cout<<"当前生命: "<<X2<<"  当前法力: "<<Y2<<endl;
    	cout<<"当前精力: "<<E3<<"  当前心情: "<<mood<<endl;
    	cout<<"段位";
    	printtitle();
    	cout<<"位置: "<<po1[place-1];
    	if(place==4){cout<<"   "<<po2[type-1];}
    	cout<<endl;
    	printmoney();
    	cout<<"现在是"<<A3<<" 年 "<<B3<<" 月 "<<C3<<" 日"<<endl;
    	cout<<"接下来做什么?"<<endl;
    	cout<<"1、移动  2、探索  3、训练  4、挑战"<<endl;
    	cout<<"5、休息  6、引导教程       7、设置"<<endl;
    	cout<<"8、保存(存档名称为  你的存档.txt )"<<endl;
    	cout<<"9、读取存档  ( 请勿更改存档名称! )"<<endl;
    	cout<<"10、排位赛"<<endl;
    	randomtips();
    	return ;
    }
    void travelto(){
    	system("cls");
    	cout<<"去哪里?"<<endl;
    	sleep(2);
    	cout<<"1、训练室   2、学校   3、市场"<<endl;
    	cout<<"4、野外     5、家"<<endl;
    	if(place==4){
    		cout<<"101、新手 (1阶)"<<endl;
    		cout<<"102、入门 (2阶)"<<endl;
    		cout<<"103、初级 (3阶)"<<endl;
    		cout<<"104、初级+(4阶)"<<endl;
    		cout<<"105、中级 (5阶)"<<endl;
    		cout<<"106、中级+(6阶)"<<endl;
    		cout<<"107、高级 (7阶)"<<endl;
    		cout<<"108、高级+(8阶)"<<endl;
    		cout<<"109、特级 (9阶)"<<endl;
    	}
    	cin>>B;
    	if(1<=B&&B<=5){
    		place=B;
    		cout<<"正在前往"<<po1[place-1];
    		sleep(4);
    		cout<<"已到达"<<po1[place-1]<<"!";
    		sleep(1);
    	}else if(place==4&&101<=B&&B<=109){
    		type=B-100;
    	}
    	return ;
    }
    int init(){
    	D=ran(1,10);
    	if(D==1){
    		return -1;
    	}
    	if(D==10){
    		return 1;
    	}
    	return 0;
    }
    void exploreschool(){
    	system("cls");
    	D=ran(1,10);
    	if(D==1){
    		cout<<"你遇到了同学"<<endl;
    		sleep(1);
    		D=ran(1,3);
    		switch(D){
    			case(1):
    				D=ran(50,100);
    				cout<<"你和同学在校门口吃饭"<<endl;
    				sleep(2);
    				cout<<"花费了"<<D<<"枚铁币"<<endl;
    				sleep(3);
    				z1=z1-D;
    				D=ran(1,3);
    				mood=mood+D;
    				return ;
    			case(2):
    				cout<<"你和同学去电影院看电影"<<endl;
    				sleep(3);
    				D=ran(200,300);
    				cout<<"花费了"<<D<<"枚铁币"<<endl;
    				sleep(2);
    				z1=z1-D;
    				D=ran(3,5);
    				mood=mood+D;
    				return ;
    			case(3):
    				cout<<"你和同学在宿舍玩游戏"<<endl;
    				sleep(5);
    				D=ran(1,10);
    				mood=mood+D;
    				return ;
    		}
    	}else if(D==2){
    		cout<<"你遇到了老师"<<endl;
    		D=ran(1,2);
    		if(D==1){
    			D=ran(3,5);
    			cout<<"老师希望你认真训练,不要浪费时间:|"<<endl;
    			sleep(2);
    			mood-=D;
    		}else{
    			D=ran(3,5);
    			cout<<"老师表扬了你的小测成绩:)"<<endl;
    			sleep(3);
    			mood+=D;
    		}
    		return ;
    	}else{
    		cout<<"你在校园里转了一会儿,并没有遇见人";
    		sleep(6);
    		return ;
    	}
    }
    void market(){
    	system("cls");
    	cout<<"你要买什么?"<<endl;
    	sleep(1);
    	cout<<"1、持续治疗药水      2、瞬时治疗药水"<<endl;
    	cout<<"3、持续恢复药水      4、瞬时恢复药水"<<endl;
    	cout<<"5、力量药水          6、我就看看"<<endl;
    	sleep(2);
    	int P;
    	cin>>B;
    	if(B!=1&&B!=2&&B!=3&&B!=4&&B!=5){return ;}
    	cout<<"输入药水阶数"<<endl;
    	cin>>C;
    	cout<<"你确认要购买吗?"<<endl;
    	cout<<"1、是   2、否"<<endl;
    	cin>>P;
    	if(P!=1){return ;}
    	int price=pow(10,C-1)*I[B];
    	if(price>z1){
    		cout<<"你的钱币不足以购买!"<<endl;
    		sleep(5);
    	}else{
    		cout<<"购买成功!"<<endl;
    		sleep(4);
    		h[B][C]++;
    	}
    	return ;
    }
    void explore(){
    	system("cls");
    	if(place==1){
    		D=ran(1,100);
    		if(D==1){
    			cout<<"你找到了一枚铜币。"<<endl;
    			z1+=1;
    		}else{
    			cout<<"训练室里什么也没有,换个地方探索吧"<<endl;
    		}
    		sleep(3);
    	}
    	if(place==2){
    		exploreschool();
    	}
    	if(place==3){
    		market();
    	}
    	if(place==4){
    		int aa1=type+init();
    		int cc1=type+init();
    		int ZZ7=type/2+1+init();
    		int bb1=ran(1,10);
    		int dd1=ran(1,10);
    		cout<<"你遇到了敌人!"<<endl;
    		sleep(2);
    		cout<<"战斗开始"<<endl;
    		battle(aa1,bb1,cc1,dd1,ZZ7);
    		return ;
    	}
    	
    }
    void checkstatus(){
    	system("cls");
    	mood=50+mood/2;
    	if(X2<=0){
    		cout<<"你在"<<po1[place-1]<<"因为体力不支昏倒了"<<endl;
    		sleep(4);
    		cout<<"醒来时,你发现你躺在家中的床上"<<endl;
    		sleep(4);
    		cout<<"摸摸口袋,";
    		sleep(4);
    		cout<<"你发现你少了10铁币"<<endl;
    		sleep(8);
    		system("cls");
    		z1=z1-10;
    	}
    	while(A2>=jy(A1,B1)&&B1<10){
    		A2=A2-jy(A1,B1);
    		B1=B1+1;
    		cout<<"你升级了!"<<endl;
    		C2.a+=cb1[A1]*boost2();
    		D2.a+=db1[A1]*boost2();
    		E2.a+=eb1[A1]*boost2();
    		F2.a+=fb1[A1]*boost2();
    		G2.a+=gb1[A1]*boost2();
    		check();
    		sleep(2);
    	}
    	while(B2>=jy(C1,D1)&&D1<10){
    		B2=B2-jy(C1,D1);
    		D1=D1+1;
    		cout<<"你升级了!"<<endl;
    		C2.b+=0.01*cb2[C1]*boost2();
    		D2.b+=0.01*db2[C1]*boost2();
    		E2.b+=0.01*eb2[C1]*boost2();
    		F2.b+=0.01*fb2[C1]*boost2();
    		G2.b+=0.01*gb2[C1]*boost2();
    		check();
    		sleep(2);
    	}
    	system("cls");
    	return ;
    }
    void settings(){
    	system("cls");
    	cout<<"1、调整时间间隔(初始为250ms)"<<endl;
    	cout<<"2、调节战斗策略(建议为0.8~1.5)"<<endl;
    	cin>>B;
    	if(B==1){
    		cout<<"请输入时间间隔(单位为ms)"<<endl;
    		cin>>timeunit;
    		cout<<"设置成功!"<<endl;
    		Sleep(1000);
    	}else if(B==2){
    		cout<<"请输入数值"<<endl;
    		cin>>z2;
    	}else if(B==20090218){
    		cheat=true;
    	}else{
    		cout<<"nothing here"<<endl;
    		sleep(5);
    	}
    	return ;
    }
    bool runnian(){
    	if(A3%400==0){return true;}
    	if(A3%100==0){return false;}
    	if(A3%4==0){return true;}
    	return false;
    }
    void date(){
    	C3+=1;
    	switch(B3){
    		case(1):
    		case(3):
    		case(5):
    		case(7):
    		case(8):
    		case(10):
    		case(12):
    			if(C3>31){
    				C3=C3-31;
    				B3=B3+1;
    			}
    			break;
    		case(4):
    		case(6):
    		case(9):
    		case(11):
    			if(C3>30){
    				C3=C3-30;
    				B3=B3+1;
    			}
    			break;
    		case(2):
    			if(runnian()){
    				if(C3>29){
    					C3=C3-29;
    					B3=B3+1;
    				}
    			}else{
    				if(C3>28){
    					C3=C3-28;
    					B3=B3+1;
    				}
    			}
    			break;
    	}
    	return ;
    }
    void date1(int k){
    	for(int i=0;i<k;i++){date();}
    	return ;
    }
    void savefile(){
    	ofstream of("你的存档.txt",ios::trunc|ios::binary);
    	of<<version<<" "<<B1<<" "<<C1<<" "<<D1<<" "<<E1<<" "<<F1<<" "<<X1<<" "<<Y1<<endl;
    	of<<A2<<" "<<B2<<" "<<fixed<<setprecision(3)<<C2.a<<" "<<C2.b<<" "<<D2.a<<" "<<D2.b<<" "<<E2.a<<" "<<E2.b<<" "<<F2.a<<" "<<F2.b<<" "<<G2.a<<" "<<G2.b<<" "<<X2<<" "<<Y2<<endl;
    	of<<A3<<" "<<B3<<" "<<C3<<" "<<z1<<endl;
    	for(int a=1;a<=5;a++){for(int b=1;b<=9;b++){of<<h[a][b]<<" ";}}
    	of<<name<<" "<<version<<endl;
        of.close();
        cout<<"保存成功!"<<endl;
        sleep(3);
    	getch();
        return;
    }
    void readfile(){
    	string version1;
    	ifstream lf("你的存档.txt");
    	lf>>version1;
    	system("cls");
    	if(version1!=version){
    		cout<<"版本不同,确定要读取吗?"<<endl;
    		cout<<"1、是    2、否"<<endl;
    		cin>>D;
    		if(D!=1){return ;}
    		cout<<"好吧..."<<endl;
    		Sleep(200);
    	}
    	lf>>A1>>B1>>C1>>D1>>E1>>F1>>X1>>Y1;
    	lf>>A2>>B2>>C2.a>>C2.b>>D2.a>>D2.b>>E2.a>>E2.b>>F2.a>>F2.b>>G2.a>>G2.b>>X2>>Y2;
    	lf>>A3>>B3>>C3>>z1;
    	for(int a=1;a<=5;a++){for(int b=1;b<=9;b++){lf>>h[a][b];}}
    	lf>>name;
    	cout<<"读取成功!"<<endl;
    	sleep(3);
    	getch();
    	check();
    	return ;
    }
    void rest(){
    	cout<<"你休息了一天,";
    	sleep(2);
    	cout<<"感觉精力充沛"<<endl;
    	Y2=D2.c;X2=E2.c;
    	sleep(5);
    	return ;
    }
    double pos(double a,double b){
    	double q=1.0-pow(2,-a/b);
    	return floor(1000*q);
    }
    void challenge(){
    	system("cls");
    	cout<<"你要尝试突破吗?"<<endl;
    	cout<<"1、突破等级   2、突破境界   3、我就看看"<<endl;
    	cin>>B;
    	if(B==1){
    		if(B1<10){
    			cout<<"你还没有到达10级"<<endl;
    			sleep(1);
    			cout<<"现在还不能突破"<<endl;
    			sleep(4);
    			return ;
    		}
    		int q=pos(A2,ej2[A1]);
    		D=ran(1,1000);
    		if(D<=q){
    			cout<<"突破中"<<endl;
    			sleep(4);
    			cout<<"突破成功!"<<endl;
    			sleep(2);
    			C2.a+=cc1[A1]*boost3();
    			D2.a+=dc1[A1]*boost3();
    			E2.a+=ec1[A1]*boost3();
    			F2.a+=fc1[A1]*boost3();
    			G2.a+=gc1[A1]*boost3();
    			check();
    			A1++;
    			B1=0;
    			A2=0;
    		}else{
    			cout<<"突破中"<<endl;
    			sleep(4);
    			cout<<"突破失败!"<<endl;
    			sleep(2);
    			A2=0;
    		}
    		return ;
    	}
    	if(B==2){
    		if(D1<10){
    			cout<<"你还没有到达10级"<<endl;
    			cout<<"现在还不能突破"<<endl;
    			sleep(4);
    			return ;
    		}
    		int q=pos(B2,ej2[C1]);
    		D=ran(1,1000);
    		if(D<=q){
    			cout<<"突破中"<<endl;
    			C2.b+=cc2[C1]*boost3();
    			D2.b+=dc2[C1]*boost3();
    			E2.b+=ec2[C1]*boost3();
    			F2.b+=fc2[C1]*boost3();
    			G2.b+=gc2[C1]*boost3();
    			check();
    			C1++;
    			D1=0;
    			B2=0;
    			sleep(4);
    			cout<<"突破成功"<<endl;
    		}else{
    			cout<<"突破中"<<endl;
    			sleep(4);
    			cout<<"突破失败!"<<endl;
    			B2=0;
    		}
    		sleep(2);
    		return ;
    	}
    	return ;
    }
    void paiwei(){
    	cout<<"你现在的段位是";
    	printtitle();
    	cout<<", 确认要进行排位赛吗?"<<endl;
    	cout<<"1、是    2、否"<<endl;
    	cin>>D;
    	if(D!=1){return ;}
    	E=true;
    	if(J1<7){battle(J1,3*J2-1+init(),J1,3*J2-1+init(),J1+init());}
    	if(J1>6){battle(J1,J2-1+(J2+1)/2+init(),J1,J2-1+(J2+1)/2+init(),J1+init());}
    	E=false;
    	return ;
    }
    int main(){
    	introduction();
    a:	checkstatus();
    	date();
    	firstpage();
    	cin>>A;
    	if(A==1){
    		travelto();
    	}else if(A==2){
    		explore();
    	}else if(A==3){
    		training();
    	}else if(A==4){
    		challenge();
    	}else if(A==5){
    		rest();
    	}else if(A==6){
    		tips();
    	}else if(A==7){
    		settings();
    	}else if(A==8){
    		savefile();
    	}else if(A==9){
    		readfile();
    	}else if(A==10){
    		paiwei();
    	}else{
    		cout<<"nothing here"<<endl;
    		sleep(5);
    	}
    	goto a;
    }
    
  • Recent Activities