自编游戏/程序,多款原创游戏大集合,欢迎私信或评论,提供建议、bug和不足之处。
目录
一、核心游戏
1.1 混合运算测试
代码:
system("color F1");
cout<<"玩家:"<<name;
while(1){
cout<<"禁止输入文字!!!\n若暂停,输入大于等于100000的数(注:除法计算保留整数)"<<endl;
cout<<"请选择1.加法 2.减法 3.加减混合 4.乘法 5.除法 6.乘除混合 7.加减乘除混合 8.退出"<<endl;
cin>>xuanze;
yaoshi=5;
if (xuanze==1)
{
while(yaoshi>0){
yaoshi++;
cishu++;
shuju();
srand(time(0));
xiangzi_a=a=rand()%100;
xiangzi_b=b=rand()%100;
nandu();
cout<<"难度:"<<nandu()<<endl;
cout<<a<<"+"<<b<<"=";
cin>>c;
if(c>=100000){
yaoshi=0;
Sleep(1100);system("cls");
}
if(c!=a+b){
cout<<"错误!\n"<<"正确答案为:"<<a+b<<endl;
Sleep(1100);system("cls");
}
else{
cout<<"正确"<<endl;
score++;
Sleep(1100);system("cls");
}
}
}
if (xuanze==2){
yaoshi++; //减
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=jf_a=rand()%100;
xiangzi_b=jf_b=rand()%100;
shuju();
cout<<"难度:"<<nandu()<<endl;
cout<<jf_a<<"-"<<jf_b<<"=";
cin>>c;
if(c>=100000){
//cishu=0;
yaoshi=0;
Sleep(1100);system("cls");
}
if(c!=jf_a-jf_b){
cout<<"错误!\n"<<"正确答案为:"<<jf_a-jf_b<<endl;
cout<<"分数:"<<score<<endl<<endl;
Sleep(1100);system("cls");
}
else{
cout<<"正确"<<endl;
score++;
//cout<<"分数:"<<score<<endl<<endl;
Sleep(1100);system("cls");
}
}
//break;
}
if (xuanze==3){
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=jj_a=rand()%100;
xiangzi_b=jj_b=rand()%100;
xiangzi_c=jj_d=rand()%100;
shuju();
//cout<<"次数:"<<cishu<<endl;
cout<<jj_a<<"-"<<jj_b<<"+"<<jj_d<<"=";
cin>>c;
if(c>=100000){//
//cishu=0;
yaoshi=0;
clean();
break;
}
if(c!=jj_a-jj_b+jj_d){//
cout<<"错误!\n"<<"正确答案为:"<<jj_a-jj_b+jj_d<<endl;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
else{//
cout<<"正确"<<endl;
score++;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
}
//break;
}
if (xuanze==4){
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=cf_a=rand()%100;
xiangzi_b=cf_b=rand()%100;
shuju();
//cout<<"次数:"<<cishu<<endl;
cout<<cf_a<<"*"<<cf_b<<"=";
cin>>c;
if(c>=100000){
//cishu=0;
yaoshi=0;
clean();
break;
}
if(c!=cf_a*cf_b){
cout<<"错误!\n"<<"正确答案为:"<<cf_a*cf_b<<endl;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
}
// break;
}
if (xuanze==5){
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=chuf_a=rand()%100;
xiangzi_b=chuf_b=rand()%100;
shuju();
//cout<<"次数:"<<cishu<<endl;
cout<<chuf_a<<"/"<<chuf_b<<"=";
cin>>c;
if(c>=100000){
//cishu=0;
yaoshi=0;
clean();
// break;
}
if(c!=chuf_a/chuf_b){
cout<<"错误!\n"<<"正确答案为:"<<chuf_a/chuf_b<<endl;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
}
// break;
}
if (xuanze==6){
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=cc_a=rand()%100;
xiangzi_b=cc_b=rand()%100;
xiangzi_c=cc_d=rand()%100;
//cout<<"次数:"<<cishu<<endl;
shuju();
cout<<cc_a<<"*"<<cc_b<<"/"<<cc_d<<"=";
cin>>c;
if(c>=100000){
//cishu=0;
yaoshi=0;
clean();
// break;
}
if(c!=cc_a*cc_b/cc_d){
cout<<"错误!\n"<<"正确答案为:"<<cc_a*cc_b/cc_d<<endl;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
clean();
}
}
}
if (xuanze==7){
while(yaoshi>0){
int sj_a;
cishu++;
srand(time(0));
xiangzi_a=jjcc_a=rand()%100;
xiangzi_b=jjcc_b=rand()%100;
xiangzi_c=jjcc_c=rand()%100;
xiangzi_d=jjcc_d=rand()%100;
xiangzi_e=jjcc_e=rand()%100;
sj_a=rand()%12;
if(sj_a==1){
cout<<jjcc_a<<"+"<<jjcc_b<<"-"<<jjcc_c<<"*"<<jjcc_d<<"/"<<jjcc_e<<"=";
cin>>c;
if(c>=100000){
yaoshi=0;
clean();
}
if(c!=jjcc_a+jjcc_b-jjcc_c*jjcc_d/jjcc_e){
cout<<"错误!\n"<<"正确答案为:"<<jjcc_a+jjcc_b-jjcc_c*jjcc_d/jjcc_e<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
clean();
}
}
if(sj_a==2){
cout<<jjcc_a<<"-"<<jjcc_b<<"+"<<jjcc_c<<"*"<<jjcc_d<<"/"<<jjcc_e<<"=";
cin>>c;
if(c>=100000){
yaoshi=0;
clean();
}
if(c!=jjcc_a-jjcc_b+jjcc_c*jjcc_d/jjcc_e){
cout<<"错误!\n"<<"正确答案为:"<<jjcc_a-jjcc_b+jjcc_c*jjcc_d/jjcc_e<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
clean();
}
}
}
}
if(xuanze==8){
break;
}
}
1.2 抓小鬼
代码:
long long xg_monum,xg_wjnum,xg_dnnum,xg_maxnum,aab;
string aaa;
system("color E1");
while(1){
aac:
cout<<"===================================================================\n\n";
cout<<" 抓小鬼 \n\n";
cout<<"===================================================================\n\n";
cout<<"===========================游戏规则================================\n\n" ;
cout<<"设置木偶的总数量和抽取木偶,其中一个为小鬼,抓到小鬼胜利\n(输入q,退出游戏; 输入b,可更换背景颜色)\n\n";
cout<<"===========================设置参数================================\n\n";
cout<<"木偶数量:";
cin>>aaa;
if(aaa=="q"){
break;
}
if(aaa=="b"){
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.灰色 3.黑白 4.黄色 5.蓝色"<<endl;
cin>>aab;
if(aab==1){
goto aac;
}
if(aab==2){
system("color F1");
}
if(aab==3){
system("color 07");
}
if(aab==4){
system("color E1");
}
if(aab==5){
system("color 97");
}
system("cls");
}
else{
stringstream ss;
ss<<aaa;
ss>>xg_monum;
while(xg_monum<=0){
if(xg_monum<=0){
cout<<"木偶数量要大于0\n"<<endl;
}
cout<<"木偶数量:";
cin>>xg_monum;
}
cout<<endl;
cout<<"每次抽取木偶的最大数量为:";
cin>>xg_maxnum;
while(xg_maxnum<=0){
if(xg_maxnum<=0){
cout<<"最大数量要大于0\n"<<endl;
}
cout<<"每次抽取木偶的最大数量为:";
cin>>xg_maxnum;
}
cout<<endl;
while(1){
cout<<"----------------------------玩家抽取-------------------------------\n" ;
cout<<"输入抽取木偶数量:";
cin>>xg_wjnum;
while(xg_wjnum>xg_maxnum||xg_wjnum<0){
if(xg_wjnum>xg_maxnum){
cout<<"超出范围!"<<endl;
cout<<"输入抽取木偶数量:";
cin>>xg_wjnum;
}
if(xg_wjnum<0){
cout<<"超出范围!"<<endl;
cout<<"输入抽取木偶数量:";
cin>>xg_wjnum;
}
}
xg_monum-=xg_wjnum;
if(xg_monum<=0){
cout<<"\n剩余木偶数量:0"<<endl;
cout<<"----------------------------对战结果-------------------------------\n\n";
cout<<"你胜利!\n";
Sleep(1800);
system("cls");
break;
}
cout<<"\n剩余木偶数量:" <<xg_monum<<endl;
cout<<"----------------------------电脑抽取-------------------------------\n\n" ;
srand(time(0));
if(xg_monum%xg_maxnum!=0){
xg_dnnum=rand()%xg_maxnum+1;
xg_monum-=xg_dnnum;
cout<<"电脑抽取木偶数量:"<<xg_dnnum;
cout<<endl;
if(xg_monum<=0){
cout<<"\n剩余木偶数量:0"<<endl;
cout<<"----------------------------对战结果-------------------------------\n\n";
cout<<"电脑胜利!\n";
Sleep(1800);
system("cls");
break;
}
cout<<"\n剩余木偶数量:" <<xg_monum<<endl;
}
if(xg_monum%xg_maxnum==0){
xg_dnnum=xg_maxnum;
xg_monum-=xg_dnnum;
cout<<"电脑抽取木偶数量:"<<xg_dnnum;
cout<<endl;
if(xg_monum<=0){
cout<<"\n剩余木偶数量:0"<<endl;
cout<<"----------------------------对战结果-------------------------------\n\n";
cout<<"电脑胜利!\n";
Sleep(1800);
system("cls");
break;
}
cout<<"\n剩余木偶数量:" <<xg_monum<<endl;
}
}
}
}
1.3 猜拳游戏
代码:
system("color 97");
string name,dn;
cout<<"=============================================\n\n 猜拳游戏\n\n=============================================\n\n" ;
// cout<<"名字:"<<name;
//cin>>name;
cout<<endl;
while(1){
cout<<"=============================================\n\n"<<" 第 "<<hh<<" 回合\n\n"<<"---------------------------------------------\n";
shuju2();
cout<<"1.石头 2.剪刀 3.布 4.退出\n\n你的选择:";
cin>>wj;
if(wj!=1&&wj!=2&&wj!=3&&wj!=4){
cout<<"输入错误!";
break;
}
if(wj==4){
//cout<<"---------------------------------------------\n\n
clean();
break;
}
cout<<endl;
srand(time(0));
sj=rand()%3+1;
if(sj==1) {
dn="石头";
cout<<"电脑:"<<dn<<endl<<endl;
cout<<"---------------------------------------------\n\n";
}
if(sj==2){
dn="剪刀";
cout<<"电脑:"<<dn<<endl<<endl;
cout<<"---------------------------------------------\n\n";
}
if(sj==3){
dn="布";
cout<<"电脑:"<<dn<<endl<<endl;
cout<<"---------------------------------------------\n\n";
}
if(dn=="石头"&&wj==1){
cout<<"平局\n";
ping++;
}
if(dn=="石头"&&wj==2){
cout<<"你输了\n";
shu++;
}
if(dn=="石头"&&wj==3){
cout<<"你赢了\n";
ying++;
score++;
JY++;
//DJ_a++;
}//
if(dn=="剪刀"&&wj==1){
cout<<"你赢了\n";
ying++;
score++;
JY++;
//DJ_a++;
}
if(dn=="剪刀"&&wj==2){
cout<<"平局\n";
ping++;
}
if(dn=="剪刀"&&wj==3){
cout<<"你输了\n";
shu++;
}//
if(dn=="布"&&wj==1){
cout<<"你输了\n";
shu++;
}
if(dn=="布"&&wj==2){
cout<<"你赢了\n";
ying++;
score++;
JY++;
//DJ_a++;
}
if(dn=="布"&&wj==3){
cout<<"平局\n";
ping++;
}
hh++;
Sleep(2000);system("cls");
}
1.4 灵宠世界
代码:
DQ_sj();
dw_();
sm1_1=sm1_b;
if(bj==4){
system("color E1");
}
if(bj==2){
system("color F1");
}
if(bj==3){
system("color 07");
}
if(bj==5){
system("color 97");
}
clean1();
while(1){
dW_2();
LC_zzl=xhl_zdl;
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 灵 宠 世 界 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"======================================================================================================"<<endl;
DJJ();
dW_1();
cout<<"||";
Duan();
cout<<"||等级:"<<djj<<endl;
cout<<"||金币:"<<jbb<<endl;
cout<<"||灵宠:"<< LC_num<<endl;
cout<<"||经验值:"<<jyy<<endl;
cout<<"||总战力:"<< LC_zzl<<endl;
cout<<"||灵宠排名:";
if(LC_num==1){
srand(time(0));
LC_num_pm=rand()%9999+90000;
cout<<LC_num_pm<<endl;
}
cout<<"||总战力排名:";
PM_zzl();
cout<<"======================================================================================================"<<endl;
cout<<"|| || || || || || || || ||"<<endl;
cout<<"|| 1. 灵宠 || 2. 试炼塔 || 3. 对战 || 4. 背包 || 5.野外探索 || 6.退出 || 7.商店 || 8.设置 ||"<<endl;
cout<<"|| || || || || || || || ||"<<endl;
cin>>LC_chose;
if(LC_chose==1){
while(1){
system("cls");
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 灵 宠 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.宠物图鉴 3.";
LC_xhl_dj();
cin>>LC_chose;
cout<<"\n========================================================================================"<<endl;
if(LC_chose==1){
clean1();
break;
}
if(LC_chose==2){
while(1){
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 宠 物 图 鉴 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.小火龙 3.神木猿 ";
scta(236);
cout<<"4.九天寒冰鹿 "<<endl;
cin>>aa;
if(bj==4){
system("color E1");
}
if(bj==2){
system("color F1");
}
if(bj==3){
system("color 07");
}
if(aa==1){
break;
}
}
}
if(LC_chose==3){
while(1){
LC_xhl_dj();
xhl_zdl=sh_xhl1+sh_xhl2+sh_xhl3;
cout<<"等级:"<<xhl_dj<<endl;
cout<<"生命值:"<<sm1<<endl;
cout<<"战斗力:"<<xhl_zdl<<endl;
cout<<"========================================================================================\n"<<endl;
cout<<"1.返回 2.使用秘籍 3.技能 4.装备 5.食物 6.升级"<<endl;
cin>>LC_chose;
if(LC_chose==1) {
clean1();
break;
}
if(LC_chose==2) {
if(LC_mj==0){
cout<<"========================================================================================\n"<<endl;
cout<<"暂无秘籍可用!";
clean();
}
}
if(LC_chose==3) {
while(1){
cout<<"========================================================================================\n"<<endl;
cout<<"1.火球"<<xhl1<<"级 伤害"<<sh_xhl1<<endl;
cout<<"2.拳击"<<xhl2<<"级 伤害"<<sh_xhl2<<endl;
if(ft==1){
cout<<"3.焚天"<<xhl3<<"级 伤害"<<sh_xhl3<<endl;
}
cout<<"========================================================================================\n"<<endl;
cout<<"1.返回 2.升级技能" <<endl;
cin>>LC_chose;
if(LC_chose==1) {
clean1();
break;
}
if(LC_chose==2) {
while(1){
cout<<"========================================================================================\n"<<endl;
cout<<"1.返回 \n";
cout<<"2.火球 "<<nn<<"金币 "<<endl<<"3.拳击 "<<oo<<"金币"<<endl;
if(ft==1){
cout<<"4.焚天 "<<pp<<"金币"<<endl;
}
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
if(jbb<nn){
cout<<"金币不足"<<endl;
continue;
}
if(jbb>=nn){
cout<<"升级成功!"<<endl;
xhl1++;
sh_xhl1+=80;
jbb-=nn;
nn+=110;
}
}
if(aa==3){
if(jbb<mm){
cout<<"金币不足"<<endl;
continue;
}
if(jbb>=mm){
cout<<"升级成功!"<<endl;
xhl2++;
sh_xhl2+=50;
jbb-=oo;
oo+=80;
}
}
if(aa==4&&ft==1){
if(jbb<pp){
cout<<"金币不足"<<endl;
continue;
}
if(jbb>=pp){
cout<<"升级成功!"<<endl;
xhl3++;
sh_xhl3+=100;
jbb-=pp;
pp+=160;
}
}
}
}
}
}
if(LC_chose==4) {
cout<<"暂无装备可用!";
clean();
}
if(LC_chose==5) {
while(1){
if(sw==0){
cout<<"无食物可喂食"<<endl;
clean();
break;
}
if(sw>0){
cout<<"1.返回 ";
if(sw==1){
cout<<"2.";
if(sw_nr>0){
cout<<"牛肉 "<<sw_nr<<"个 使用1个"<<endl;
}
if(sw_mxsy>0){
cout<<"满血盛宴 "<<sw_mxsy<<"个 使用1个"<<endl;
}
cin>>aa;
if(aa==1){
break;
}
if(aa==2){
if(sm1==sm1_b){
cout<<"生命值已满!"<<endl;
}
if(sm1<sm1_b){
if(sw_nr>0) {
sw_nr--;
if(sw_nr==0){
sw--;
}
sm1+=100;
if(sm1>sm1_b){
sm1=sm1_b;
}
cout<<"已使用"<<endl;
}
if(sw_mxsy){
sw_mxsy--;
if(sw_mxsy==0){
sw--;
}
sm1=sm1_b;
cout<<"已使用"<<endl;
}
}
}
}
}
}
}
//升级
if(LC_chose==6) {
while(1){
cout<<"1.返回 2.升级 需要"<<jj<<"金币"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
if(jj>jbb){
cout<<"金币不足!"<<endl;
clean();
break;
}
if(jj<=jbb){
cout<<"升级成功!"<<endl;
xhl_dj++;
jbb-=jj;
if(xhl_dj<10){
jj+=80;
}
if(xhl_dj>=10){
jj+=110;
}
sm1_b+=50;
sm1_1=sm1=sm1_b;
sh_xhl1+=30;
sh_xhl2+=15;
sh_xhl2+=70;
clean();
}
}
}
}
}
}
}
}
//二
if(LC_chose==2){
while(1){
clean1();
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 试 炼 塔 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始试炼"<<endl;
cin>>aa;
cout<<"\n========================================================================================"<<endl;
if(aa==1){
clean1();
break;
}
if(aa==2){
while(1){
cout<<"\n=====================================第 "<<ee<<" 层===========================================\n"<<endl;
srand(time(0));
gg=rand()%4;
cout<<"\n "<<gw[gg]<<" "<<endl;
if(f>0){
dd+=20*ee;
sm_1=dd;
sh_src1+=25*ee;
f=0;
}
cout<<"生命值:"<<dd<<endl;
cout<<"技能:毒液 伤害:"<<sh_src1;
cout<<"\n----------------------------------------------------------------------------------------"<<endl;
cout<<"选择灵宠出战:";
if(LC_num==1){
cout<<"1.返回 2.小火龙"<<endl;
}
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
while(1){
if(sm1>0){
cout<<"\n-------------------------------------玩家对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<sm1<<endl;
cout<<"释放技能:1.火球 2.拳击";
if(ft==1){
cout<<" 3.焚天";
}
cout<<endl;
cin>>aa;
if(aa==1){
cout<<"伤害:"<<sh_xhl1<<endl;
sm_1-=sh_xhl1;
}
if(aa==2){
cout<<"伤害:"<<sh_xhl2<<endl;
sm_1-=sh_xhl2;
}
if(ft==1&&aa==3){
cout<<"伤害:"<<sh_xhl3<<endl;
sm_1-=sh_xhl3;
}
}
cout<<"\n----------------------------------------------------------------------------------------\n"<<endl;
if(sm_1>0&&sm1>0){
cout<<"\n-------------------------------------敌方对战-------------------------------------------"<<endl;
cout<<"食人草\n"<<"生命值:"<<sm_1 <<endl;
cout<<"释放技能:毒液\n伤害:"<<sh_src1<<endl;
sm1-=sh_src1;
}
if(sm1<=0&&sm_1>0){
cout<<"\n========================================================================================"<<endl;
cout<<"你输了!"<<endl;
sm1=0;
cout<<"1.返回\n";
cin>>aa;
if(aa==1){
clean1() ;
break;
}
}
if(sm_1<=0){
cout<<"\n========================================================================================"<<endl;
cout<<"你赢了!"<<endl;
jbb+=20*ee;
jyy+=10*ee;
cout<<"获得:\n金币+"<<20*ee<<endl<<"经验值+"<<10*ee<<endl;
ee++;
f++;
cout<<"1.下一关"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
}
}
}
}
}
}
}
if(LC_chose==3){
while(1){
system("cls");
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 对 战 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始匹配对手"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
//smm1,zdl1
if(aa==2){
ab:
cout<<"\n========================================================================================\n"<<endl;
cout<<"您的当前";
Duan();
cout<<"\n========================================================================================\n"<<endl;
Sleep(1000);
cout<<"匹配成功!"<<endl;
sm1_=sm1_b;
clean();
cout<<"\n========================================================================================\n"<<endl;
srand(time(0));
ll=rand()%9999+1000;
cout<<"游客_"<<ll<<endl;
srand(time(0));
mm=rand()%4+1;
if(mm<=3){
if(Dw=="青铜"){
smm1=150+50*mm;
zdl1=100+35*mm;
}
if(Dw=="白银"){
smm1=450+50*mm;
zdl1=350+35*mm;
}
if(Dw=="黄金"){
smm1=850+50*mm;
zdl1=550+35*mm;
}
if(Dw=="铂金"){
smm1=1000+50*mm;
zdl1=600+35*mm;
}
if(Dw=="钻石"){
smm1=2000+200*mm;
zdl1=1000+350*mm;
}
if(Dw=="星耀"){
smm1=3000+500*mm;
zdl1=1900+350*mm;
}
if(Dw=="王者"){
smm1=4000+500*mm;
zdl1=2900+350*mm;
}
if(Dw=="星光"){
smm1=5000+500*mm;
zdl1=4000+350*mm;
}
}
if(mm==4){
smm1=sm1_+655;
zdl1=xhl_zdl+700;
}
cout<<"生命值:"<<smm1<<endl;
cout<<"战斗力:"<<zdl1<<endl;
cout<<"\n========================================================================================\n"<<endl;
while(1){
if(sm1_>0){
cout<<"\n-------------------------------------玩家对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<sm1_<<endl;
cout<<"释放技能:1.火球 2.拳击";
if(ft==1){
cout<<" 3.焚天";
}
cout<<endl;
cin>>aa;
if(aa==1){
cout<<"伤害:"<<sh_xhl1<<endl;
smm1-=sh_xhl1;
}
if(aa==2){
cout<<"伤害:"<<sh_xhl2<<endl;
smm1-=sh_xhl2;
}
if(ft==1&&aa==3){
cout<<"伤害:"<<sh_xhl3<<endl;
smm1-=sh_xhl3;
}
}
cout<<"\n----------------------------------------------------------------------------------------\n"<<endl;
if(smm1>0&&sm1_>0){
cout<<"\n-------------------------------------"<<"游客_"<<ll<<"对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<smm1 <<endl;
cout<<"释放技能:火球\n伤害:"<<zdl1<<endl;
sm1_-=zdl1;
}
if(sm1_<=0&&smm1>0){
cout<<"\n========================================================================================"<<endl;
cout<<"你输了!"<<endl;
DWW--;
Dw_1--;
if(DWW<=0){
DWW=0;
}
if(Dw_1<=0){
Dw_1=0;
dw_();
dW_2();
}
dw_();
dW_2();
sm1_=0;
cout<<"1.返回\n";
cin>>aa;
if(aa==1){
clean1() ;
break;
}
}
if(smm1<=0){
cout<<"\n========================================================================================"<<endl;
cout<<"你赢了!"<<endl;
DWW++;
Dw_1++;
if(Dw=="青铜"){
jbb+=50;
}
if(Dw!="青铜")
jbb+=100;
smm1=0;
if(Dw=="青铜"){
cout<<"获得:\n金币+"<<50<<endl;
}
if(Dw!="青铜"){
cout<<"获得:\n金币+"<<100<<endl;
}
// HH++;
// ff++;
cout<<"1.返回 2.匹配对手"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
if(bb==2){
goto ab;
}
}
}
}
}
}
//野 外 探 索
if(LC_chose==5){
while(1){
clean1();
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 野 外 探 索 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始探索 3.怪兽领主"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
while(1){
cout<<"\n=====================================第 "<<ff<<" 米==========================================="<<endl;
srand(time(0));
gg=rand()%4;
cout<<"\n "<<gw[gg]<<" "<<endl;
sm1_=sm1_1;
smm=70+15*HH;
zdl=30+10*HH;
cout<<"生命值:"<<smm<<endl;
cout<<"战斗力:"<<zdl<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始 "<<endl;
cin>>aa;
while(aa<=0||aa>2){
if(aa<=0||aa>2){
cout<<"输入错误,请重新输入!\n"<<endl;
}
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始 "<<endl;
cin>>aa;
}
if(aa==1){
break;
}
if(aa==2){
while(1){
if(sm1_>0){
cout<<"\n-------------------------------------玩家对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<sm1_<<endl;
cout<<"释放技能:1.火球 2.拳击";
if(ft==1){
cout<<" 3.焚天";
}
cout<<endl;
cin>>aa;
if(aa==1){
cout<<"伤害:"<<sh_xhl1<<endl;
smm-=sh_xhl1;
}
if(aa==2){
cout<<"伤害:"<<sh_xhl2<<endl;
smm-=sh_xhl2;
}
if(ft==1&&aa==3){
cout<<"伤害:"<<sh_xhl3<<endl;
smm-=sh_xhl3;
}
}
cout<<"\n----------------------------------------------------------------------------------------\n"<<endl;
if(smm>0&&sm1_>0){
cout<<"\n-------------------------------------敌方对战-------------------------------------------"<<endl;
cout<<"食人草\n"<<"生命值:"<<smm <<endl;
cout<<"释放技能:毒液\n伤害:"<<sh_src1<<endl;
sm1_-=sh_src1;
}
if(sm1_<=0&&smm>0){
cout<<"\n========================================================================================"<<endl;
cout<<"你输了!"<<endl;
sm1_=0;
cout<<"1.返回\n";
cin>>aa;
if(aa==1){
clean1() ;
break;
}
}
if(smm<=0){
cout<<"\n========================================================================================"<<endl;
cout<<"你赢了!"<<endl;
jbb+=10+1*HH;
jyy+=5+1*HH;
smm=0;
cout<<"获得:\n金币+"<<10+1*HH<<endl<<"经验值+"<<5+1*HH<<endl;
HH++;
ff++;
cout<<"1.继续前进"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
}
}
}
}
}
if(aa==3){
while(1){
clean1();
sm1_=sm1_b;
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 怪 兽 领 主 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.普通领主 3.宇宙领主"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
if(bb==2){
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.金角巨兽 2.黑湖藤"<<endl;
cin>>bb;
if(bb==1){
clean1();
cout<<"\n========================================================================================\n"<<endl;
cout<<"金角巨兽\n生命值:"<<Sm_p1<<"\n攻击力:"<<Sh_p1<<endl;
cout<<"\n========================================================================================\n"<<endl;
while(1){
if(Sm_p1>0){
cout<<"\n-------------------------------------玩家对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<sm1_<<endl;
cout<<"释放技能:1.火球 2.拳击";
if(ft==1){
cout<<" 3.焚天";
}
cout<<endl;
cin>>aa;
if(aa==1){
cout<<"伤害:"<<sh_xhl1<<endl;
Sm_p1-=sh_xhl1;
}
if(aa==2){
cout<<"伤害:"<<sh_xhl2<<endl;
Sm_p1-=sh_xhl2;
}
if(ft==1&&aa==3){
cout<<"伤害:"<<sh_xhl3<<endl;
Sm_p1-=sh_xhl3;
}
}
cout<<"\n----------------------------------------------------------------------------------------\n"<<endl;
if(sm1_>0&&Sm_p1){
cout<<"\n-------------------------------------领主对战-------------------------------------------"<<endl;
cout<<"金角巨兽\n生命值:"<<Sm_p1<<endl;
cout<<"释放技能:斩空\n伤害:"<<Sh_p1<<endl;
sm1_-=Sh_p1;
}
if(sm1_<=0&&Sm_p1>0){
cout<<"\n========================================================================================"<<endl;
cout<<"你输了!"<<endl;
sm1_=0;
cout<<"1.返回\n";
cin>>aa;
if(aa==1){
clean1() ;
break;
}
}
if(Sm_p1<=0){
cout<<"\n========================================================================================"<<endl;
cout<<"你赢了!"<<endl;
jbb+=750;
jyy+=350;
cout<<"获得:\n金币+"<<750<<endl<<"经验值+"<<350<<endl;
cout<<"1.返回"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
}
}
}
}
}
}
}
}
//数据
if(LC_chose==6){
clean1();
cout<<"1.保存数据 2.清除数据 3.不保存数据 4.返回"<<endl;
cin>>aa;
if(aa==1){
ofstream is;
is.open("灵 宠 世 界.txt",ios::out);
is <<LC_num<<" "<<xhl_dj<<" "<<xhl_zdl<<" " <<LC_mj<<" "<<DWW<<" " <<Dw_1<<" "<<djj<<" "<<Dw_2<<" " <<sm1<<" "<<sh_xhl1<<" "<<sm_1<<" " <<sh_xhl2<<" "<<sh_src1<<" "<<dd<<" "<<ee<<" "<<jbb<<" "<<djj<<" "<<jyy<<" "<<HH<<" "<<sm1_b<<" "<<ff<<" "<<jj<<" "<<sw<<" "<<sw_nr<<" "<<kk<<" "<<xhl1<<" "<<xhl2<<" "<<nn<<" "<<oo<<" "<<bj<<" "<<xhl3<<" "<<sh_xhl3<<" "<<pp; //写入 cin>>
is.close();// 关闭文件,可不写 =1,=1,nn=100,oo=50
cout<<"数据保存成功!\n";
clean();
// qt();
break;
}
if(aa==2){
cout<<"提示:是否确认要删除所有数据\n\n1.返回 2.确认\n";
cin>>aa;
if(aa==1){
continue;
}
if(aa==2){
ofstream outfile("灵 宠 世 界.txt",ios::trunc);//灵 宠 世 界.txt里面的内容会被清空
}
clean1();
//qt();
break;
}
if(aa==3){
clean1();
// qt();
break;
}
if(aa==4){
clean1();
continue;
}
}
if(LC_chose==7) {
while(1){
system("cls");
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 商 店 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.食物 3.秘籍 4.药水 5.装备 "<<endl;
cin>>aa;
cout<<"\n========================================================================================"<<endl;
if(aa==1){
clean1();
break;
}
if(aa==2){
while(1){
cout<<"1.返回 2.牛肉 60金币 3.苹果 20金币 4.金苹果 50金币 5.小零食10金币 6.满血盛宴 140金币"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
if(jbb<60){
cout<<"金币不足!"<<endl;
}
if(jbb>=60){
sw++;
jbb-=60;
sw_nr++;
cout<<"购买成功!"<<endl;
}
clean();
}
if(aa==6){
if(jbb<140){
cout<<"金币不足!"<<endl;
}
if(jbb>=140){
sw++;
jbb-=140;
sw_mxsy++;
cout<<"购买成功!"<<endl;
}
clean();
}
}
}
}
}
if(LC_chose==8){
while(1){
ac:
system("cls");
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 设 置 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回\n\n2.寻找作者(作者主页)\n\n3.背景颜色\n"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
system("start https://blog.csdn.net/m0_66072738?type=blog");//打开网站
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回"<<endl;
cin>>aa;
if(aa==1){
goto ac;
}
}
if(aa==3){
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.灰色 3.黑白 4.黄色 5.蓝色"<<endl;
cin>>aa;
if(aa==1){
goto ac;
}
if(aa==2){
system("color F1");
bj=2;;
}
if(aa==3){
system("color 07");
bj=3;
}
if(aa==4){
system("color E1");
bj=4;
}
if(aa==5){
system("color 97");
bj=5;
}
}
}
}
}
二、完整代码
代码:
#include<bits/stdc++.h>
#include <windows.h>
#include <ctime>
using namespace std;
#define scta(a) SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE),a);
void Duan();
void DJJ();
void dW_1();
void dw_();
void DQ_sj();
void dW_2();
void PM_zzl();
void LC_xhl_dj();
void clean();
string nandu();
void xy(int y,int x);
void xunhuan();
void shuju();
void shuju1();//数据
void moban();//模板
void shuju2();
void duan();
void qt();
void SJ();
void DJ_();
void DW_();
void DW_1();
void DQ_sj1();
void clean1();
void LCSJ();
long long LC_chose,LC_num=1, LC_zzl=0,LC_zzl_pm=0, LC_num_pm=0,xhl_dj=1,xhl_zdl=100,LC_mj,aa,bb,sm1=150,cc,sh_xhl1=100,sm_1,sh_xhl2=50,sh_src1=30,dd=70,f,sm1_1,smm1,zdl1,Sm_p1=8000,Sh_p1=2200;
long long ee=1,jbb=0,djj=0,jyy,Dw_2,DWW,Dw_1,ff,gg,smm=10,zdl,sm1_,sm1_b=150,sw,sw_nr,kk=20,xhl1=1,xhl2=1,nn=100,oo=50,bj=4,xhl3=1,sh_xhl3=200,pp=150,sw_mxsy;
long long HH=1,jj=50,ll,mm;
long long h_ly,ft;
string Name,xhl_xt="幼兽",Dw="青铜";
string gw[]={"食人草","尖牙怪","僵尸","丧尸"};
int dw,sj,wj,hh=1,shu=0,ying,ping;
long long name1,Chose,a,b,c,cishu,xuanze,cf_a,cf_b,jf_a,jf_b,jj_a,jj_b,jj_d,chuf_a,chuf_b,cc_a,cc_b,cc_d,jjcc_a,jjcc_b,jjcc_c,jjcc_d,jjcc_e,xiangzi_a,xiangzi_b,xiangzi_c,xiangzi_d,xiangzi_e,duqu_a,yaoshi;
long long score,DJ,JY;
double score_pj;
string name,CHOSE,DW="青铜";
string zd();//战斗结果
int sm=100,je=100,nl=18,dj=1,jy=0,gj=0;//生命力,饥饿度,年龄 ,等级, 经验,攻击力
int chose_A7,SJ_xh,B_wd,B_gm; //A7 //SJ_xh<<name<<score<<JY<<B_wd<<B_gm
int A,dw_1,A1,dw_2;
char chose;
using namespace std;
int main(){
//qt(); //临时关闭
DQ_sj1();
while(1){
B:
system("color E1");
cout<<"===================================================================\n\n\n 多功能大厅\n\n\n===================================================================\n";
srand(time(0));
int renshu=rand()%30+1;
cout<<setw(115)<<right<<"当前在线人数:"<<renshu<<endl;
DW_();
if(name1==0){
cout<<"名字:";
cin>>name;
name1++;
clean1();
goto B;
}
if(name1!=0){
cout<<"玩家:"<<name<<endl;
}
cout<<endl;
cout<<"-------------------------------------------------------------------\n\n";
cout<<"请选择: A.多功能主厅 B.小程序大厅 C.关于作者 D.退出游戏 \n\n E.灵宠世界"<<endl;
cin>>CHOSE;
if(CHOSE=="E"){
LCSJ();
}
//
cout<<"-------------------------------------------------------------------\n\n";
if(CHOSE=="A"){
while(1){
clean1();
system("color E1");
DJ_();
DW_1();
cout<<"玩家:"<<name<<endl;
duan();
cout<<"等级:"<<DJ<<endl;
cout<<"经验值:"<<JY<<endl ;
cout<<"===================================================================\n";
cout<<"请选择:1.混合运算测试 2.剧情发展——森林失忆 3.抓小鬼 4.猜拳游戏 \n 5.返回 6.商店 持续更新中..."<<endl; //A
cin>>Chose;
//1
if(Chose==1){
system("color F1");
cout<<"玩家:"<<name;
while(1){
cout<<"禁止输入文字!!!\n若暂停,输入大于等于100000的数(注:除法计算保留整数)"<<endl;
cout<<"请选择1.加法 2.减法 3.加减混合 4.乘法 5.除法 6.乘除混合 7.加减乘除混合 8.退出"<<endl;
cin>>xuanze;
yaoshi=5;
if (xuanze==1)
{
while(yaoshi>0){
yaoshi++;
cishu++;
shuju();
srand(time(0));
xiangzi_a=a=rand()%100;
xiangzi_b=b=rand()%100;
nandu();
cout<<"难度:"<<nandu()<<endl;
cout<<a<<"+"<<b<<"=";
cin>>c;
if(c>=100000){
yaoshi=0;
Sleep(1100);system("cls");
}
if(c!=a+b){
cout<<"错误!\n"<<"正确答案为:"<<a+b<<endl;
Sleep(1100);system("cls");
}
else{
cout<<"正确"<<endl;
score++;
Sleep(1100);system("cls");
}
}
}
if (xuanze==2){
yaoshi++; //减
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=jf_a=rand()%100;
xiangzi_b=jf_b=rand()%100;
shuju();
cout<<"难度:"<<nandu()<<endl;
cout<<jf_a<<"-"<<jf_b<<"=";
cin>>c;
if(c>=100000){
//cishu=0;
yaoshi=0;
Sleep(1100);system("cls");
}
if(c!=jf_a-jf_b){
cout<<"错误!\n"<<"正确答案为:"<<jf_a-jf_b<<endl;
cout<<"分数:"<<score<<endl<<endl;
Sleep(1100);system("cls");
}
else{
cout<<"正确"<<endl;
score++;
//cout<<"分数:"<<score<<endl<<endl;
Sleep(1100);system("cls");
}
}
//break;
}
if (xuanze==3){
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=jj_a=rand()%100;
xiangzi_b=jj_b=rand()%100;
xiangzi_c=jj_d=rand()%100;
shuju();
//cout<<"次数:"<<cishu<<endl;
cout<<jj_a<<"-"<<jj_b<<"+"<<jj_d<<"=";
cin>>c;
if(c>=100000){//
//cishu=0;
yaoshi=0;
clean();
break;
}
if(c!=jj_a-jj_b+jj_d){//
cout<<"错误!\n"<<"正确答案为:"<<jj_a-jj_b+jj_d<<endl;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
else{//
cout<<"正确"<<endl;
score++;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
}
//break;
}
if (xuanze==4){
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=cf_a=rand()%100;
xiangzi_b=cf_b=rand()%100;
shuju();
//cout<<"次数:"<<cishu<<endl;
cout<<cf_a<<"*"<<cf_b<<"=";
cin>>c;
if(c>=100000){
//cishu=0;
yaoshi=0;
clean();
break;
}
if(c!=cf_a*cf_b){
cout<<"错误!\n"<<"正确答案为:"<<cf_a*cf_b<<endl;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
}
// break;
}
if (xuanze==5){
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=chuf_a=rand()%100;
xiangzi_b=chuf_b=rand()%100;
shuju();
//cout<<"次数:"<<cishu<<endl;
cout<<chuf_a<<"/"<<chuf_b<<"=";
cin>>c;
if(c>=100000){
//cishu=0;
yaoshi=0;
clean();
// break;
}
if(c!=chuf_a/chuf_b){
cout<<"错误!\n"<<"正确答案为:"<<chuf_a/chuf_b<<endl;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
}
// break;
}
if (xuanze==6){
while(yaoshi>0){
cishu++;
srand(time(0));
xiangzi_a=cc_a=rand()%100;
xiangzi_b=cc_b=rand()%100;
xiangzi_c=cc_d=rand()%100;
//cout<<"次数:"<<cishu<<endl;
shuju();
cout<<cc_a<<"*"<<cc_b<<"/"<<cc_d<<"=";
cin>>c;
if(c>=100000){
//cishu=0;
yaoshi=0;
clean();
// break;
}
if(c!=cc_a*cc_b/cc_d){
cout<<"错误!\n"<<"正确答案为:"<<cc_a*cc_b/cc_d<<endl;
//cout<<"分数:"<<score<<endl<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
clean();
}
}
}
if (xuanze==7){
while(yaoshi>0){
int sj_a;
cishu++;
srand(time(0));
xiangzi_a=jjcc_a=rand()%100;
xiangzi_b=jjcc_b=rand()%100;
xiangzi_c=jjcc_c=rand()%100;
xiangzi_d=jjcc_d=rand()%100;
xiangzi_e=jjcc_e=rand()%100;
sj_a=rand()%12;
if(sj_a==1){
cout<<jjcc_a<<"+"<<jjcc_b<<"-"<<jjcc_c<<"*"<<jjcc_d<<"/"<<jjcc_e<<"=";
cin>>c;
if(c>=100000){
yaoshi=0;
clean();
}
if(c!=jjcc_a+jjcc_b-jjcc_c*jjcc_d/jjcc_e){
cout<<"错误!\n"<<"正确答案为:"<<jjcc_a+jjcc_b-jjcc_c*jjcc_d/jjcc_e<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
clean();
}
}
if(sj_a==2){
cout<<jjcc_a<<"-"<<jjcc_b<<"+"<<jjcc_c<<"*"<<jjcc_d<<"/"<<jjcc_e<<"=";
cin>>c;
if(c>=100000){
yaoshi=0;
clean();
}
if(c!=jjcc_a-jjcc_b+jjcc_c*jjcc_d/jjcc_e){
cout<<"错误!\n"<<"正确答案为:"<<jjcc_a-jjcc_b+jjcc_c*jjcc_d/jjcc_e<<endl;
clean();
}
else{
cout<<"正确"<<endl;
score++;
clean();
}
}
}
}
if(xuanze==8){
break;
}
}
}
//2
if(Chose==2) {
system("color F1");
shuju1();
cout<<"输入C,可退出!(下同)\n砰!你失去了记忆,躺在了一个深林里,刺眼的阳关照着你......\n"<<"请选择:A.起身,走向密林 B.原地不动"<<endl; //选择1
cin>>chose;
if(chose=='A'){
je-=5;
//Sleep(1000);
system("cls");
shuju1();
cout<<"你看到了一只野猪,\nA.拿起地上的木棍和石头,向野猪杀去 B.快速离开"<<endl; //选择2
cin>>chose;
if(chose=='A')
{
//Sleep(1100);
system("cls");
gj=20;
shuju1();
//cout<<"第一回合:\n";
//cout<<zd();
int sj;//随机
srand(time(0));
sj=rand()%3+1;
if(sj=1){
jy+=30,sm-=15,je-=10,gj-=10;
cout<<"你赢了!\n"<<"A.向前走 B.原地等待";
cin>>chose;
//Sleep(1100);
system("cls");
shuju1();
if(chose=='A'){
system("cls");
shuju1();
cout<<"前方豁然一片陆地呈现......\n"<<"一群土著人发现了你,向你走来\n"<<"A.逃跑 B.尝试与他们交流\n";
cin>>chose;
system("cls");
if(chose='A'){
}
if(chose=='B'){
shuju1();
cout<<"他们用手语告诉了你,他们需要你的帮助!\n";
cout<<"A.同意 B.不同意\n";
cin>>chose;
system("cls");
if(chose='A'){
shuju1();
cout<<"土著人A:哦,兄弟!谢谢你,我们的房屋被洪水冲毁了,让我们一起修好吧!\n";
cout<<"A.好的,但我要休息一下 B.这就开始吧!\n";
cin>>chose;
system("cls");
if(chose='A'){
sm=100;je=100;
shuju1();
cout<<"A.走吧! B.我需要武器!";
cin>>chose;
system("cls");
if(chose='A'){
sm-=20;je-=55;jy+=30;
shuju1();
cout<<"修好房屋后,疲惫不堪......\n"<<"土著人A:谢谢你,来休息一下吧!\n"<<"A.好 B.不了,我还要赶路\n";
moban();
//cin>>chose;
//system("cls");
if(chose='A'){
sm=100;je=100;
shuju1();
cout<<"你在这里休息了一夜......\n翌日,你再次进入森林,他们告诉你,在哀斯特山谷有个老人,他也许可以帮助你恢复记忆"<<"A.向山谷出发! B.去商店"<<endl;
cin>>chose;
system("cls");
if(chose='A'){
shuju1();
cout<<"天上闪过一道雷,你被劈死啦!\n";
moban();
}
}
}
if(chose='B'){
shuju1();
cout<<"天上闪过一道雷,你被劈死啦!\n";
//cin>>chose;
//system("cls");
}
}
if(chose='B'){
shuju1();
cout<<"天上闪过一道雷,你被劈死啦!";
//cin>>chose;
//system("cls");
}
}
if(chose='B'){
shuju1();
cout<<"天上闪过一道雷,你被劈死啦!";
}
}
}
if(chose='B'){
shuju1();
cout<<"天上闪过一道雷,你被劈死啦!";
}
}
else if(sj=2){
//Sleep(1100);
system("cls");
sm-=50,je-=30,gj-=20;
cout<<"你输了!\n"<<"A.向前走 B.再杀!\n";
shuju1();
cout<<"天上闪过一道雷,你被劈死啦!\n";
}
}
}
if(chose=='B'){
//Sleep(1100);
system("cls");
cout<<"天空下起了雨,\n A.跑进深林,躲雨 B.原地不动" ;
if(chose='A'){
//Sleep(1100);
system("cls");
cout<<"你没站稳,摔倒在地,升天啦!\n\n";
} //选择3
}
if(chose=='C'){
continue;
}
}
//3
if(Chose==3){
long long xg_monum,xg_wjnum,xg_dnnum,xg_maxnum,aab;
string aaa;
system("color E1");
while(1){
aac:
cout<<"===================================================================\n\n";
cout<<" 抓小鬼 \n\n";
cout<<"===================================================================\n\n";
cout<<"===========================游戏规则================================\n\n" ;
cout<<"设置木偶的总数量和抽取木偶,其中一个为小鬼,抓到小鬼胜利\n(输入q,退出游戏; 输入b,可更换背景颜色)\n\n";
cout<<"===========================设置参数================================\n\n";
cout<<"木偶数量:";
cin>>aaa;
if(aaa=="q"){
break;
}
if(aaa=="b"){
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.灰色 3.黑白 4.黄色 5.蓝色"<<endl;
cin>>aab;
if(aab==1){
goto aac;
}
if(aab==2){
system("color F1");
}
if(aab==3){
system("color 07");
}
if(aab==4){
system("color E1");
}
if(aab==5){
system("color 97");
}
system("cls");
}
else{
stringstream ss;
ss<<aaa;
ss>>xg_monum;
while(xg_monum<=0){
if(xg_monum<=0){
cout<<"木偶数量要大于0\n"<<endl;
}
cout<<"木偶数量:";
cin>>xg_monum;
}
cout<<endl;
cout<<"每次抽取木偶的最大数量为:";
cin>>xg_maxnum;
while(xg_maxnum<=0){
if(xg_maxnum<=0){
cout<<"最大数量要大于0\n"<<endl;
}
cout<<"每次抽取木偶的最大数量为:";
cin>>xg_maxnum;
}
cout<<endl;
while(1){
cout<<"----------------------------玩家抽取-------------------------------\n" ;
cout<<"输入抽取木偶数量:";
cin>>xg_wjnum;
while(xg_wjnum>xg_maxnum||xg_wjnum<0){
if(xg_wjnum>xg_maxnum){
cout<<"超出范围!"<<endl;
cout<<"输入抽取木偶数量:";
cin>>xg_wjnum;
}
if(xg_wjnum<0){
cout<<"超出范围!"<<endl;
cout<<"输入抽取木偶数量:";
cin>>xg_wjnum;
}
}
xg_monum-=xg_wjnum;
if(xg_monum<=0){
cout<<"\n剩余木偶数量:0"<<endl;
cout<<"----------------------------对战结果-------------------------------\n\n";
cout<<"你胜利!\n";
Sleep(1800);
system("cls");
break;
}
cout<<"\n剩余木偶数量:" <<xg_monum<<endl;
cout<<"----------------------------电脑抽取-------------------------------\n\n" ;
srand(time(0));
if(xg_monum%xg_maxnum!=0){
xg_dnnum=rand()%xg_maxnum+1;
xg_monum-=xg_dnnum;
cout<<"电脑抽取木偶数量:"<<xg_dnnum;
cout<<endl;
if(xg_monum<=0){
cout<<"\n剩余木偶数量:0"<<endl;
cout<<"----------------------------对战结果-------------------------------\n\n";
cout<<"电脑胜利!\n";
Sleep(1800);
system("cls");
break;
}
cout<<"\n剩余木偶数量:" <<xg_monum<<endl;
}
if(xg_monum%xg_maxnum==0){
xg_dnnum=xg_maxnum;
xg_monum-=xg_dnnum;
cout<<"电脑抽取木偶数量:"<<xg_dnnum;
cout<<endl;
if(xg_monum<=0){
cout<<"\n剩余木偶数量:0"<<endl;
cout<<"----------------------------对战结果-------------------------------\n\n";
cout<<"电脑胜利!\n";
Sleep(1800);
system("cls");
break;
}
cout<<"\n剩余木偶数量:" <<xg_monum<<endl;
}
}
}
}
}
//4.猜拳游戏
if(Chose==4) {
system("color 97");
string name,dn;
cout<<"=============================================\n\n 猜拳游戏\n\n=============================================\n\n" ;
// cout<<"名字:"<<name;
//cin>>name;
cout<<endl;
while(1){
cout<<"=============================================\n\n"<<" 第 "<<hh<<" 回合\n\n"<<"---------------------------------------------\n";
shuju2();
cout<<"1.石头 2.剪刀 3.布 4.退出\n\n你的选择:";
cin>>wj;
if(wj!=1&&wj!=2&&wj!=3&&wj!=4){
cout<<"输入错误!";
break;
}
if(wj==4){
//cout<<"---------------------------------------------\n\n
clean();
break;
}
cout<<endl;
srand(time(0));
sj=rand()%3+1;
if(sj==1) {
dn="石头";
cout<<"电脑:"<<dn<<endl<<endl;
cout<<"---------------------------------------------\n\n";
}
if(sj==2){
dn="剪刀";
cout<<"电脑:"<<dn<<endl<<endl;
cout<<"---------------------------------------------\n\n";
}
if(sj==3){
dn="布";
cout<<"电脑:"<<dn<<endl<<endl;
cout<<"---------------------------------------------\n\n";
}
if(dn=="石头"&&wj==1){
cout<<"平局\n";
ping++;
}
if(dn=="石头"&&wj==2){
cout<<"你输了\n";
shu++;
}
if(dn=="石头"&&wj==3){
cout<<"你赢了\n";
ying++;
score++;
JY++;
//DJ_a++;
}//
if(dn=="剪刀"&&wj==1){
cout<<"你赢了\n";
ying++;
score++;
JY++;
//DJ_a++;
}
if(dn=="剪刀"&&wj==2){
cout<<"平局\n";
ping++;
}
if(dn=="剪刀"&&wj==3){
cout<<"你输了\n";
shu++;
}//
if(dn=="布"&&wj==1){
cout<<"你输了\n";
shu++;
}
if(dn=="布"&&wj==2){
cout<<"你赢了\n";
ying++;
score++;
JY++;
//DJ_a++;
}
if(dn=="布"&&wj==3){
cout<<"平局\n";
ping++;
}
hh++;
Sleep(2000);system("cls");
}
}//
//6
if(Chose==5){
clean1();
break;
}
if(Chose==6){
cout<<"===================================================================\n\n";
cout<<" 商店 \n\n";
cout<<"===================================================================\n\n";
cout<<"1.改名牌 5金币 | 2.退出 "<<endl;
cin>>chose_A7;
// if(chose_A7==1){
// if(score<10){
// cout<<"金币不足!";
// }
// if(score>=10){
// cout<<"购买成功";
// score-=10;
// B_wd++;
// }
// }
if(chose_A7==1){
if(score<5){
cout<<"金币不足!";
}
if(score>=5){
cout<<"购买成功";
score-=5;
B_gm++;
}
}
}
if(chose_A7==2){
clean();
continue;
}
}
// A
}
//
if(CHOSE=="B"){
int xz;
cout<<"请选择:1.测属于你的BMI 持续更新中......"<<endl;
cin>>xz;
if(xz==1){
float tall,weight,bmi;
cout<<"请输入身高(m):";
cin>>tall;
cout<<endl<<"请输入体重(kg):";
cin>>weight;
bmi=weight/tall/tall;
cout<<endl<<"您的BMI值为:"<<bmi<<endl;
if(bmi<18.5){
cout<<"偏瘦\n\n";
}
if(18.5<bmi&&bmi<24){
cout<<"正常\n\n";
}
if(24<=bmi&&bmi<28){
cout<<"超重\n\n";
}
if(bmi>=28){
cout<<"肥胖\n\n";
}
system("Pause");
clean1();
}
}
//B
if(CHOSE=="C"){
cout<<"1.返回 2.寻找作者(作者主页)"<<endl;
cin>>Chose;
if(Chose==1){
clean1();
continue;
}
if(Chose==2) {
system("start https://blog.csdn.net/m0_66072738?type=blog");//打开网站
}
}
if(CHOSE=="D"){
clean1();
cout<<"1.保存数据 2.清除数据 3.不保存数据 4.返回"<<endl;
cin>>aa;
if(aa==1){
ofstream is;
is.open("多功能大厅.txt",ios::out);
is <<name<<" "<<score<<" "<<JY<<" "<<B_wd<<" "<<B_gm<<" "<<dw<<" "<<dw_1<<" "<<DJ<<" "<<dw_2<<" "<<name1; //写入
is.close();// 关闭文件,可不写 =1,=1,nn=100,oo=50
cout<<"数据保存成功!\n";
clean();
qt();
break;
}
if(aa==2){
cout<<"提示:是否确认要删除所有数据\n\n1.返回 2.确认\n";
cin>>aa;
if(aa==1){
continue;
}
if(aa==2){
ofstream outfile("多功能大厅.txt",ios::trunc);//灵 宠 世 界.txt里面的内容会被清空
}
clean1();
qt();
break;
}
if(aa==3){
clean1();
qt();
break;
}
if(aa==4){
clean1();
continue;
}
}
}
return 0;
}
void LC_xhl_dj(){
if(xhl_dj<=3){ //
cout<<"小火龙\n";
}
if(xhl_dj>3&&xhl_dj<10){ //
cout<<"大火龙\n";
}
if(xhl_dj>=10){ //
cout<<"焚天巨龙\n";
ft=1;
}
if(xhl_dj>=18){ //
cout<<"焚天神龙\n";
h_ly=1;
}
}
void PM_zzl(){
if(LC_zzl>=100&&LC_zzl<150){
srand(time(0));
LC_zzl_pm=rand()%9100+90000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=150&&LC_zzl<=500){
srand(time(0));
LC_zzl_pm=rand()%9000+80000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=500&&LC_zzl<=900){
srand(time(0));
LC_zzl_pm=rand()%9000+70000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=900&&LC_zzl<=1300){
srand(time(0));
LC_zzl_pm=rand()%9000+60000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=1300&&LC_zzl<=1700){
srand(time(0));
LC_zzl_pm=rand()%9000+50000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=1700&&LC_zzl<=2100){
srand(time(0));
LC_zzl_pm=rand()%9000+40000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=2100&&LC_zzl<=2500){
srand(time(0));
LC_zzl_pm=rand()%9000+30000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=2500&&LC_zzl<=3500){
srand(time(0));
LC_zzl_pm=rand()%9000+20000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=3500&&LC_zzl<=4500){
srand(time(0));
LC_zzl_pm=rand()%9000+10000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=4500&&LC_zzl<=5500){
srand(time(0));
LC_zzl_pm=rand()%1000+9000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=5500&&LC_zzl<=6500){
srand(time(0));
LC_zzl_pm=rand()%1000+8000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=6500&&LC_zzl<=8000){
srand(time(0));
LC_zzl_pm=rand()%1000+7000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=8000&&LC_zzl<=10000){
srand(time(0));
LC_zzl_pm=rand()%1000+6000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=10000&&LC_zzl<=12000){
srand(time(0));
LC_zzl_pm=rand()%1000+5000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=12000&&LC_zzl<=14000){
srand(time(0));
LC_zzl_pm=rand()%1000+4000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=14000&&LC_zzl<=16000){
srand(time(0));
LC_zzl_pm=rand()%1000+3000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=16000&&LC_zzl<=18000){
srand(time(0));
LC_zzl_pm=rand()%1000+2000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=18000&&LC_zzl<=20000){
srand(time(0));
LC_zzl_pm=rand()%1000+1000;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=20000&&LC_zzl<=22000){
srand(time(0));
LC_zzl_pm=rand()%500;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=22000&&LC_zzl<=24000){
srand(time(0));
LC_zzl_pm=rand()%200;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>=24000&&LC_zzl<=26000){
srand(time(0));
LC_zzl_pm=rand()%100;
cout<<LC_zzl_pm<<endl;
}
if(LC_zzl>26000){
LC_zzl_pm=1;
cout<<LC_zzl_pm<<endl;
}
}
void dW_2(){
if(Dw=="青铜"&&Dw_1==3){
DWW=3;
}
if(Dw=="白银"&&Dw_1==8){
DWW=4;
}
if(Dw=="黄金"&&Dw_1==14){
DWW=5;
}
if(Dw=="铂金"&&Dw_1==21){
DWW=6;
}
if(Dw=="钻石"&&Dw_1==29){
DWW=7;
}
if(Dw=="星耀"&&Dw_1==38){
DWW=8;
}
if(Dw=="王者"&&Dw_1==48){
DWW=9;
}
if(Dw=="星光"&&Dw_1==59){
DWW=10;
}
}
void DQ_sj(){ //>>>>
vector<string>test;
ifstream os;
os.open("灵 宠 世 界.txt",std::ios::in);
string put;
while (getline(os,put)){
}
stringstream ss;
ss<<put;
string temp;
while(getline(ss,temp,' '))
test.push_back(temp); //向量
stringstream sss,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24,s25,s26,s27,s28,s29,s30,s31,s32,s33;
for(int i=0;i<test.size();i++){
if(i==0){
sss<<test[i];
sss>>LC_num;
}
if(i==1){
s1<<test[i];
s1>>xhl_dj;
}
if(i==2){
s2<<test[i];
s2>>xhl_zdl;
}
if(i==3){
s3<<test[i];
s3>>LC_mj;
}
if(i==4){
s4<<test[i];
s4>>DWW; //>>>>>>>>>>>>>>
}
if(i==5){
s5<<test[i];
s5>>Dw_1;
}
if(i==6){
s6<<test[i];
s6>>djj;
}
if(i==7){
s7<<test[i];
s7>>Dw_2;
}
if(i==8){
s8<<test[i];
s8>>sm1;
}
if(i==9){
s9<<test[i];
s9>>sh_xhl1; //sm_1
}
if(i==10){
s10<<test[i];
s10>>sm_1;
}
if(i==11){
s11<<test[i];
s11>>sh_xhl2;
}
if(i==12){
s12<<test[i];
s12>>sh_src1;
}
if(i==13){
s13<<test[i];
s13>>dd;
}
if(i==14){
s14<<test[i];
s14>>ee;
}
if(i==15){
s15<<test[i];
s15>>jbb;
}
if(i==16){
s16<<test[i];
s16>>djj;
}
if(i==17){
s17<<test[i];
s17>>jyy;
}
if(i==18){
s18<<test[i];
s18>>HH;
}
if(i==19){
s19<<test[i];
s19>>sm1_b;
}
if(i==20){
s20<<test[i];
s20>>ff;
}
if(i==21){
s21<<test[i];
s21>>jj;
}
if(i==22){
s22<<test[i];
s22>>sw;
}
if(i==23){
s23<<test[i];
s23>>sw_nr;
}
if(i==24){
s24<<test[i];
s24>>kk;
}
if(i==25){
s25<<test[i];
s25>>xhl1;
}
if(i==26){
s26<<test[i];
s26>>xhl2;
}
if(i==27){
s27<<test[i];
s27>>nn;
}
if(i==28){
s28<<test[i];
s28>>oo;
}
if(i==29){
s29<<test[i];
s29>>bj;
}
if(i==30){
s30<<test[i];
s30>>xhl3;
}
if(i==31){
s31<<test[i];
s31>>sh_xhl3;
}
if(i==32){
s32<<test[i];
s32>>pp;
}
if(i==33){
s33<<test[i];
s33>>sw_mxsy;
}
}
}
void Duan(){
if(Dw=="青铜"){
if(DWW==0){
cout<<"段位:"<<Dw;
cout<<" ☆ ☆ ☆\n";
}
if(DWW==1){
cout<<"段位:"<<Dw;
cout<<" ★ ☆ ☆\n";
// Dw_1++;
}
if(DWW==2){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ☆\n";
// Dw_1++;
}
if(DWW==3){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★\n";
// Dw_1++;
}
if(DWW>=4){
Dw="白银";
DWW-=4;
// Dw_1++;
}
}
if(Dw=="白银"){
if(DWW==0){
cout<<"段位:"<<Dw;
cout<<" ☆ ☆ ☆ ☆\n";
// Dw_1++;
}
if(DWW==1){
cout<<"段位:"<<Dw;
cout<<" ★ ☆ ☆ ☆\n";
// Dw_1++;
}
if(DWW==2){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ☆ ☆\n";
// Dw_1++;
}
if(DWW==3){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ☆\n";
// Dw_1++;
}
if(DWW==4){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★\n";
// Dw_1++;
}
if(DWW>=5){
Dw="黄金";
DWW-=5;
// Dw_1++;//9
}
}
if(Dw=="黄金"){
if(DWW==0){
cout<<"段位:"<<Dw;
cout<<" ☆ ☆ ☆ ☆ ☆\n";
// Dw_1++;
}
if(DWW==1){
cout<<"段位:"<<Dw;
cout<<" ★ ☆ ☆ ☆ ☆\n";
// Dw_1++;
}
if(DWW==2){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ☆ ☆ ☆\n";
// Dw_1++;
}
if(DWW==3){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ☆ ☆\n";
// Dw_1++;
}
if(DWW==4){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ☆\n";
// Dw_1++;
}
if(DWW==5){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★\n";
// //Dw_1++;
}
if(DWW>=6){
Dw="铂金";
DWW-=6;
//Dw_1++;//15
}
}
if(Dw=="铂金"){
if(DWW==0){
cout<<"段位:"<<Dw;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==1){
cout<<"段位:"<<Dw;
cout<<" ★ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==2){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==3){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==4){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ☆ ☆\n";
//Dw_1++;
}
if(DWW==5){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ☆\n";
//Dw_1++;
}
if(DWW==6){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★\n";
//Dw_1++;
}
if(DWW>=7){
Dw="钻石";
DWW-=7;
//Dw_1++;//22
}
}
if(Dw=="钻石"){
if(DWW==0){
cout<<"段位:"<<Dw;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==1){
cout<<"段位:"<<Dw;
cout<<" ★ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==2){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==3){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==4){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==5){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ☆ ☆\n";
//Dw_1++;
}
if(DWW==6){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ☆\n";
//Dw_1++;
}
if(DWW==7){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★\n";
//Dw_1++;
}
if(DWW>=8){
Dw="星耀";
DWW-=8;
//Dw_1++;//30
}
}
if(Dw=="星耀"){
if(DWW==0){
cout<<"段位:"<<Dw;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==1){
cout<<"段位:"<<Dw;
cout<<" ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==2){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==3){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==4){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==5){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==6){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ☆ ☆\n";
//Dw_1++;
}
if(DWW==7){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ☆\n";
//Dw_1++;
}
if(DWW==8){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★\n";
//Dw_1++;
}
if(DWW>=9){
Dw="王者";
DWW-=9;
//Dw_1++;//39
}
}
if(Dw=="王者"){
if(DWW==0){
cout<<"段位:"<<Dw;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==1){
cout<<"段位:"<<Dw;
cout<<" ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==2){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==3){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==4){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==5){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==6){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==7){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ☆ ☆\n";
//Dw_1++;
}
if(DWW==8){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ☆\n";
//Dw_1++;
}
if(DWW==9){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ★\n";
//Dw_1++;
}
if(DWW>=10){
Dw="星光";
DWW-=10;
//Dw_1++;//49
}
}
if(Dw=="星光"){
if(DWW==0){
cout<<"段位:"<<Dw;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==1){
cout<<"段位:"<<Dw;
cout<<" ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==2){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==3){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==4){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ☆ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==5){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ☆ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==6){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ☆ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==7){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ☆ ☆ ☆\n";
//Dw_1++;
}
if(DWW==8){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ☆ ☆\n";
//Dw_1++;
}
if(DWW==9){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ★ ☆\n";
//Dw_1++;
}
if(DWW==10){
cout<<"段位:"<<Dw;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n";
//Dw_1++;
}
if(DWW>=11){
Dw="宇宙";
DWW-=11;
//Dw_1++;//60
}
}
}
void dW_1(){
for(int q=0;q<=10;q++){
if(Dw_2/3>=1){
DWW++;
Dw_2-=3;
}
}
}
void DJJ(){
for(int j=0;j<=10;j++){
if(jyy/kk>=1){
djj++;
jyy-=kk;
Dw_2++;
kk+=5;
}
}
}
void dw_(){
if(Dw_1<4){
Dw="青铜";
}
if(Dw_1>=4&&Dw_1<9){
Dw="白银";
}
if(Dw_1>=9&&Dw_1<15){
Dw="黄金";
}
if(Dw_1>=15&&Dw_1<22){
Dw="铂金";
}
if(Dw_1>=22&&Dw_1<30){
Dw="钻石";
}
if(Dw_1>=30&&Dw_1<39){
Dw="星耀";
}
if(Dw_1>=39&&Dw_1<49){
Dw="王者";
}
if(Dw_1>=49&&Dw_1<60){
Dw="星光";
}
}
void clean1(){
system("cls");
}
void DQ_sj1(){ //>>>>
vector<string>test1;
ifstream oss;
oss.open("多功能大厅.txt",std::ios::in);
string put1;
while (getline(oss,put1)){
}
stringstream sss;
sss<<put1;
string temp1;
while(getline(sss,temp1,' '))
test1.push_back(temp1); //向量
stringstream ss1,ss2,ss3,ss4,ss5,ss6,ss7,ss8,ss9; // <<" "<<<<" "<<<<" "<<<<" "<<<<" "<<<<" "<<<<" "<<dw_2;
for(int ii=0;ii<test1.size();ii++){
if(ii==0){
name=test1[ii];
}
if(ii==1){
ss1<<test1[ii];
ss1>>score;
}
if(ii==2){
ss2<<test1[ii];
ss2>>JY;
}
if(ii==3){
ss3<<test1[ii];
ss3>>B_wd;
}
if(ii==4){
ss4<<test1[ii];
ss4>>B_gm; //>>>>>>>>>>>>>>
}
if(ii==5){
ss5<<test1[ii];
ss5>>dw;
}
if(ii==6){
ss6<<test1[ii];
ss6>>dw_1;
}
if(ii==7){
ss7<<test1[ii];
ss7>>DJ;
} //name<<" "<<score<<" "<<JY<<" "<<B_wd<<" "<<B_gm<<" "<<dw<<" "<<<<" "<<<<" "<<;
if(ii==8){
ss8<<test1[ii];
ss8>>dw_2;
}
if(ii==9){
ss9<<test1[ii];
ss9>>name1;
}
}
}
void LCSJ(){
DQ_sj();
dw_();
sm1_1=sm1_b;
if(bj==4){
system("color E1");
}
if(bj==2){
system("color F1");
}
if(bj==3){
system("color 07");
}
if(bj==5){
system("color 97");
}
clean1();
while(1){
dW_2();
LC_zzl=xhl_zdl;
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 灵 宠 世 界 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"======================================================================================================"<<endl;
DJJ();
dW_1();
cout<<"||";
Duan();
cout<<"||等级:"<<djj<<endl;
cout<<"||金币:"<<jbb<<endl;
cout<<"||灵宠:"<< LC_num<<endl;
cout<<"||经验值:"<<jyy<<endl;
cout<<"||总战力:"<< LC_zzl<<endl;
cout<<"||灵宠排名:";
if(LC_num==1){
srand(time(0));
LC_num_pm=rand()%9999+90000;
cout<<LC_num_pm<<endl;
}
cout<<"||总战力排名:";
PM_zzl();
cout<<"======================================================================================================"<<endl;
cout<<"|| || || || || || || || ||"<<endl;
cout<<"|| 1. 灵宠 || 2. 试炼塔 || 3. 对战 || 4. 背包 || 5.野外探索 || 6.退出 || 7.商店 || 8.设置 ||"<<endl;
cout<<"|| || || || || || || || ||"<<endl;
cin>>LC_chose;
if(LC_chose==1){
while(1){
system("cls");
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 灵 宠 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.宠物图鉴 3.";
LC_xhl_dj();
cin>>LC_chose;
cout<<"\n========================================================================================"<<endl;
if(LC_chose==1){
clean1();
break;
}
if(LC_chose==2){
while(1){
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 宠 物 图 鉴 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.小火龙 3.神木猿 ";
scta(236);
cout<<"4.九天寒冰鹿 "<<endl;
cin>>aa;
if(bj==4){
system("color E1");
}
if(bj==2){
system("color F1");
}
if(bj==3){
system("color 07");
}
if(aa==1){
break;
}
}
}
if(LC_chose==3){
while(1){
LC_xhl_dj();
xhl_zdl=sh_xhl1+sh_xhl2+sh_xhl3;
cout<<"等级:"<<xhl_dj<<endl;
cout<<"生命值:"<<sm1<<endl;
cout<<"战斗力:"<<xhl_zdl<<endl;
cout<<"========================================================================================\n"<<endl;
cout<<"1.返回 2.使用秘籍 3.技能 4.装备 5.食物 6.升级"<<endl;
cin>>LC_chose;
if(LC_chose==1) {
clean1();
break;
}
if(LC_chose==2) {
if(LC_mj==0){
cout<<"========================================================================================\n"<<endl;
cout<<"暂无秘籍可用!";
clean();
}
}
if(LC_chose==3) {
while(1){
cout<<"========================================================================================\n"<<endl;
cout<<"1.火球"<<xhl1<<"级 伤害"<<sh_xhl1<<endl;
cout<<"2.拳击"<<xhl2<<"级 伤害"<<sh_xhl2<<endl;
if(ft==1){
cout<<"3.焚天"<<xhl3<<"级 伤害"<<sh_xhl3<<endl;
}
cout<<"========================================================================================\n"<<endl;
cout<<"1.返回 2.升级技能" <<endl;
cin>>LC_chose;
if(LC_chose==1) {
clean1();
break;
}
if(LC_chose==2) {
while(1){
cout<<"========================================================================================\n"<<endl;
cout<<"1.返回 \n";
cout<<"2.火球 "<<nn<<"金币 "<<endl<<"3.拳击 "<<oo<<"金币"<<endl;
if(ft==1){
cout<<"4.焚天 "<<pp<<"金币"<<endl;
}
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
if(jbb<nn){
cout<<"金币不足"<<endl;
continue;
}
if(jbb>=nn){
cout<<"升级成功!"<<endl;
xhl1++;
sh_xhl1+=80;
jbb-=nn;
nn+=110;
}
}
if(aa==3){
if(jbb<mm){
cout<<"金币不足"<<endl;
continue;
}
if(jbb>=mm){
cout<<"升级成功!"<<endl;
xhl2++;
sh_xhl2+=50;
jbb-=oo;
oo+=80;
}
}
if(aa==4&&ft==1){
if(jbb<pp){
cout<<"金币不足"<<endl;
continue;
}
if(jbb>=pp){
cout<<"升级成功!"<<endl;
xhl3++;
sh_xhl3+=100;
jbb-=pp;
pp+=160;
}
}
}
}
}
}
if(LC_chose==4) {
cout<<"暂无装备可用!";
clean();
}
if(LC_chose==5) {
while(1){
if(sw==0){
cout<<"无食物可喂食"<<endl;
clean();
break;
}
if(sw>0){
cout<<"1.返回 ";
if(sw==1){
cout<<"2.";
if(sw_nr>0){
cout<<"牛肉 "<<sw_nr<<"个 使用1个"<<endl;
}
if(sw_mxsy>0){
cout<<"满血盛宴 "<<sw_mxsy<<"个 使用1个"<<endl;
}
cin>>aa;
if(aa==1){
break;
}
if(aa==2){
if(sm1==sm1_b){
cout<<"生命值已满!"<<endl;
}
if(sm1<sm1_b){
if(sw_nr>0) {
sw_nr--;
if(sw_nr==0){
sw--;
}
sm1+=100;
if(sm1>sm1_b){
sm1=sm1_b;
}
cout<<"已使用"<<endl;
}
if(sw_mxsy){
sw_mxsy--;
if(sw_mxsy==0){
sw--;
}
sm1=sm1_b;
cout<<"已使用"<<endl;
}
}
}
}
}
}
}
//升级
if(LC_chose==6) {
while(1){
cout<<"1.返回 2.升级 需要"<<jj<<"金币"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
if(jj>jbb){
cout<<"金币不足!"<<endl;
clean();
break;
}
if(jj<=jbb){
cout<<"升级成功!"<<endl;
xhl_dj++;
jbb-=jj;
if(xhl_dj<10){
jj+=80;
}
if(xhl_dj>=10){
jj+=110;
}
sm1_b+=50;
sm1_1=sm1=sm1_b;
sh_xhl1+=30;
sh_xhl2+=15;
sh_xhl2+=70;
clean();
}
}
}
}
}
}
}
}
//二
if(LC_chose==2){
while(1){
clean1();
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 试 炼 塔 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始试炼"<<endl;
cin>>aa;
cout<<"\n========================================================================================"<<endl;
if(aa==1){
clean1();
break;
}
if(aa==2){
while(1){
cout<<"\n=====================================第 "<<ee<<" 层===========================================\n"<<endl;
srand(time(0));
gg=rand()%4;
cout<<"\n "<<gw[gg]<<" "<<endl;
if(f>0){
dd+=20*ee;
sm_1=dd;
sh_src1+=25*ee;
f=0;
}
cout<<"生命值:"<<dd<<endl;
cout<<"技能:毒液 伤害:"<<sh_src1;
cout<<"\n----------------------------------------------------------------------------------------"<<endl;
cout<<"选择灵宠出战:";
if(LC_num==1){
cout<<"1.返回 2.小火龙"<<endl;
}
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
while(1){
if(sm1>0){
cout<<"\n-------------------------------------玩家对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<sm1<<endl;
cout<<"释放技能:1.火球 2.拳击";
if(ft==1){
cout<<" 3.焚天";
}
cout<<endl;
cin>>aa;
if(aa==1){
cout<<"伤害:"<<sh_xhl1<<endl;
sm_1-=sh_xhl1;
}
if(aa==2){
cout<<"伤害:"<<sh_xhl2<<endl;
sm_1-=sh_xhl2;
}
if(ft==1&&aa==3){
cout<<"伤害:"<<sh_xhl3<<endl;
sm_1-=sh_xhl3;
}
}
cout<<"\n----------------------------------------------------------------------------------------\n"<<endl;
if(sm_1>0&&sm1>0){
cout<<"\n-------------------------------------敌方对战-------------------------------------------"<<endl;
cout<<"食人草\n"<<"生命值:"<<sm_1 <<endl;
cout<<"释放技能:毒液\n伤害:"<<sh_src1<<endl;
sm1-=sh_src1;
}
if(sm1<=0&&sm_1>0){
cout<<"\n========================================================================================"<<endl;
cout<<"你输了!"<<endl;
sm1=0;
cout<<"1.返回\n";
cin>>aa;
if(aa==1){
clean1() ;
break;
}
}
if(sm_1<=0){
cout<<"\n========================================================================================"<<endl;
cout<<"你赢了!"<<endl;
jbb+=20*ee;
jyy+=10*ee;
cout<<"获得:\n金币+"<<20*ee<<endl<<"经验值+"<<10*ee<<endl;
ee++;
f++;
cout<<"1.下一关"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
}
}
}
}
}
}
}
if(LC_chose==3){
while(1){
system("cls");
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 对 战 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始匹配对手"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
//smm1,zdl1
if(aa==2){
ab:
cout<<"\n========================================================================================\n"<<endl;
cout<<"您的当前";
Duan();
cout<<"\n========================================================================================\n"<<endl;
Sleep(1000);
cout<<"匹配成功!"<<endl;
sm1_=sm1_b;
clean();
cout<<"\n========================================================================================\n"<<endl;
srand(time(0));
ll=rand()%9999+1000;
cout<<"游客_"<<ll<<endl;
srand(time(0));
mm=rand()%4+1;
if(mm<=3){
if(Dw=="青铜"){
smm1=150+50*mm;
zdl1=100+35*mm;
}
if(Dw=="白银"){
smm1=450+50*mm;
zdl1=350+35*mm;
}
if(Dw=="黄金"){
smm1=850+50*mm;
zdl1=550+35*mm;
}
if(Dw=="铂金"){
smm1=1000+50*mm;
zdl1=600+35*mm;
}
if(Dw=="钻石"){
smm1=2000+200*mm;
zdl1=1000+350*mm;
}
if(Dw=="星耀"){
smm1=3000+500*mm;
zdl1=1900+350*mm;
}
if(Dw=="王者"){
smm1=4000+500*mm;
zdl1=2900+350*mm;
}
if(Dw=="星光"){
smm1=5000+500*mm;
zdl1=4000+350*mm;
}
}
if(mm==4){
smm1=sm1_+655;
zdl1=xhl_zdl+700;
}
cout<<"生命值:"<<smm1<<endl;
cout<<"战斗力:"<<zdl1<<endl;
cout<<"\n========================================================================================\n"<<endl;
while(1){
if(sm1_>0){
cout<<"\n-------------------------------------玩家对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<sm1_<<endl;
cout<<"释放技能:1.火球 2.拳击";
if(ft==1){
cout<<" 3.焚天";
}
cout<<endl;
cin>>aa;
if(aa==1){
cout<<"伤害:"<<sh_xhl1<<endl;
smm1-=sh_xhl1;
}
if(aa==2){
cout<<"伤害:"<<sh_xhl2<<endl;
smm1-=sh_xhl2;
}
if(ft==1&&aa==3){
cout<<"伤害:"<<sh_xhl3<<endl;
smm1-=sh_xhl3;
}
}
cout<<"\n----------------------------------------------------------------------------------------\n"<<endl;
if(smm1>0&&sm1_>0){
cout<<"\n-------------------------------------"<<"游客_"<<ll<<"对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<smm1 <<endl;
cout<<"释放技能:火球\n伤害:"<<zdl1<<endl;
sm1_-=zdl1;
}
if(sm1_<=0&&smm1>0){
cout<<"\n========================================================================================"<<endl;
cout<<"你输了!"<<endl;
DWW--;
Dw_1--;
if(DWW<=0){
DWW=0;
}
if(Dw_1<=0){
Dw_1=0;
dw_();
dW_2();
}
dw_();
dW_2();
sm1_=0;
cout<<"1.返回\n";
cin>>aa;
if(aa==1){
clean1() ;
break;
}
}
if(smm1<=0){
cout<<"\n========================================================================================"<<endl;
cout<<"你赢了!"<<endl;
DWW++;
Dw_1++;
if(Dw=="青铜"){
jbb+=50;
}
if(Dw!="青铜")
jbb+=100;
smm1=0;
if(Dw=="青铜"){
cout<<"获得:\n金币+"<<50<<endl;
}
if(Dw!="青铜"){
cout<<"获得:\n金币+"<<100<<endl;
}
// HH++;
// ff++;
cout<<"1.返回 2.匹配对手"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
if(bb==2){
goto ab;
}
}
}
}
}
}
//野 外 探 索
if(LC_chose==5){
while(1){
clean1();
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 野 外 探 索 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始探索 3.怪兽领主"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
while(1){
cout<<"\n=====================================第 "<<ff<<" 米==========================================="<<endl;
srand(time(0));
gg=rand()%4;
cout<<"\n "<<gw[gg]<<" "<<endl;
sm1_=sm1_1;
smm=70+15*HH;
zdl=30+10*HH;
cout<<"生命值:"<<smm<<endl;
cout<<"战斗力:"<<zdl<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始 "<<endl;
cin>>aa;
while(aa<=0||aa>2){
if(aa<=0||aa>2){
cout<<"输入错误,请重新输入!\n"<<endl;
}
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.开始 "<<endl;
cin>>aa;
}
if(aa==1){
break;
}
if(aa==2){
while(1){
if(sm1_>0){
cout<<"\n-------------------------------------玩家对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<sm1_<<endl;
cout<<"释放技能:1.火球 2.拳击";
if(ft==1){
cout<<" 3.焚天";
}
cout<<endl;
cin>>aa;
if(aa==1){
cout<<"伤害:"<<sh_xhl1<<endl;
smm-=sh_xhl1;
}
if(aa==2){
cout<<"伤害:"<<sh_xhl2<<endl;
smm-=sh_xhl2;
}
if(ft==1&&aa==3){
cout<<"伤害:"<<sh_xhl3<<endl;
smm-=sh_xhl3;
}
}
cout<<"\n----------------------------------------------------------------------------------------\n"<<endl;
if(smm>0&&sm1_>0){
cout<<"\n-------------------------------------敌方对战-------------------------------------------"<<endl;
cout<<"食人草\n"<<"生命值:"<<smm <<endl;
cout<<"释放技能:毒液\n伤害:"<<sh_src1<<endl;
sm1_-=sh_src1;
}
if(sm1_<=0&&smm>0){
cout<<"\n========================================================================================"<<endl;
cout<<"你输了!"<<endl;
sm1_=0;
cout<<"1.返回\n";
cin>>aa;
if(aa==1){
clean1() ;
break;
}
}
if(smm<=0){
cout<<"\n========================================================================================"<<endl;
cout<<"你赢了!"<<endl;
jbb+=10+1*HH;
jyy+=5+1*HH;
smm=0;
cout<<"获得:\n金币+"<<10+1*HH<<endl<<"经验值+"<<5+1*HH<<endl;
HH++;
ff++;
cout<<"1.继续前进"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
}
}
}
}
}
if(aa==3){
while(1){
clean1();
sm1_=sm1_b;
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 怪 兽 领 主 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.普通领主 3.宇宙领主"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
if(bb==2){
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.金角巨兽 2.黑湖藤"<<endl;
cin>>bb;
if(bb==1){
clean1();
cout<<"\n========================================================================================\n"<<endl;
cout<<"金角巨兽\n生命值:"<<Sm_p1<<"\n攻击力:"<<Sh_p1<<endl;
cout<<"\n========================================================================================\n"<<endl;
while(1){
if(Sm_p1>0){
cout<<"\n-------------------------------------玩家对战-------------------------------------------"<<endl;
cout<<"小火龙\n"<<"生命值:"<<sm1_<<endl;
cout<<"释放技能:1.火球 2.拳击";
if(ft==1){
cout<<" 3.焚天";
}
cout<<endl;
cin>>aa;
if(aa==1){
cout<<"伤害:"<<sh_xhl1<<endl;
Sm_p1-=sh_xhl1;
}
if(aa==2){
cout<<"伤害:"<<sh_xhl2<<endl;
Sm_p1-=sh_xhl2;
}
if(ft==1&&aa==3){
cout<<"伤害:"<<sh_xhl3<<endl;
Sm_p1-=sh_xhl3;
}
}
cout<<"\n----------------------------------------------------------------------------------------\n"<<endl;
if(sm1_>0&&Sm_p1){
cout<<"\n-------------------------------------领主对战-------------------------------------------"<<endl;
cout<<"金角巨兽\n生命值:"<<Sm_p1<<endl;
cout<<"释放技能:斩空\n伤害:"<<Sh_p1<<endl;
sm1_-=Sh_p1;
}
if(sm1_<=0&&Sm_p1>0){
cout<<"\n========================================================================================"<<endl;
cout<<"你输了!"<<endl;
sm1_=0;
cout<<"1.返回\n";
cin>>aa;
if(aa==1){
clean1() ;
break;
}
}
if(Sm_p1<=0){
cout<<"\n========================================================================================"<<endl;
cout<<"你赢了!"<<endl;
jbb+=750;
jyy+=350;
cout<<"获得:\n金币+"<<750<<endl<<"经验值+"<<350<<endl;
cout<<"1.返回"<<endl;
cin>>bb;
if(bb==1){
clean1();
break;
}
}
}
}
}
}
}
}
}
//数据
if(LC_chose==6){
clean1();
cout<<"1.保存数据 2.清除数据 3.不保存数据 4.返回"<<endl;
cin>>aa;
if(aa==1){
ofstream is;
is.open("灵 宠 世 界.txt",ios::out);
is <<LC_num<<" "<<xhl_dj<<" "<<xhl_zdl<<" " <<LC_mj<<" "<<DWW<<" " <<Dw_1<<" "<<djj<<" "<<Dw_2<<" " <<sm1<<" "<<sh_xhl1<<" "<<sm_1<<" " <<sh_xhl2<<" "<<sh_src1<<" "<<dd<<" "<<ee<<" "<<jbb<<" "<<djj<<" "<<jyy<<" "<<HH<<" "<<sm1_b<<" "<<ff<<" "<<jj<<" "<<sw<<" "<<sw_nr<<" "<<kk<<" "<<xhl1<<" "<<xhl2<<" "<<nn<<" "<<oo<<" "<<bj<<" "<<xhl3<<" "<<sh_xhl3<<" "<<pp; //写入 cin>>
is.close();// 关闭文件,可不写 =1,=1,nn=100,oo=50
cout<<"数据保存成功!\n";
clean();
// qt();
break;
}
if(aa==2){
cout<<"提示:是否确认要删除所有数据\n\n1.返回 2.确认\n";
cin>>aa;
if(aa==1){
continue;
}
if(aa==2){
ofstream outfile("灵 宠 世 界.txt",ios::trunc);//灵 宠 世 界.txt里面的内容会被清空
}
clean1();
//qt();
break;
}
if(aa==3){
clean1();
// qt();
break;
}
if(aa==4){
clean1();
continue;
}
}
if(LC_chose==7) {
while(1){
system("cls");
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 商 店 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.食物 3.秘籍 4.药水 5.装备 "<<endl;
cin>>aa;
cout<<"\n========================================================================================"<<endl;
if(aa==1){
clean1();
break;
}
if(aa==2){
while(1){
cout<<"1.返回 2.牛肉 60金币 3.苹果 20金币 4.金苹果 50金币 5.小零食10金币 6.满血盛宴 140金币"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
if(jbb<60){
cout<<"金币不足!"<<endl;
}
if(jbb>=60){
sw++;
jbb-=60;
sw_nr++;
cout<<"购买成功!"<<endl;
}
clean();
}
if(aa==6){
if(jbb<140){
cout<<"金币不足!"<<endl;
}
if(jbb>=140){
sw++;
jbb-=140;
sw_mxsy++;
cout<<"购买成功!"<<endl;
}
clean();
}
}
}
}
}
if(LC_chose==8){
while(1){
ac:
system("cls");
cout<<" ======================================================================="<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || 设 置 ||"<<endl;
cout<<" || ||"<<endl;
cout<<" || ||"<<endl;
cout<<" ======================================================================="<<endl;
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回\n\n2.寻找作者(作者主页)\n\n3.背景颜色\n"<<endl;
cin>>aa;
if(aa==1){
clean1();
break;
}
if(aa==2){
system("start https://blog.csdn.net/m0_66072738?type=blog");//打开网站
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回"<<endl;
cin>>aa;
if(aa==1){
goto ac;
}
}
if(aa==3){
cout<<"\n========================================================================================\n"<<endl;
cout<<"1.返回 2.灰色 3.黑白 4.黄色 5.蓝色"<<endl;
cin>>aa;
if(aa==1){
goto ac;
}
if(aa==2){
system("color F1");
bj=2;;
}
if(aa==3){
system("color 07");
bj=3;
}
if(aa==4){
system("color E1");
bj=4;
}
if(aa==5){
system("color 97");
bj=5;
}
}
}
}
}
}
void shuju1(){
cout <<setw(110) << right << "年龄:"<<nl<<endl<<setw(110)<<right<<"等级:"<<dj<<endl<<setw(110)<<right<<"经验:"<<jy<<endl<<setw(113)<<right<<"生命力:"<<sm<<endl<<setw(112)<<right<<"饥饿度:"<<je<<endl<<setw(113)<<right<<"攻击力:"<<gj << '\n';
}
void moban(){
cin>>chose;
system("cls");
}
void clean(){
Sleep(1000);
system("cls");
}
void xy(int y,int x)
{
COORD coord;
coord.X=x;
coord.Y=y;
HANDLE a=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(a,coord);
}
string nandu(){
string nandu;
//1
if((xiangzi_a==a)&&(xiangzi_b==b)){
nandu="简单";
}
//2
if((xiangzi_a==a)&&(xiangzi_b=b)){
}
//3
if((xiangzi_a=a)&&(xiangzi_b=b)){
}
//4
if((xiangzi_a=a)&&(xiangzi_b=b)){
}
//5
if((xiangzi_a=a)&&(xiangzi_b=b)){
}
//6
if((xiangzi_a=a)&&(xiangzi_b=b)){
}
//7
if((xiangzi_a=a)&&(xiangzi_b=b)){
}
return nandu;
}
void shuju(){ //A1
//score_pj=score/cishu;
cout<<setw(109)<<right<<"名字:"<<name<<endl<<setw(110)<<right<<"金币:"<<score<<endl<<setw(110)<<right<<"次数:"<<cishu<<endl; //<<setw(110)<<right<<"平均分:"<<score_pj<<endl
}
void shuju2(){ //A4
cout<<setw(110)<<right<<"金币:"<<score<<setw(118)<<right<<"胜:"<<ying<<endl<<setw(109)<<right<<"输:"<<shu<<endl<<setw(111)<<right<<"平局:"<<ping<<endl;
}
void qt(){
for (int i=1;i<=50;i++)
{
xy(3,i);
cout <<"Tommy6gn独家出品";
Sleep(70);
xy(3,i);
cout <<" ";
}
// i 就是横坐标的值(在第几列),i 不断增加,就能做出一个横向移动的动画
Sleep(500);
for (int i=20;i>0;i--)
{
xy(i,i);
cout <<"欢迎提供建议";
Sleep(110);
xy(i,i);
cout <<" \n";
}
// i 是横坐标和竖坐标的值,i 不断减少,就能做出一个向左上方移动的动画 //此处借鉴,需学习
Sleep(500);
}
void duan(){
if(DW=="青铜"){
if(dw==0){
cout<<"段位:"<<DW;
cout<<" ☆ ☆ ☆\n";
}
if(dw==1){
cout<<"段位:"<<DW;
cout<<" ★ ☆ ☆\n";
// dw_1++;
}
if(dw==2){
cout<<"段位:"<<DW;
cout<<" ★ ★ ☆\n";
// dw_1++;
}
if(dw==3){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★\n";
// dw_1++;
}
if(dw>=4){
DW="白银";
dw-=4;
// dw_1++;
}
}
if(DW=="白银"){
if(dw==0){
cout<<"段位:"<<DW;
cout<<" ☆ ☆ ☆ ☆\n";
// dw_1++;
}
if(dw==1){
cout<<"段位:"<<DW;
cout<<" ★ ☆ ☆ ☆\n";
// dw_1++;
}
if(dw==2){
cout<<"段位:"<<DW;
cout<<" ★ ★ ☆ ☆\n";
// dw_1++;
}
if(dw==3){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ☆\n";
// dw_1++;
}
if(dw==4){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★\n";
// dw_1++;
}
if(dw>=5){
DW="黄金";
dw-=5;
// dw_1++;//9
}
}
if(DW=="黄金"){
if(dw==0){
cout<<"段位:"<<DW;
cout<<" ☆ ☆ ☆ ☆ ☆\n";
// dw_1++;
}
if(dw==1){
cout<<"段位:"<<DW;
cout<<" ★ ☆ ☆ ☆ ☆\n";
// dw_1++;
}
if(dw==2){
cout<<"段位:"<<DW;
cout<<" ★ ★ ☆ ☆ ☆\n";
// dw_1++;
}
if(dw==3){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ☆ ☆\n";
// dw_1++;
}
if(dw==4){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ☆\n";
// dw_1++;
}
if(dw==5){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★\n";
// //dw_1++;
}
if(dw>=6){
DW="铂金";
dw-=6;
//dw_1++;//15
}
}
if(DW=="铂金"){
if(dw==0){
cout<<"段位:"<<DW;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==1){
cout<<"段位:"<<DW;
cout<<" ★ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==2){
cout<<"段位:"<<DW;
cout<<" ★ ★ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==3){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==4){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ☆ ☆\n";
//dw_1++;
}
if(dw==5){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ☆\n";
//dw_1++;
}
if(dw==6){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★\n";
//dw_1++;
}
if(dw>=7){
DW="钻石";
dw-=7;
//dw_1++;//22
}
}
if(DW=="钻石"){
if(dw==0){
cout<<"段位:"<<DW;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==1){
cout<<"段位:"<<DW;
cout<<" ★ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==2){
cout<<"段位:"<<DW;
cout<<" ★ ★ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==3){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==4){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==5){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ☆ ☆\n";
//dw_1++;
}
if(dw==6){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ☆\n";
//dw_1++;
}
if(dw==7){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★\n";
//dw_1++;
}
if(dw>=8){
DW="星耀";
dw-=8;
//dw_1++;//30
}
}
if(DW=="星耀"){
if(dw==0){
cout<<"段位:"<<DW;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==1){
cout<<"段位:"<<DW;
cout<<" ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==2){
cout<<"段位:"<<DW;
cout<<" ★ ★ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==3){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==4){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==5){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==6){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ☆ ☆\n";
//dw_1++;
}
if(dw==7){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ☆\n";
//dw_1++;
}
if(dw==8){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★\n";
//dw_1++;
}
if(dw>=9){
DW="王者";
dw-=9;
//dw_1++;//30
}
}
if(DW=="王者"){
if(dw==0){
cout<<"段位:"<<DW;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==1){
cout<<"段位:"<<DW;
cout<<" ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==2){
cout<<"段位:"<<DW;
cout<<" ★ ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==3){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==4){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==5){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==6){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==7){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ☆ ☆\n";
//dw_1++;
}
if(dw==8){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ☆\n";
//dw_1++;
}
if(dw==9){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ★\n";
//dw_1++;
}
if(dw>=10){
DW="星光";
dw-=10;
//dw_1++;//30
}
}
if(DW=="星光"){
if(dw==0){
cout<<"段位:"<<DW;
cout<<" ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==1){
cout<<"段位:"<<DW;
cout<<" ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==2){
cout<<"段位:"<<DW;
cout<<" ★ ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==3){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ☆ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==4){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ☆ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==5){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ☆ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==6){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ☆ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==7){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ☆ ☆ ☆\n";
//dw_1++;
}
if(dw==8){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ☆ ☆\n";
//dw_1++;
}
if(dw==9){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ★ ☆\n";
//dw_1++;
}
if(dw>=10){
cout<<"段位:"<<DW;
cout<<" ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n";
//dw_1++;
}
}
}
void DW_(){
if(dw_1<4){
DW="青铜";
}
if(dw_1>=4&&dw_1<9){
DW="白银";
}
if(dw_1>=9&&dw_1<15){
DW="黄金";
}
if(dw_1>=15&&dw_1<22){
DW="铂金";
}
if(dw_1>=22&&dw_1<30){
DW="钻石";
}
if(dw_1>=30&&dw_1<39){
DW="星耀";
}
if(dw_1>=39&&dw_1<49){
DW="王者";
}
if(dw_1>=49&&dw_1<60){
DW="星光";
}
}
void SJ(){
}
void DJ_(){
for(int j=0;j<=10;j++){
if(JY/5>=1){
DJ++;
JY-=5;
dw_2++;
}
}
// while(DJ_d>0){
// DJ_a=0;
// if(JY==5*JY_a){
// DJ++;
// JY_a++;
// if(DJ%3==0){
// DJ_b=DJ-DJ_b;
// DJ_b-=3;
// if(DJ_b%3==0){
// dw++;
// }
// }
// }
// }
}
void DW_1(){
for(int q=0;q<=10;q++){
if(dw_2/3>=1){
dw++;
dw_2-=3;
}
}
}
低级的快乐来自放纵,高级的快乐来自克制。 6gn.