代码
using namespace std;
struct x{
int xue;
int yxue;
int ylan;
int lan;
int Agong;
int Egong;
int Qgong;
int dengji=1;
int baojigailv;
int baojibeilv;
int jingyan;
bool y;
}juese[300];
void tj();
void jz();
void cka();
void bb();
void ck();
void zhandou1();
void maoxian();
void ZD_shuishilaimu();
int juesej();
int baoji();
void shengji();
void MXshengji();
void BeiBao();
void SetPos(int x,int y);
int bd,up,s,a,MXDengJi=1,MX,MoLa=0,shijie=0,jjss;
int js;
string NAME="Genshin";//名字
int n,x;
char t;
bool flag=true;
bool uppf[100],wpf[100],spf[100];
void sc(string n)
{
for(int i=0;i<n.size();i++)
{
cout<<n[i];
Sleep(10);
}
puts("");
Sleep(15);
}
void open()
{
ifstream in("ysck.txt");
in>>bd;
in>>up;
in>>s;
in>>a;
for(int i=0;i<100;i++) in>>uppf[i];
for(int i=0;i<100;i++) in>>wpf[i];
for(int i=0;i<100;i++) in>>spf[i];
in.close();
}
void cclose()
{
ofstream out("ysck.txt");
out<<bd<<" ";
out<<up<<" ";
out<<s<<" ";
out<<a<<" ";
for(int i=0;i<100;i++) out<<uppf[i]<<" ";
for(int i=0;i<100;i++) out<<wpf[i]<<" ";
for(int i=0;i<100;i++) out<<spf[i]<<" ";
}
int main()
{
srand((unsigned)time(NULL));
CONSOLE_CURSOR_INFO cursor_info={1,0};
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);
system("mode con cols=119 lines=30");
int cz;
system("title 原神");
//jz();//出场动画
cout<<"=\n";
cout<<"是(y)否(n)读档?\n";
char DXxz;
cin>>DXxz;
if(DXxz'y'){open();cout<<".";Sleep(100);cout<<".";Sleep(100);cout<<".";Sleep(100);cout<<".";Sleep(100);cout<<".";Sleep(100);cout<<".";Sleep(100);cout<<"\n完成!";Sleep(500);}
system("cls");
while(1)
{
printf(//输入对应编号进入程序
"=\n"
"| |\n"
"| 1.**************抽卡* 2.**图鉴 3.冒险 |\n"
"| | &&& & & | | &&&&&&& & | | o__ o | |\n"
"| | & & & | | & & | | C| o o o| |\n"
"| | & &&& | | & & & | | /] o | |\n"
"| | &&& & & | | & && | | / | |\n"
"| ------------------- ----------------------- ------------------- |\n"
"| |\n"
"| |\n"
"| |\n"
"| |\n"
"| |\n"
"| |\n"
"| |\n"
"| |\n"
"| |\n"
"|注:按0退出 |\n"
"=\n"
);
cin>>cz;
if(cz0) break;
if(cz1)
ck();
else if(cz2)
tj();
else cout<<"你按错了!!!",Sleep(500),system("cls");
}
cclose();
}
void ck()
{
system("cls");
srand(time(0));
cout<<"你好!\n";
Sleep(500);
cout<<"我是您的抽卡小助手,接下来是抽卡的一些小规则\n\n";
Sleep(100);
while(1)
{
cout<<"\n";
cout<<" 1.卡池分为新手池和UP池,本次UP为高 \n";
cout<<" 天的歌者——温迪、护法夜叉——魈, \n";
cout<<" 五星(S级)陪跑为迪锅巴,琴团长,四星( \n";
cout<<" A级)陪跑若干,九十抽小保底,一百八十 \n";
cout<<" 抽大保底。 \n";
cout<<" 注:按a一抽,按s十连,0退出,按b背包 \n";
cout<<" 五星出率:%2 UP出率(已出五星):%10 \n";
cout<<"\n";
t=_getch();
if(t!='a'&&t!='s'&&t!='b'&&t!='0')
{
cout<<"你按错了!!";
Sleep(600);
system("cls");
continue;
}
if(t'a')
{
cka();
}
if(t'0')
break;
if(t's')
{
for(int i=1;i<=10;i++)
{
cka();
}
}
if(s>99){
s=100;
cout<<"目前五星99+个 ";
}
else cout<<"目前五星"<<s<<"个 UP";
if(up>99){
up=100;
cout<<"99+个 四星";
}
else cout<<up<<"个 四星";
if(a>99){
a=100;
cout<<"99+个 距离大保底还有";
}
else cout<<a<<"个 距离大保底还有";
cout<<180-bd<<"次\n";
if(t'b')
{
bb();
}
cclose();
Sleep(2000);
system("cls");
}
system("cls");
}
void jz(){
system("color F0");
cout<<"\n\n\n\n\n\n\n\n\n\n 玖葉";
Sleep(2000);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 斗原\n\n\n\n\n\n\n\n\n\n\n\n\n\nGAME制作:玖葉 剧情策划:玖葉 如侵立删";
Sleep(2000);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 加载中\n\n";
cout<<" 火 水 风 雷 草 冰 岩";
Sleep(1000);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 加载中\n\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),252);
cout<<" 火";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),240);
cout<<" 水 风 雷 草 冰 岩";
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 加载中\n\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),252);
cout<<" 火";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),249);
cout<<" 水";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),240);
cout<<" 风 雷 草 冰 岩";
Sleep(1000);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 加载中\n\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),252);
cout<<" 火";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),249);
cout<<" 水";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),250);
cout<<" 风";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),240);
cout<<" 雷 草 冰 岩";
Sleep(600);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 加载中\n\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),252);
cout<<" 火";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),249);
cout<<" 水";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),250);
cout<<" 风";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),245);
cout<<" 雷";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),240);
cout<<" 草 冰 岩";
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 加载中\n\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),252);
cout<<" 火";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),249);
cout<<" 水";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),250);
cout<<" 风";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),245);
cout<<" 雷";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),242);
cout<<" 草";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),240);
cout<<" 冰 岩";
Sleep(895);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 加载中\n\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),252);
cout<<" 火";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),249);
cout<<" 水";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),250);
cout<<" 风";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),245);
cout<<" 雷";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),242);
cout<<" 草";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),251);
cout<<" 冰";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),240);
cout<<" 岩";
Sleep(1599);
system("cls");
cout<<"\n\n\n\n\n\n\n\n\n\n 加载中\n\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),252);
cout<<" 火";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),249);
cout<<" 水";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),250);
cout<<" 风";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),245);
cout<<" 雷";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),242);
cout<<" 草";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),251);
cout<<" 冰";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),254);
cout<<" 岩";
system("cls");
system("color F0");
Sleep(20);
system("color 70");
Sleep(20);
system("color 80");
Sleep(20);
system("color 0F");
Sleep(500);
}
void cka(){
if(bd180)
{
s++;
x=rand()%10;
if(x>0&&x<6)
{
cout<<"获得——温迪!\n";
uppf[2]=1;
juese[2].Agong=8;
juese[2].baojibeilv=120;
juese[2].baojigailv=11;
juese[2].Egong=15;
juese[2].lan=32;
juese[2].Qgong=75;
juese[2].xue=110;
juese[2].ylan=100;
juese[2].yxue=110;
up++;
}
else
{
cout<<"获得——魈!\n";
uppf[3]=1;
juese[3].Agong=10;
juese[3].baojibeilv=150;
juese[3].baojigailv=10;
juese[3].Egong=20;
juese[3].lan=30;
juese[3].Qgong=70;
juese[3].xue=100;
juese[3].ylan=100;
juese[3].yxue=100;
up++;
}
bd=0;
}
if(bd90)
{
s++;
x=rand()%100;
if(x>11&&x<17||x99||x43||x>=50&&x<=53)
{
x=rand()%10;
if(x>0&&x<6)
{
cout<<"获得——温迪!\n";
uppf[2]=1;
juese[2].Agong=8;
juese[2].baojibeilv=120;
juese[2].baojigailv=11;
juese[2].Egong=15;
juese[2].lan=32;
juese[2].Qgong=75;
juese[2].xue=110;
juese[2].ylan=100;
juese[2].yxue=110;
up++;
}
else
{
cout<<"获得——魈!\n";
uppf[3]=1;
juese[3].Agong=10;
juese[3].baojibeilv=150;
juese[3].baojigailv=10;
juese[3].Egong=20;
juese[3].lan=30;
juese[3].Qgong=70;
juese[3].xue=100;
juese[3].ylan=100;
juese[3].yxue=100;
up++;
}
bd=0;
}
else
{
x=rand()%10;
if(x1||x5||x2||x10||x7)
cout<<"获得——迪卢克!\n",wpf[0]=1,juese[4].Agong=11,juese[4].baojibeilv=119,juese[4].baojigailv=20,juese[4].Egong=21,juese[4].lan=31,juese[4].Qgong=65,juese[4].xue=100,juese[4].ylan=100,juese[4].yxue=100;
else
cout<<"获得——琴团长!\n",wpf[2]=1,juese[6].Agong=10,juese[6].baojibeilv=116,juese[6].baojigailv=15,juese[6].Egong=22,juese[6].lan=29,juese[6].Qgong=60,juese[6].xue=100,juese[6].ylan=100,juese[6].yxue=100;
}
}
x=rand()%1000;
if(x>=11&&x<=21||x>=597&&x<=607)//五星
{
s++;
x=rand()%100;
if(x>11&&x<17||x99||x43||x>=50&&x<=53)
{
x=rand()%10;
if(x>0&&x<6)
{
cout<<"获得——温迪!\n";
uppf[2]=1;
juese[2].Agong=8;
juese[2].baojibeilv=120;
juese[2].baojigailv=11;
juese[2].Egong=15;
juese[2].lan=32;
juese[2].Qgong=75;
juese[2].xue=110;
juese[2].ylan=100;
juese[2].yxue=110;
up++;
}
else
{
cout<<"获得——魈!\n";
uppf[3]=1;
juese[3].Agong=10;
juese[3].baojibeilv=150;
juese[3].baojigailv=10;
juese[3].Egong=20;
juese[3].lan=30;
juese[3].Qgong=70;
juese[3].xue=100;
juese[3].ylan=100;
juese[3].yxue=100;
up++;
}
bd=0;
}
else
{
x=rand()%10;
if(x1||x5||x2||x10||x7)
cout<<"获得——迪卢克!\n",wpf[0]=1,juese[4].Agong=11,juese[4].baojibeilv=119,juese[4].baojigailv=20,juese[4].Egong=21,juese[4].lan=31,juese[4].Qgong=65,juese[4].xue=100,juese[4].ylan=100,juese[4].yxue=100;
else
cout<<"获得——琴团长!\n",wpf[2]=1,juese[6].Agong=10,juese[6].baojibeilv=116,juese[6].baojigailv=15,juese[6].Egong=22,juese[6].lan=29,juese[6].Qgong=60,juese[6].xue=100,juese[6].ylan=100,juese[6].yxue=100;
}
}
else
{
x=rand()%100;
if(x>=22&&x<=66)
{
x=rand()%100;
if(x>=1&&x<=20) cout<<"获得——云堇!\n",spf[0]=1;
else if(x>=21&&x<=40) cout<<"获得——班尼特!\n",spf[1]=1;
else if(x>=41&&x<=60) cout<<"获得——行秋!\n",spf[2]=1;
else if(x>=61&&x<=80) cout<<"获得——久岐忍!\n",spf[3]=1;
else if(x>=81&&x<=100) cout<<"获得——香菱!\n",spf[4]=1;
a++;
}
else
cout<<"依托答辩\n";
bd++;
}
}
void bb(){
cout<<NAME<<"的角色库\n-----------------------------------------------------\n";
int y=1;
for(int i=0;i<12;i++)
{
switch(i)
{
case 0:if(uppf[0])cout<<y<<'.',sc("爱莉希雅"),y++;break;
case 1:if(uppf[1])cout<<y<<'.',sc("钟离"),y++;break;
case 2:if(uppf[2])cout<<y<<'.',sc("温迪"),y++;break;
case 3:if(uppf[3])cout<<y<<'.',sc("魈"),y++;break;
case 4:if(wpf[0])cout<<y<<'.',sc("迪卢克"),y++;break;
case 5:if(wpf[1])cout<<y<<'.',sc("提纳里"),y++;break;
case 6:if(wpf[2])cout<<y<<'.',sc("琴团长"),y++;break;
case 7:if(spf[0])cout<<y<<'.',sc("云堇"),y++;break;
case 8:if(spf[1])cout<<y<<'.',sc("班尼特"),y++;break;
case 9:if(spf[2])cout<<y<<'.',sc("行秋"),y++;break;
case 10:if(spf[3])cout<<y<<'.',sc("久岐忍"),y++;break;
case 11:if(spf[4])cout<<y<<'.',sc("香菱"),y++;break;
}
}
}
void tj(){
int x=1;
system("cls");
while(x!=0)
{
sc("0退出");
cout<<1<<'.',sc("爱莉希雅");
cout<<2<<'.',sc("钟离");
cout<<3<<'.',sc("温迪");
cout<<4<<'.',sc("魈");
cout<<5<<'.',sc("迪卢克");
cout<<6<<'.',sc("提纳里");
cout<<7<<'.',sc("琴团长");
cout<<8<<'.',sc("云堇");
cout<<9<<'.',sc("班尼特");
cout<<10<<'.',sc("行秋");
cout<<11<<'.',sc("久岐忍");
cout<<12<<'.',sc("香菱");
sc("请输入查询编号:");
cin>>x;
system("cls");
if(x==0) break;
switch(x)
{
case 1:sc("爱莉希雅");
sc("背景资料:");
cout<<"凡事任凭心意而为,自由自在,与副首领身份格格不入的少女。亦是逐火英桀的创立者,聚集并维系此十三人的核心人物。\n";
Sleep(1000);
cout<<"只在喜欢的人上花时间,但每个人都很喜欢;只在有趣的事上花心思,但每件事都很有趣——心怀如此信念,带着真诚与热情拥抱每一天的纯真女孩\n";
printf("按下任意键继续...");
while(1){
if(kbhit())
break;
}
system("cls");
break;
case 2:sc("钟离");
sc("背景资料:");
cout<<"钟离样貌俊美,举止高雅,拥有远超常人的学识。\n";
Sleep(1000);
cout<<"虽说来历不明,却知礼数、晓规矩。坐镇“往生堂”,能行天地万物之典仪。\n";
cout<<"PS:俗称街溜子\n";
printf("按下任意键继续...");
while(1){
if(kbhit())
break;
}
system("cls");
break;
case 3:sc("温迪");
sc("背景资料:");
cout<<"自由城邦蒙德的建立者,“尘世七执政”中的风神,为了让蒙德人民得到自由而放弃治理。\n";
Sleep(600);
cout<<"千年后重返蒙德,辅助奴隶少女温妮莎推翻贵族的残暴统治,设立四风守护。\n";
Sleep(600);
cout<<"又过千年,愚人众和深渊教团令蒙德内外交困,因而引来神的回归。\n";
cout<<"解救被深渊教团操控的东风之龙。\n";
cout<<"PS:俗称卖唱的\n";
printf("按下任意键继续...");
while(1){
if(kbhit())
break;
}
system("cls");
break;
case 4:sc("魈");
sc("背景资料:");
cout<<"守护璃月港的“三眼五显仙人”之一,妙称“护法夜叉大将”。\n";
Sleep(500);
cout<<"虽然外表看起来是一个少年人,但一些有关他的传说,已在古卷中流传千年。\n";
Sleep(500);
cout<<"在仙人之间,魈的辈分与声望堪称翘楚,但在人间,他的名望并不高。\n";
Sleep(500);
cout<<"因为他既非招揽富贵、庇佑世人安康的福星;也非手握仙道,高居在绝云间的圣众。\n";
cout<<"PS:又称抬头不见低头见真君o(▽)o\n";
printf("按下任意键继续...");
while(1){
if(kbhit())
break;
}
system("cls");
break;
case 5:sc("迪卢克");
sc("背景资料");
cout<<"身为蒙德城第一富豪,风度翩翩的迪卢克总是以完美的贵公子形象示人。\n";
Sleep(1000);
cout<<"然而他真实的一面,是秉承坚定信念的战士,他那“不惜一切守护蒙德”的意志犹如火焰般炽热,令他能以恐怖的攻势,毫不留情地将一切敌人击溃。\n";
cout<<"PS:俗称迪锅巴\n";
printf("按下任意键继续...");
while(1){
if(kbhit())
break;
}
system("cls");
break;
case 6:sc("提纳里");
sc("背景资料");
cout<<"道成林的巡林官,毕业于须弥教令院阿弥利多学院的生论派植物学学者。\n";
Sleep(800);
cout<<"每天都过着巡查雨林、保护生态、教训笨蛋的充实生活。\n";
Sleep(800);
cout<<"提纳里是巴螺迦修那和人类的混血后代,但不同于父亲,提纳里不擅长应付烈日。\n晒久了脑袋里就一团浆糊,晃晃荡荡的。\n";
cout<<"PS:歪过诶\n";
printf("按下任意键继续...");
while(1){
if(kbhit())
break;
}
system("cls");
break;
case 7:sc("琴·古恩希尔德");
sc("背景资料");
cout<<"蒙德城西风骑士团代理团长,四风守护中的南风之狮。\n",Sleep(700);
cout<<"身为西风骑士团的代理团长,琴一直忠于职守,为人们带来安宁。\n",Sleep(700);
cout<<"虽然并非天赋异禀,但通过刻苦训练,如今的她已然能够独当一面。\n",Sleep(700);
cout<<"当风魔龙的威胁开始临近,这位可靠的代理团长早已做好了准备,誓要守护蒙德。\n",Sleep(700);
printf("按下任意键继续...");
while(1){
if(kbhit())
break;
}
system("cls");
break;
default:
sc("四星不想做……(~▽)~ "),Sleep(500);
system("cls");
}
}
}
void SetPos(int x,int y)
{
COORD pos;
pos.X=y*2,pos.Y=x;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void jueseshiyong()
{
while(1)
{
cout<<"请输入你要用的角色:\n";
cout<<1<<'.',sc("爱莉希雅");
cout<<2<<'.',sc("钟离");
cout<<3<<'.',sc("温迪");
cout<<4<<'.',sc("魈");
cout<<5<<'.',sc("迪卢克");
cout<<6<<'.',sc("提纳里");
cout<<7<<'.',sc("琴团长");
cout<<8<<'.',sc("云堇");
cout<<9<<'.',sc("班尼特");
cout<<10<<'.',sc("行秋");
cout<<11<<'.',sc("久岐忍");
cout<<12<<'.',sc("香菱");
cin>>js;
if((js1&&uppf[0]0)||(js2&&uppf[1]0)||(js3&&uppf[2]0)||(js4&&uppf[3]0)||(js5&&wpf[0]0)||(js6&&wpf[1]0)||(js7&&wpf[2]0)||(js8&&spf[0]0)||(js9&&spf[1]0)||(js10&&spf[2]0)||(js11&&spf[3]0)||(js12&&spf[4]0))
cout<<"还没抽到呢";)----------------------\n";
else{jjss=js-1;break;}
system("cls");
}
}
void ZD_shuishilaimu()
{
int gxue=100shijie;
int gyxue=gxue;
int glan=gxue;
int gylan=glan;
int gong=75shijie;
int huihe=0;
while(1){
huihe++;
system("cls");
printf(
"=\n"
"| 敌方:水史莱姆 血: 蓝: |\n"
"| 我方: 血: 蓝: |\n"
"| |\n"
"| |\n"
"| |\n"
"| |\n"
"| ********** |\n"
"| ************** |\n"
"| *** ***** **** |\n"
"| *** ***** **** |\n"
"| **************** |\n"
"|1.技能 ************** |\n"
"| |\n"
"|2.逃跑 |\n"
"| |\n"
"|3.背包 |\n"
"| |\n"
"=\n"
,huihe);
SetPos(0,5),cout<<"第"<<huihe<<"回合";
SetPos(8,15);
if(juese[0].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),13),cout<<"爱",SetPos(2,9),cout<<"爱莉希雅",SetPos(1,26),cout<<juese[0].xue<<"/"<<juese[0].yxue,SetPos(1,47),cout<<juese[0].lan<<"/"<<juese[0].ylan;
else if(juese[1].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN),cout<<"钟",SetPos(2,9),cout<<"钟离",SetPos(1,26),cout<<juese[1].xue<<"/"<<juese[1].yxue,SetPos(1,47),cout<<juese[1].lan<<"/"<<juese[1].ylan;
else if(juese[2].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),2),cout<<"温",SetPos(2,9),cout<<"温迪",SetPos(1,26),cout<<juese[2].xue<<"/"<<juese[2].yxue,SetPos(1,47),cout<<juese[2].lan<<"/"<<juese[2].ylan;
else if(juese[3].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),2),cout<<"魈",SetPos(2,9),cout<<"魈",SetPos(1,26),cout<<juese[3].xue<<"/"<<juese[3].yxue,SetPos(1,47),cout<<juese[3].lan<<"/"<<juese[3].ylan;
else if(juese[4].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),12),cout<<"迪",SetPos(2,9),cout<<"迪卢克",SetPos(1,26),cout<<juese[4].xue<<"/"<<juese[4].yxue,SetPos(1,47),cout<<juese[4].lan<<"/"<<juese[4].ylan;
else if(juese[5].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),10),cout<<"提",SetPos(2,9),cout<<"提纳里",SetPos(1,26),cout<<juese[5].xue<<"/"<<juese[5].yxue,SetPos(1,47),cout<<juese[5].lan<<"/"<<juese[5].ylan;
else if(juese[6].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),2),cout<<"琴",SetPos(2,9),cout<<"琴",SetPos(1,26),cout<<juese[6].xue<<"/"<<juese[6].yxue,SetPos(1,47),cout<<juese[6].lan<<"/"<<juese[6].ylan;
else if(juese[7].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN),cout<<"云",SetPos(2,9),cout<<"云堇",SetPos(1,26),cout<<juese[7].xue<<"/"<<juese[7].yxue,SetPos(1,47),cout<<juese[7].lan<<"/"<<juese[7].ylan;
else if(juese[8].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),12),cout<<"班",SetPos(2,9),cout<<"班尼特",SetPos(1,26),cout<<juese[8].xue<<"/"<<juese[8].yxue,SetPos(1,47),cout<<juese[8].lan<<"/"<<juese[8].ylan;
else if(juese[9].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),9),cout<<"行",SetPos(2,9),cout<<"行秋",SetPos(1,26),cout<<juese[9].xue<<"/"<<juese[9].yxue,SetPos(1,47),cout<<juese[9].lan<<"/"<<juese[9].ylan;
else if(juese[10].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),10),cout<<"久",SetPos(2,9),cout<<"久岐忍",SetPos(1,26),cout<<juese[10].xue<<"/"<<juese[10].yxue,SetPos(1,47),cout<<juese[10].lan<<"/"<<juese[10].ylan;
else if(juese[11].y) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),12),cout<<"香",SetPos(2,9),cout<<"香菱",SetPos(1,26),cout<<juese[11].xue<<"/"<<juese[11].yxue,SetPos(1,47),cout<<juese[11].lan<<"/"<<juese[11].ylan;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
SetPos(1,26),cout<<gxue<<"/"<<gyxue;
SetPos(1,47),cout<<glan<<"/"<<gylan;
int jg=0,gg=0,xz;
SetPos(19,0);
cin>>xz;
if(xz1){
system("cls");
jg=juesej();
}
if(xz2){system("cls");break;}
if(xz3) BeiBao();
cout<<"水史莱姆受到了"<<jg<<"点伤害\n";
jg=jg1.0/100baoji();
gxue-=jg;
if(gxue<=0){
cout<<"水史莱姆死亡,获得:\n";
cout<<"1.角色/冒险等级经验+5\n2.摩拉+500\n";
juese[jjss].jingyan+=5;
MX+=5;
MoLa+=500;
if(MX>=MXDengJi*5) MXshengji();
int x=rand()%3;
if(x0){
cout<<"血量+20(自动溢出)";
juese[jjss].xue+=20;
if(juese[jjss].xue>juese[jjss].yxue) juese[jjss].xue=juese[jjss].yxue;
}
if(juese[jjss].jingyan>=juese[jjss].dengji10) shengji();
break;
}
if(glan>=10){
glan-=10;
int y=rand()%100+1;
gg=10;
if(y>=0&&y<=45){
gg=gg1.0/100110;
}
}
cout<<"你受到了"<<gg<<"点伤害\n";
juese[jjss].xue-=gg;
if(juese[jjss].xue<=0){
juese[jjss].xue=0;
cout<<"你输了\n";
Sleep(500);
cout<<"你减少了1/4的摩拉";
MoLa=MoLa1.0/4;
}
system("cls");
}
}
int juesej()
{
while(1){
cout<<"1.普攻(A)\n2.战技(E)\n3.爆发(Q)\n";
int xz;
cin>>xz;
if(xz1){
if(juese[jjss].lan>=juese[jjss].Agong){juese[jjss].lan-=juese[jjss].Agong;return juese[jjss].Agong;}
}
if(xz2){
if(juese[jjss].lan>=juese[jjss].Egong){juese[jjss].lan-=juese[jjss].Egong;return juese[jjss].Egong;}
}
if(xz3){
if(juese[jjss].lan>=juese[jjss].Qgong){juese[jjss].lan-=juese[jjss].Qgong;return juese[jjss].Qgong;}
cout<<"乱搞什么!";
Sleep(500);
system("cls");
}
}
int baoji()
{
int BJ=rand()%100+1;
if(BJ>=1&&BJ<=juese[jjss].baojigailv){
cout<<"并且暴击!\n";
int x=juese[jjss].baojibeilv;
return x;
}
else return 100;
}
void shengji()
{
juese[jjss].jingyan-=juese[jjss].dengji10;
juese[jjss].dengji++;
cout<<"\n升级啦!\n";
sc("血量上限+10,血量回满\n");
sc("蓝量上限+10,蓝量回满\n");
juese[jjss].yxue+10,juese[jjss].xue=juese[jjss].yxue;
juese[jjss].ylan+10,juese[jjss].lan=juese[jjss].ylan;
Sleep(900);
system("cls");
}
void MXshengji()
{
cout<<"冒险等级提升了!\n";
MX-=MXDengJi5;
MXDengJi++;
Sleep(900);
system("cls");
}
int BeiBao()
{
sytem("cls");
cout<<"背包里有:\n1.提瓦特煎蛋X";
cout<<tiwatejiandan<<"个\n";
cout<<"你要用:";
int xz;
cin>>xz;
if(xz1) juese[jjss].xue+=5;
sytem("cls");
}
void maoxian()
{
while(1)
{
cout<<"------(我是分割线
cout<<"1.虐待水史莱姆\n0.退出\n请选择:";
int xz;
cin>>xz;
if(xz1)
ZD_shuishilaimu();
if(xz0) break;
}
}
请大佬运行过后为我解答,谢谢!!!!!!!
提问问题也要注意方法吧,这么长没有注释的代码让谁去读啊,也不说要实现什么功能
我注意到您的代码中存在一些语法错误和问题。以下是我发现的一些主要问题:
头文件应该使用 #include,而不是 include。例如,将 include<bits/stdc++.h> 替换为 #include<bits/stdc++.h>。
sc 函数调用中的 Sleep 函数未定义。您可能需要包含 <windows.h> 头文件。
函数 juesej() 的实现缺失,而在其他地方调用了该函数。
变量 jjss 在 jueseshiyong() 函数中使用,但未在该函数之前声明。
在 ZD_shuishilaimu() 函数中,使用了未定义的变量 shijie,您可能需要定义或传递该变量。
您的代码中缺少一些函数的实现,如 tj()、ck()、bb() 等。
请注意,我只是简要检查了您的代码,并未详细分析。您可能需要根据这些提示逐一解决这些问题。如果需要更详细的帮助,可以提供更多上下文或具体的错误信息。
已解决
为同学教我的
问题:括号忘加,system("")少了个s
把md学习下,再来问
– echo_lovely 8个月前