111
  • 板块学术版
  • 楼主xhl_leo
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/4/3 17:06
  • 上次更新2024/4/3 17:07:42
查看原帖
111
1208985
xhl_leo楼主2024/4/3 17:06
#include <bits/stdc++.h>
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <time.h>
#include <thread>
#define wcout cout
using namespace std;
int te=0,cnt=0,ans=0,p=2;
int dx[8]={0,1,0,-1,1,1,-1,-1};
int dy[8]={1,0,-1,0,1,-1,1,-1};
struct xg{
	int x,y,z;
} b[101],d[101];
void slow (string s)
{
	int t=s.size ();
	for (int i=0;i<t;i++)
	{
		Sleep (100);
		cout<<s[i];
	}
}
void sleep (int x)
{
	Sleep (x*1000);
}
struct fm{
	int i;
	string name;
}; 
struct wq{
	int sh,fmsize;
	fm fm[11];
};
struct wp{
	int sl,sx;
	string name;
};
struct hjz{
	int hj,fmsize;
	fm fm[11];
};
struct rw{
	int x,y,t,food,food_good;
	wq ja,fu,ga,du;
	int ba,xe,ti,sh,hj;
	hjz tk,xj,ht,xz;
	wp a[36];
} st;
struct dt{
	char x;
	int s,t;
	int czz () {if (x==',') return s;return -1;}
	void cz (char _x='.',int y=1,int z=75) {x=_x,s=y,t=z;}
} a[101][101];
dt c[101][101],e[101][101];
void Color (int a)
{
    SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), a);
}
void gz ()
{
	Color (7);
	system ("cls");
	wcout<<"按q键看规则\n";
	wcout<<"按w,a,s,d键上下左右移动\n";
	wcout<<"按e键看背包\n";
	wcout<<"按r键吃东西\n";
	wcout<<"按esc键保存并退出\n";
	wcout<<"按t键更换难度\n";
	wcout<<"按z键吃补品\n";
	wcout<<"按x键合成武器\n";
	wcout<<"按y键挖方块(你面向的地方的方块)\n";
	wcout<<"按v键放方块(后加名称)\n";
	system ("pause");
	system ("cls");
}
string zh1 (int x)
{
	string s=" ";
	while (x) s=char (x%10+48)+s,x/=10;
	return s;
}
void ba ()
{
	system ("cls");
	if (st.t<=0) {slow ("你的背包里没有东西。。。。。\n"),Sleep (500),system ("cls");return ;}
	slow ("你的背包里有 "+zh1 (st.t)+" 件物品\n");
	for (int i=1;i<=st.t;i++)
		slow (st.a[i].name+'*'+zh1 (st.a[i].sl)+'\n');
	system ("pause");
	system ("cls");
}
void bt (char s)
{
	system ("cls");
	a[st.x][st.y].x=s;
	ofstream fout;
	fout.open ("地图.map");
	for (int i=1;i<=30;i++)
	{
		for (int j=1;j<=30;j++)
			if (a[i][j].x=='v'||a[i][j].x=='q'||a[i][j].x=='z') fout<<'.';
				else fout<<a[i][j].x;
		fout<<'\n';
	}
	fout.close ();
	fout.open ("数据.s");
	fout<<st.x<<'\n';
	fout<<st.y<<'\n'; 
	for (int i=1;i<=35;i++)
		if (st.a[i].sl==0) fout<<"notis物品 "<<0<<endl;
			else fout<<st.a[i].name<<' '<<st.a[i].sl<<endl; 
	fout<<100<<endl;
	fout<<st.hj<<endl;
	fout<<st.food_good<<endl;
	fout.close ();
	exit (0); 
}
int pd (string s)
{
	for (int i=1;i<=st.t;i++)
		if (st.a[i].name==s) return i;
	return 0;
}
void ks ()
{
	system ("cls");
	wcout<<"树的血量:"<<a[st.x][st.y].t<<endl;
	wcout<<"输入c砍树。\n";
	char t;
	t=_getch ();
	while (t!='c') t=getch ();
	a[st.x][st.y].t-=rand ()%8;
	st.ba--; 
}
bool yg ()
{
	for (int i=1;i<=30;i++)
		for (int j=1;j<=30;j++)
			if (a[i][j].x=='q'||a[i][j].x=='v'||a[i][j].x=='z') return 1;
	return false;
}
void js (int x,int y)
{
	system ("cls");
	Color (7); 
	slow ("这是一个僵尸。。。。。。");
	sleep (1);
	system ("cls");	
	int t=1000;
	while (t>0)
	{
		cout<<"你的血量:";
		Color (4);
		cout<<st.xe<<endl;
		for (int i=1;i<=st.xe/100;i++)
			wcout<<"▄";
		cout<<endl;
		Color (7);
		wcout<<"僵尸的血量:";
		Color (1);
		cout<<t<<endl;
		for (int i=1;i<=t/100;i++)
			wcout<<"▄";
		cout<<endl;
		Color (7);
		wcout<<"输入c杀僵尸\n";
		char s=_getch ();
		if (s=='c') t-=st.sh;
		st.xe-=5-st.hj;
		system ("cls");
	}
	st.food+=rand ()%8+1;
	st.xe+=10;
	int l=rand ()%10000+1;if (l==4324||l==5453||l==4353||l==3432) {for (int i=1;i<=st.t;i++) if (st.a[i].name=="钻石") {st.a[i].sl++;return ;}st.a[++t].name="钻石",st.a[t].sl++;}
	for (int i=1;i<=cnt;i++)
		if (b[i].x==x&&b[i].y==y) 
		{
			for (int j=i+1;j<=cnt;j++)
				b[j-1]=b[j];
			cnt--;
			break;
		}
}
void xb (int x,int y)
{
	system ("cls");
	Color (7); 
	slow ("这是一个小白。。。。。。");
	sleep (1);
	system ("cls");	
	int t=1000;
	while (t>0)
	{
		wcout<<"你的血量:";
		Color (4);
		cout<<st.xe<<endl;
		for (int i=1;i<=ceil (st.xe*1.0/100);i++)
			wcout<<"▄";
		cout<<endl;
		Color (7);
		wcout<<"小白的血量:";
		Color (1);
		cout<<t<<endl;
		for (int i=1;i<=ceil (t*1.0/100);i++)
			wcout<<"▄";
		cout<<endl;
		Color (7);
		wcout<<"输入c杀小白\n";
		char s=_getch ();
		if (s=='c') t-=st.sh;
		st.xe-=5-st.hj;
		system ("cls");
	}
	st.food+=rand ()%8+1;
	st.xe+=10;
	int l=rand ()%10000+1;if (l==4324||l==4322||l==4321||l==7674) {for (int i=1;i<=st.t;i++) if (st.a[i].name=="钻石") {st.a[i].sl++;return ;}st.a[++t].name="钻石",st.a[t].sl++;}
	for (int i=1;i<=cnt;i++)
		if (b[i].x==x&&b[i].y==y) 
		{
			for (int j=i+1;j<=cnt;j++)
				b[j-1]=b[j];
			cnt--;
			break;
		}
}
void qp (int x,int y)
{
	system ("cls");
	Color (7); 
	slow ("这是一个苦力怕。。。。。。");
	sleep (1);
	system ("cls");	
	int t=1000;
	while (t)
	{
		wcout<<"你的血量:";
		Color (4);
		cout<<st.xe<<endl;
		for (int i=1;i<=ceil (st.xe*1.0/100);i++)
			wcout<<"▄";
		cout<<endl;
		Color (7);
		wcout<<"苦力怕的血量:";
		Color (1);
		cout<<t<<endl;
		for (int i=1;i<=ceil (t*1.0/100);i++)
			cout<<"▄";
		cout<<endl;
		Color (7);
		cout<<"输入c杀苦力怕\n";
		char s=_getch ();
		if (s=='c') t-=st.sh;
		if (t<=0) {st.xe+=20;return ;}
			else {st.xe-=600-st.hj;st.food_good++;int t=rand ()%10000+1;if (t==4324||t==3422||t==5213||t==2143) {for (int i=1;i<=st.t;i++) if (st.a[i].name=="钻石") {st.a[i].sl++;return ;}st.a[++t].name="钻石",st.a[t].sl++;}return ;}
		system ("cls");
	}
	st.food+=rand ()%8+1;
	st.xe+=10;
	for (int i=1;i<=cnt;i++)
		if (b[i].x==x&&b[i].y==y) 
		{
			for (int j=i+1;j<=cnt;j++)
				b[j-1]=b[j];
			cnt--;
			break;
		}
}
void hc ()
{
	system ("cls");
	string s[5]={"","木板","圆石","铁锭","钻石"};
	string t="";
	int l; 
	for (int i=1;i<=4;i++)
	{
		for (int j=1;j<=st.t;j++)
			if (st.a[j].name==s[i])
				t=s[i],l=j;
	}
	if (t=="") return ;
	cout<<"1.3个"<<t<<"合成"<<t<<"剑\n";
	cout<<"2.4个"<<t<<"合成"<<t<<"斧头\n";
	cout<<"3.4个"<<t<<"合成"<<t<<"稿子\n";
	cout<<"4.5个"<<t<<"合成"<<t<<"头盔\n";
	cout<<"5.8个"<<t<<"合成"<<t<<"胸甲\n";
	cout<<"6.7个"<<t<<"合成"<<t<<"护腿\n";
	cout<<"7.4个"<<t<<"合成"<<t<<"靴子\n";
	if (t=="圆石") cout<<"8.九个圆石合成下界传送门方块\n";
	int z=_getch ()-48;
	te++;
	if (z==1&&st.a[l].sl<3) return ;
		else if (z==2&&st.a[l].sl<4) return ;
			else if (z==3&&st.a[l].sl<4) return ;
				else if (z==4&&st.a[l].sl<5) return ;
					else if (z==5&&st.a[l].sl<8) return ;
						else if (z==6&&st.a[l].sl<7) return ;
							else if (z==7&&st.a[l].sl<4) return ;
								else if (z==8&&st.a[l].sl<9) return ;
	if (z==1||z==2||z==3) st.sh+=20;
		else st.hj+=2; 
	if (z==1) st.a[l].sl-=3;
		else if (z==2) st.a[l].sl-=4;
			else if (z==3) st.a[l].sl-=4; 
				else if (z==4) st.a[l].sl-=5;
					else if (z==5) st.a[l].sl-=8;
						else if (z==6) st.a[l].sl-=7;
							else if (z==7) st.a[l].sl-=4;
								else if (z==8) 
								{
									st.a[l].sl-=9;
									for (int i=1;i<=st.t;i++)
										if (st.a[i].name=="下界传送门")
										{
											st.a[i].sl++;
											return ; 
										}
									st.t++;
									st.a[st.t].name="下界传送门";
									st.a[st.t].sl++;
								}
}
bool _pd (int x,int y)
{
	for (int i=0;i<4;i++)
	{
		int tx=x+dx[i];
		int ty=y+dy[i];
		if (a[tx][ty].x=='v') return true;
	}
	return false;
}
bool __pd (int x,int y)
{
	for (int i=0;i<4;i++)
	{
		int tx=x+dx[i];
		int ty=y+dy[i];
		if (a[tx][ty].x=='q') return true;
	}
	return false;
}
int find (char s)
{
	if (s=='w') return 4-1;
	if (s=='s') return 2-1;
	if (s=='a') return 3-1;
	if (s=='d') return 1-1;
	return -1;
}
void wfk (char s)
{
	int x,y;
	if (a[st.x+dx[find (s)]][st.y+dy[find (s)]].x=='.') 
		switch (s)
		{
			case 'w':x=st.x-1,y=st.y;a[x][y].x=',';for (int i=1;i<=st.t;i++) if (st.a[i].name=="泥土") {st.a[i].sl++;return ;}st.a[++st.t].name="泥土";st.a[st.t].sl=1;break; 
			case 'a':x=st.x,y=st.y-1;a[x][y].x=',';for (int i=1;i<=st.t;i++) if (st.a[i].name=="泥土") {st.a[i].sl++;return ;}st.a[++st.t].name="泥土";st.a[st.t].sl=1;break;
			case 's':x=st.x+1,y=st.y;a[x][y].x=',';for (int i=1;i<=st.t;i++) if (st.a[i].name=="泥土") {st.a[i].sl++;return ;}st.a[++st.t].name="泥土";st.a[st.t].sl=1;break;
			case 'd':x=st.x,y=st.y+1;a[x][y].x=',';for (int i=1;i<=st.t;i++) if (st.a[i].name=="泥土") {st.a[i].sl++;return ;}st.a[++st.t].name="泥土";st.a[st.t].sl=1;break;
		}
			else 
				switch (s)
				{
					case 'w':x=st.x-1,y=st.y;a[x][y].x=',';for (int i=1;i<=st.t;i++) if (st.a[i].name=="圆石") {st.a[i].sl++;return ;}st.a[++st.t].name="圆石";st.a[st.t].sl=1;break; 
					case 'a':x=st.x,y=st.y-1;a[x][y].x=',';for (int i=1;i<=st.t;i++) if (st.a[i].name=="圆石") {st.a[i].sl++;return ;}st.a[++st.t].name="圆石";st.a[st.t].sl=1;break;
					case 's':x=st.x+1,y=st.y;a[x][y].x=',';for (int i=1;i<=st.t;i++) if (st.a[i].name=="圆石") {st.a[i].sl++;return ;}st.a[++st.t].name="圆石";st.a[st.t].sl=1;break;
					case 'd':x=st.x,y=st.y+1;a[x][y].x=',';for (int i=1;i<=st.t;i++) if (st.a[i].name=="圆石") {st.a[i].sl++;return ;}st.a[++st.t].name="圆石";st.a[st.t].sl=1;break;
				}
}
void ffk (char l)
{
	string s;
	cin>>s;
	int x,y;
	for (int i=1;i<=st.t;i++)
		if ((s=="x"&&st.a[i].name=="下界传送门")||(s=="n"&&st.a[i].name=="泥土")||(s=="y"&&st.a[i].name=="圆石")) 
		{
			st.a[i].sl--;
			switch (l)
			{
				case 'w':x=st.x-1,y=st.y;if (s=="x") a[x][y].x='p';else if (s=="n") a[x][y].x='.';else if (s=="y") a[x][y].x=',';break; 
				case 'a':x=st.x,y=st.y-1;if (s=="x") a[x][y].x='p';else if (s=="n") a[x][y].x='.';else if (s=="y") a[x][y].x=',';;break;
				case 's':x=st.x+1,y=st.y;if (s=="x") a[x][y].x='p';else if (s=="n") a[x][y].x='.';else if (s=="y") a[x][y].x=',';break;
				case 'd':x=st.x,y=st.y+1;if (s=="x") a[x][y].x='p';else if (s=="n") a[x][y].x='.';else if (s=="y") a[x][y].x=',';break;
			}
		}
}
bool ___pd ()
{
	for (int i=1;i<=30;i++)
		for (int j=1;j<=30;j++)
			if (a[i][j].x=='d'||a[i][j].x=='l')
				return true;
	return false;
}
void dl (int x,int y)
{
	system ("cls");
	Color (7);
	slow ("这是一个凋灵骷窿。。。。。。\n");
	sleep (1);
	int t=1000;
	while (t>0)
	{
		system ("cls");
		Color (7);
		cout<<"你的血量:";
		Color (4);
		cout<<st.xe<<endl;
		Color (7);
		cout<<"敌人的血量:";
		Color (1);
		cout<<t<<endl;
		Color (7);
		cout<<"你:";
		Color (4);
		for (int i=1;i<=ceil (st.xe/100.0);i++)
			cout<<"▄";
		cout<<"\n";
		Color (7);
		cout<<"敌人:";
		Color (1);
		for (int i=1;i<=ceil (t/100.0);i++)
			cout<<"▄";
		cout<<"\n输入c杀敌人\n";
		char s=_getch ();
		if (s=='c') t-=st.sh;
		st.xe-=100-st.hj;
	}
	for (int i=1;i<=st.t;i++)	
		if (st.a[i].name=="凋灵蛋")
		{
			st.a[i].sl++;
			return ;
		}
	st.a[++st.t].name="凋灵蛋",st.a[st.t].sl=1;
	for (int i=1;i<=ans;i++)
		if (d[i].x==x&&d[i].y==y)
		{
			for (int j=i+1;j<=ans;j++)
				d[j-1]=d[j];
			ans--; 
		}
}
void lr (int x,int y)
{
	system ("cls");
	Color (7);
	slow ("这是一个烈焰人。。。。。。\n");
	sleep (1);
	int t=1000;
	while (t>0)
	{
		system ("cls");
		Color (7);
		cout<<"你的血量:";
		Color (4);
		cout<<st.xe<<endl;
		Color (7);
		cout<<"敌人的血量:";
		Color (1);
		cout<<t<<endl;
		Color (7);
		cout<<"你:";
		Color (4);
		for (int i=1;i<=ceil (st.xe/100.0);i++)
			cout<<"▄";
		cout<<"\n";
		Color (7);
		cout<<"敌人:";
		Color (1);
		for (int i=1;i<=ceil (t/100.0);i++)
			cout<<"▄";
		cout<<"\n输入c杀敌人\n";
		char s=_getch ();
		if (s=='c') t-=st.sh;
		st.xe-=100-st.hj;
	}
	for (int i=1;i<=st.t;i++)	
		if (st.a[i].name=="烈焰棒")
		{
			st.a[i].sl++;
			return ;
		}
	st.a[++st.t].name="烈焰棒",st.a[st.t].sl=1;
	for (int i=1;i<=ans;i++)
		if (d[i].x==x&&d[i].y==y)
		{
			for (int j=i+1;j<=ans;j++)
				d[j-1]=d[j];
			ans--; 
		}
}
void md_main ()
{
	const int n=30;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)
			e[i][j]=a[i][j];
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)
			a[i][j].x='.';
	for (int i=1;i<=100;i++)
	{
		system ("cls");
		cout<<"游戏加载中——————\n";
		for (int j=1;j<=i/5;j++)
			cout<<"▄";
		cout<<"       "<<i<<"%\n";
	}
	char s=a[st.x][st.y].x,l;
	a[st.x][st.y].x='@';
	while (1)
	{
		system ("cls");
		if (st.xe<=0)
		{
			cout<<"\n\n\n\n";
			cout<<setw (45)<<"你死了!\n";
			cout<<setw (45)<<"按任意键重生\n";
			_getch ();
			st.xe=1000;
			continue; 
		}
		for (int i=1;i<=ans;i++)
		{
			int t;
			bool p=false;
			do
			{
				t=rand ()%5;
				if (t==4) {p=1;break;}
			}while (a[d[i].x+dx[t]][d[i].y+dy[t]].x!='q');
			if (p) continue;
			a[d[i].x+dx[t]][d[i].y+dy[t]].x=a[d[i].x][d[i].y].x;
			a[d[i].x][d[i].y].x='q';
			d[i].x+=dx[t],d[t].y+=dy[t];
		}
		Color (7);
		cout<<"血量:";
		Color (4);
		cout<<st.xe;
		Color (7);
		cout<<"          "<<"饱食度:"<<st.ba<<endl;
		cout<<"时间:"<<te<<endl;
		cout<<"坐标(当前区块上的)x:"<<st.x<<"   "<<"y:"<<st.y<<endl; 
		cout<<"按q键看规则\n";
		for (int i=1;i<=30;i++)
			for (int j=1;j<=30;j++)
				if (a[i][j].x=='@') a[i][j].x='.'; 
		a[st.x][st.y].x='@';
		for (int i=1;i<=30;i++)
		{
			for (int j=1;j<=30;j++)
				if (a[i][j].x=='.') Color (12),cout<<"■";
					else if (a[i][j].x=='X') Color (71),cout<<"~~";
						else if (a[i][j].x=='@') Color (1),cout<<"●";
							else if (a[i][j].x=='p') Color (3),cout<<"※";
								else if (a[i][j].x=='q') Color (102),cout<<"rf",Color (7);
									else if (a[i][j].x=='d') Color (8),cout<<"凋";
										else if (a[i][j].x=='l') Color (6),cout<<"烈";
											else if (a[i][j].x==',') Color (7),cout<<"■"; 
												else Color (12),cout<<"■";
			cout<<endl;
		}
		while (st.a[st.t].sl<=0&&st.t>1) st.t--;
		unsigned char t=_getch ();
		if (0) 
		{
			t=_getch ();
			
		}else
			{
				if (t=='q') gz ();
					else if (t=='w') {l=t;st.x--;a[st.x+1][st.y].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
						else if (t=='a') {l=t;st.y--;a[st.x][st.y+1].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
							else if (t=='s') {l=t;st.x++;a[st.x-1][st.y].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
								else if (t=='d') {l=t;st.y++;a[st.x][st.y-1].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
									else if (t=='e') ba ();
										else if (t=='r') {if (st.food<=0) continue;st.food--;st.xe+=10;st.ba+=99;}
											else if (t==27) bt (s); 
												else if (t=='t') {int s;s=_getch ()-48;p=s;}
													else if (t=='z') {if (st.food_good<=0) continue;st.food_good--;st.xe+=1000;st.ba+=99;}
														else if (t=='x') hc ();
															else if (t=='y') wfk (l);
																else if (t=='v') ffk (l); 
																	else if (t=='f') {for (int i=1;i<=st.t;i++) if (st.a[i].name=="烈焰棒"&&st.a[i].sl>=9){md_main ();break;}}
				te++;
			}
		if (s=='d') dl (st.x,st.y),s='q';
		if (s=='q')
			if (!___pd ()) 
			{
				if (p==1)
				{
					for (int i=1;i<=3;i++)
					{
						int x,y;
						do
						{
							x=rand ()%30+1;
							y=rand ()%30+1;
						}while (a[x][y].x!='q');
						a[x][y].x='d';
						d[++ans].x=x,d[ans].y=y;
					}
					for (int i=1;i<=2;i++)
					{
						int x,y;
						do
						{
							x=rand ()%30+1;
							y=rand ()%30+1;
						}while (a[x][y].x!='q');
						a[x][y].x='l';
						d[++ans].x=x,d[ans].y=y;
					}
				}else if (p==2)
				{
					for (int i=1;i<=6;i++)
					{
						int x,y;
						do
						{
							x=rand ()%30+1;
							y=rand ()%30+1;
						}while (a[x][y].x!='q');
						a[x][y].x='d';
						d[++ans].x=x,d[ans].y=y;
					}
					for (int i=1;i<=4;i++)
					{
						int x,y;
						do
						{
							x=rand ()%30+1;
							y=rand ()%30+1;
						}while (a[x][y].x!='q');
						a[x][y].x='l';
						d[++ans].x=x,d[ans].y=y;
					}
				}else if (p==3)
					{
						for (int i=1;i<=12;i++)
						{
							int x,y;
							do
							{
								x=rand ()%30+1;
								y=rand ()%30+1;
							}while (a[x][y].x!='q');
							a[x][y].x='d';
							d[++ans].x=x,d[ans].y=y;
						}
						for (int i=1;i<=8;i++)
						{
							int x,y;
							do
							{
								x=rand ()%30+1;
								y=rand ()%30+1;
							}while (a[x][y].x!='q');
							a[x][y].x='l';
							d[++ans].x=x,d[ans].y=y;
						}
					}
			}
		if (s=='X')
		{
			system ("cls");
			cout<<"这是一片岩浆\n";
			cout<<"你被烫死了!\n";
			cout<<"按任意键重生\n";
			_getch ();
			st.xe=1000;
			continue; 
		}
		if (s=='l') lr (st.x,st.y),s='q';
		if (s=='p') return ;
		if (st.ba<=0) st.xe-=5;
		if (s==',') continue;
		if (st.x<1) 
		{
			st.x=30;
			int t=rand ()%2;
			if (t==0)
			{
				s='q';
				for (int i=1;i<=n;i++)
					for (int j=1;j<=n;j++)
						a[i][j].x='q';
				for (int i=1;i<=rand ()%100+1;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='q');
					a[x][y].x='X';
				}
				continue;
			}
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='X';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.y<1) 
		{
			st.y=30;
			int t=rand ()%2;
			if (t==0)
			{
				s='q';
				for (int i=1;i<=n;i++)
					for (int j=1;j<=n;j++)
						a[i][j].x='q';
				for (int i=1;i<=rand ()%100+1;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='q');
					a[x][y].x='X';
				}
				continue;
			}
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='X';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.x>30) 
		{
			s='q';
			st.x=1;
			int t=rand ()%2;
			if (t==0)
			{
				for (int i=1;i<=n;i++)
					for (int j=1;j<=n;j++)
						a[i][j].x='q';
				for (int i=1;i<=rand ()%100+1;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='q');
					a[x][y].x='X';
				}
				continue;
			}
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='X';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.y>30) 
		{
			s='q';
			st.y=1;
			int t=rand ()%2;
			if (t==0)
			{
				for (int i=1;i<=n;i++)
					for (int j=1;j<=n;j++)
						a[i][j].x='q';
				for (int i=1;i<=rand ()%100+1;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='q');
					a[x][y].x='X';
				}
				continue;
			}
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='X';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (te>=240) te=0;
	}
}
void xj_main ()
{
	const int n=30;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)
			c[i][j].x=a[i][j].x;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)
			a[i][j].x='.';
	system ("cls");
	for (int i=1;i<=100;i++)
	{
		system ("cls");
		cout<<"游戏加载中——————\n";
		for (int j=1;j<=i/5;j++)	
			cout<<"▄";
		cout<<"       "<<i<<"%\n";
	}
	for (int i=1;i<=rand ()%250+1;i++)
	{
		int x,y;
		do
		{
			x=rand ()%n+1;
			y=rand ()%n+1;
		}while (a[x][y].x!='.');
		a[x][y].x='X';
	}
	char s=a[st.x][st.y].x,l;
	a[st.x][st.y].x='@';
	while (1)
	{
		system ("cls");
		if (st.xe<=0)
		{
			cout<<"\n\n\n\n";
			cout<<setw (45)<<"你死了!\n";
			cout<<setw (45)<<"按任意键重生\n";
			_getch ();
			st.xe=1000;
			continue; 
		}
		for (int i=1;i<=ans;i++)
		{
			int t;
			bool p=false;
			do
			{
				t=rand ()%5;
				if (t==4) {p=1;break;}
			}while (a[d[i].x+dx[t]][d[i].y+dy[t]].x!='q');
			if (p) continue;
			a[d[i].x+dx[t]][d[i].y+dy[t]].x=a[d[i].x][d[i].y].x;
			a[d[i].x][d[i].y].x='q';
			d[i].x+=dx[t],d[t].y+=dy[t];
		}
		Color (7);
		cout<<"血量:";
		Color (4);
		cout<<st.xe;
		Color (7);
		cout<<"          "<<"饱食度:"<<st.ba<<endl;
		cout<<"时间:"<<te<<endl;
		cout<<"坐标(当前区块上的)x:"<<st.x<<"   "<<"y:"<<st.y<<endl; 
		cout<<"按q键看规则\n";
		for (int i=1;i<=30;i++)
			for (int j=1;j<=30;j++)
				if (a[i][j].x=='@') a[i][j].x='.'; 
		a[st.x][st.y].x='@';
		for (int i=1;i<=30;i++)
		{
			for (int j=1;j<=30;j++)
				if (a[i][j].x=='.') Color (12),cout<<"■";
					else if (a[i][j].x=='X') Color (71),cout<<"~~";
						else if (a[i][j].x=='@') Color (1),cout<<"●";
							else if (a[i][j].x=='p') Color (3),cout<<"※";
								else if (a[i][j].x=='q') Color (102),cout<<"rf",Color (7);
									else if (a[i][j].x=='d') Color (8),cout<<"凋";
										else if (a[i][j].x=='l') Color (6),cout<<"烈";
											else if (a[i][j].x==',') Color (7),cout<<"■"; 
												else Color (12),cout<<"■";
			cout<<endl;
		}
		while (st.a[st.t].sl<=0&&st.t>1) st.t--;
		unsigned char t=_getch ();
		if (0) 
		{
			t=_getch ();
			
		}else
			{
				if (t=='q') gz ();
					else if (t=='w') {l=t;st.x--;a[st.x+1][st.y].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
						else if (t=='a') {l=t;st.y--;a[st.x][st.y+1].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
							else if (t=='s') {l=t;st.x++;a[st.x-1][st.y].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
								else if (t=='d') {l=t;st.y++;a[st.x][st.y-1].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
									else if (t=='e') ba ();
										else if (t=='r') {if (st.food<=0) continue;st.food--;st.xe+=10;st.ba+=99;}
											else if (t==27) bt (s); 
												else if (t=='t') {int s;s=_getch ()-48;p=s;}
													else if (t=='z') {if (st.food_good<=0) continue;st.food_good--;st.xe+=1000;st.ba+=99;}
														else if (t=='x') hc ();
															else if (t=='y') wfk (l);
																else if (t=='v') ffk (l); 
																	else if (t=='f') {for (int i=1;i<=st.t;i++) if (st.a[i].name=="烈焰棒"&&st.a[i].sl>=9){md_main ();break;}}
				te++;
			}
		if (s=='d') dl (st.x,st.y),s='q';
		if (s=='q')
			if (!___pd ()) 
			{
				if (p==1)
				{
					for (int i=1;i<=3;i++)
					{
						int x,y;
						do
						{
							x=rand ()%30+1;
							y=rand ()%30+1;
						}while (a[x][y].x!='q');
						a[x][y].x='d';
						d[++ans].x=x,d[ans].y=y;
					}
					for (int i=1;i<=2;i++)
					{
						int x,y;
						do
						{
							x=rand ()%30+1;
							y=rand ()%30+1;
						}while (a[x][y].x!='q');
						a[x][y].x='l';
						d[++ans].x=x,d[ans].y=y;
					}
				}else if (p==2)
				{
					for (int i=1;i<=6;i++)
					{
						int x,y;
						do
						{
							x=rand ()%30+1;
							y=rand ()%30+1;
						}while (a[x][y].x!='q');
						a[x][y].x='d';
						d[++ans].x=x,d[ans].y=y;
					}
					for (int i=1;i<=4;i++)
					{
						int x,y;
						do
						{
							x=rand ()%30+1;
							y=rand ()%30+1;
						}while (a[x][y].x!='q');
						a[x][y].x='l';
						d[++ans].x=x,d[ans].y=y;
					}
				}else if (p==3)
					{
						for (int i=1;i<=12;i++)
						{
							int x,y;
							do
							{
								x=rand ()%30+1;
								y=rand ()%30+1;
							}while (a[x][y].x!='q');
							a[x][y].x='d';
							d[++ans].x=x,d[ans].y=y;
						}
						for (int i=1;i<=8;i++)
						{
							int x,y;
							do
							{
								x=rand ()%30+1;
								y=rand ()%30+1;
							}while (a[x][y].x!='q');
							a[x][y].x='l';
							d[++ans].x=x,d[ans].y=y;
						}
					}
			}
		if (s=='X')
		{
			system ("cls");
			cout<<"这是一片岩浆\n";
			cout<<"你被烫死了!\n";
			cout<<"按任意键重生\n";
			_getch ();
			st.xe=1000;
			continue; 
		}
		if (s=='l') lr (st.x,st.y),s='q';
		if (s=='p') return ;
		if (st.ba<=0) st.xe-=5;
		if (s==',') continue;
		if (st.x<1) 
		{
			st.x=30;
			int t=rand ()%2;
			if (t==0)
			{
				s='q';
				for (int i=1;i<=n;i++)
					for (int j=1;j<=n;j++)
						a[i][j].x='q';
				for (int i=1;i<=rand ()%100+1;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='q');
					a[x][y].x='X';
				}
				continue;
			}
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='X';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.y<1) 
		{
			st.y=30;
			int t=rand ()%2;
			if (t==0)
			{
				s='q';
				for (int i=1;i<=n;i++)
					for (int j=1;j<=n;j++)
						a[i][j].x='q';
				for (int i=1;i<=rand ()%100+1;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='q');
					a[x][y].x='X';
				}
				continue;
			}
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='X';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.x>30) 
		{
			s='q';
			st.x=1;
			int t=rand ()%2;
			if (t==0)
			{
				for (int i=1;i<=n;i++)
					for (int j=1;j<=n;j++)
						a[i][j].x='q';
				for (int i=1;i<=rand ()%100+1;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='q');
					a[x][y].x='X';
				}
				continue;
			}
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='X';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.y>30) 
		{
			s='q';
			st.y=1;
			int t=rand ()%2;
			if (t==0)
			{
				for (int i=1;i<=n;i++)
					for (int j=1;j<=n;j++)
						a[i][j].x='q';
				for (int i=1;i<=rand ()%100+1;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='q');
					a[x][y].x='X';
				}
				continue;
			}
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='X';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (te>=240) te=0;
	}
}
void mc_main ()
{
	char s=a[st.x][st.y].x,l;
	a[st.x][st.y].x='@';
	while (1)
	{
		int x=st.x,y=st.y;
		system ("cls");
		if (st.xe<=0)
		{
			cout<<"\n\n\n\n";
			cout<<setw (45)<<"你死了!\n";
			cout<<setw (45)<<"按任意键重生\n";
			_getch ();
			st.xe=1000;
			continue; 
		}
		Color (7);
		cout<<"血量:";
		Color (4);
		cout<<st.xe;
		Color (7);
		cout<<"          "<<"饱食度:"<<st.ba<<endl;
		cout<<"时间:"<<te<<endl;
		cout<<"坐标(当前区块上的)x:"<<st.x<<"   "<<"y:"<<st.y<<endl; 
		cout<<"按q键看规则\n";
		for (int i=1;i<=cnt;i++)
		{
			int s=rand ()%5;
			if (s==4) continue;
			int x=b[i].x,y=b[i].y; 
			do
			{
				s=rand ()%5;
				if (s==4) break;
			}while (x+dx[s]<1||x+dx[s]>30||y+dy[s]<1||y+dy[s]>30||a[x+dx[s]][y+dy[s]].x!='.');
			if (s==4) continue; 
			char q=a[b[i].x][b[i].y].x;
			a[b[i].x][b[i].y].x='.';
			b[i].x+=dx[s];
			b[i].y+=dy[s];
			a[b[i].x][b[i].y].x=q;
		}
		for (int i=1;i<=30;i++)
			for (int j=1;j<=30;j++)
				if (a[i][j].x=='@')
					a[i][j].x='.';
		a[st.x][st.y].x='@';
		for (int i=1;i<=30;i++)
			for (int j=1;j<=30;j++)
				if (a[i][j].x!='.'&&a[i][j].x!='q'&&a[i][j].x!='z'&&a[i][j].x!='v'&&a[i][j].x!='p'&&a[i][j].x!='T'&&a[i][j].x!='@')
					a[i][j].x='.'; 
		for (int i=1;i<=30;i++)
		{
			a[st.x][st.y].x='@';
			for (int j=1;j<=30;j++)
				if (a[i][j].x=='.'&&!_pd (i,j)&&!__pd (i,j)) Color (2),cout<<"■";
					else if (a[i][j].x=='.'&&!__pd (i,j)) Color (5),cout<<"■";
						else if (a[i][j].x=='.'&&!_pd (i,j)) Color (7),cout<<"■";
							else if (a[i][j].x=='@'&&i==st.x&&j==st.y) Color (1),cout<<"●";
								else if (a[i][j].x=='T') Color (2),cout<<"γ";
									else if (a[i][j].x=='v') Color (5),cout<<"僵";
										else if (a[i][j].x=='q') Color (7),cout<<"白";
											else if (a[i][j].x=='z') Color (2),cout<<"帕"; 
												else if (a[i][j].x==',') Color (7),cout<<"■";
													else if (a[i][j].x=='p') Color (3),cout<<"※";
														else Color (2),cout<<"■";
			cout<<endl;
		}
		while (st.a[st.t].sl<=0&&st.t>1) st.t--;
		unsigned char t=_getch ();
		if (t==0||t==-32) 
		{
			t=_getch ();
			
		}else
			{
				if (t=='q') gz ();
					else if (t=='w') {l=t;st.x--;st.y=y;a[st.x+1][st.y].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
						else if (t=='a') {l=t;st.y--;st.x=x;a[st.x][st.y+1].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
							else if (t=='s') {l=t;st.x++;st.y=y;a[st.x-1][st.y].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
								else if (t=='d') {l=t;st.y++;st.x=x;a[st.x][st.y-1].x=s;s=a[st.x][st.y].x;a[st.x][st.y].x='@';st.ba--;}
									else if (t=='e') ba ();
										else if (t=='r') {if (st.food<=0) continue;st.food--;st.xe+=10;st.ba+=99;}
											else if (t==27) bt (s); 
												else if (t=='t') {int s;s=_getch ()-48;p=s;}
													else if (t=='z') {if (st.food_good<=0) continue;st.food_good--;st.xe+=1000;st.ba+=99;}
														else if (t=='x') hc ();
															else if (t=='y') wfk (l);
																else if (t=='v') ffk (l); 
				te++;
			}
		if (st.ba<=0) st.xe-=5;
		if (s=='T')
		{
			system ("cls");
			Color (7);
			slow ("这是一棵树。。。。。。\n");
			a[st.x][st.y].t=75;
			while (a[st.x][st.y].t>0) ks (); 
			if (pd ("木板")) st.a[pd ("木板")].sl+=20;
				else st.a[++st.t].name="木板",st.a[st.t].sl=20;
			cout<<"          "<<"饱食度:"<<st.ba<<endl;
			cout<<"按q键看规则\n";
			for (int i=1;i<=30;i++)
			{
				for (int j=1;j<=30;j++)
					if (a[i][j].x=='.'&&!_pd (i,j)) Color (2),cout<<"■";
						else if (a[i][j].x=='.') Color (3),cout<<"■";
							else if (a[i][j].x=='@') Color (1),cout<<"●";
								else if (a[i][j].x=='T') Color (2),cout<<"γ";
									else if (a[i][j].x=='v') Color (3),cout<<"僵";
										else if (a[i][j].x=='q') Color (7),cout<<"白";
											else if (a[i][j].x=='z') Color (2),cout<<"帕";
												else if (a[i][j].x==',') Color (7),cout<<"■";
													else if (a[i][j].x=='p') Color (3),cout<<"※";
				cout<<endl;
			}
			s='.';
		}
		if (s=='p') 
		{
			xj_main ();
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x=c[i][j].x;
		}
		if (s==',') continue;
		if (st.x<1) 
		{
			st.x=30;
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='T';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.y<1) 
		{
			st.y=30;
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='T';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.x>30) 
		{
			st.x=1;
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='T';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (st.y>30) 
		{
			st.y=1;
			for (int i=1;i<=30;i++)
				for (int j=1;j<=30;j++)
					a[i][j].x='.';
			for (int i=1;i<=rand ()%100+1;i++)
			{
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='T';
			}
			s=a[st.x][st.y].x;
			a[st.x][st.y].x='@';
		}
		if (te==240) te=0;
		if (((te>=180&&te<=239)||(te>=0&&te<=60))&&!yg ())
		{
			if (p==1) 
			{
				cnt=0;
				for (int i=1;i<=2;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='.');
					a[x][y].x='v';
					b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
				}
				for (int i=1;i<=2;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='.');
					a[x][y].x='q';
					b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
				}
				int x,y;
				do
				{
					x=rand ()%30+1;
					y=rand ()%30+1;
				}while (a[x][y].x!='.');
				a[x][y].x='z';
				b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
			}else if (p==2)
			{
				for (int i=1;i<=4;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='.');
					a[x][y].x='v';
					b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
				}
				for (int i=1;i<=4;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='.');
					a[x][y].x='q';
					b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
				}
				for (int i=1;i<=2;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='.');
					a[x][y].x='z';
					b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
				}
			}else if (p==3)
			{
				for (int i=1;i<=4;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='.');
					a[x][y].x='v';
					b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
				}
				for (int i=1;i<=4;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='.');
					a[x][y].x='q';
					b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
				}
				for (int i=1;i<=2;i++)
				{
					int x,y;
					do
					{
						x=rand ()%30+1;
						y=rand ()%30+1;
					}while (a[x][y].x!='.');
					a[x][y].x='z';
					b[++cnt].x=x,b[cnt].y=y,b[cnt].z=1000;
				}
			}
		}
		if (s=='v') js (st.x,st.y);
			else if (s=='q') xb (st.x,st.y);
				else if (s=='z') qp (st.x,st.y);
		s='.'; 
		for (int i=1;i<st.t;i++)
			for (int j=i+1;j<=st.t;j++)
				if (st.a[i].sl<st.a[j].sl)
				{
					int t=st.a[i].sl;
					st.a[i].sl=st.a[j].sl;
					st.a[j].sl=t;
				}
	}
}
int zh (string s)
{
	int t=0,l=s.size ();
	for (int i=0;i<l;i++)
		t=t*10+s[i]-48;
	return t;
}
void HideCursor ()
{
	CONSOLE_CURSOR_INFO cursor_info = {1, 0};
	SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cursor_info);
}
void smile(){
	while(1){
		system("cls");
		Color (32);
		cout<<"                                                                                                               \n";
		cout<<"                 ■■      ■■ ■       ■     ■■ ■ ■■                         ■              ■    ■■\n";
		cout<<" ■■    ■■      ■      ■    ■     ■        ■ ■ ■     ■■■                ■              ■    ■■\n";
		cout<<" ■■    ■■      ■■  ■■     ■  ■          ■ ■ ■   ■      ■  ■  ■■    ■        ■■  ■    ■■\n";
		cout<<"     ■■          ■  ■  ■       ■            ■ ■ ■   ■      ■    ■    ■  ■      ■    ■■    ■■\n";
		cout<<"   ■■■■        ■  ■  ■       ■              ■ ■    ■      ■    ■        ■      ■    ■■    ■■\n";
		cout<<"   ■■■■        ■      ■      ■               ■ ■    ■      ■    ■        ■      ■    ■■        \n";
		cout<<"   ■    ■        ■      ■     ■                ■ ■    ■      ■    ■        ■ ■   ■    ■■    ■■\n";
		cout<<"                 ■■■  ■■■  ■                 ■ ■      ■■■                 ■■     ■■  ■■  ■■\n";
		cout<<"                                                                                                               \n";
        Color (2);
		cout<<"                                            欢迎来到 mc 游戏!!!\n";
		cout<<"                                                按任意键继续~~";
		for(int i=1;i<201;i++){
			Sleep(1);
			if(p)return;
		}system("cls");
		cout<<"                                                                                                               \n";
		cout<<"                 ■■      ■■ ■       ■     ■■ ■ ■■                         ■              ■    ■■\n";
		cout<<" ■■    ■■      ■      ■    ■     ■        ■ ■ ■     ■■■                ■              ■    ■■\n";
		cout<<" ■■    ■■      ■■  ■■     ■  ■          ■ ■ ■   ■      ■  ■  ■■    ■        ■■  ■    ■■\n";
		cout<<"     ■■          ■  ■  ■       ■            ■ ■ ■   ■      ■    ■    ■  ■      ■    ■■    ■■\n";
		cout<<"   ■■■■        ■  ■  ■       ■              ■ ■    ■      ■    ■        ■      ■    ■■    ■■\n";
		cout<<"   ■■■■        ■      ■      ■               ■ ■    ■      ■    ■        ■      ■    ■■        \n";
		cout<<"   ■    ■        ■      ■     ■                ■ ■    ■      ■    ■        ■ ■   ■    ■■    ■■\n";
		cout<<"                 ■■■  ■■■  ■                 ■ ■      ■■■                 ■■     ■■  ■■  ■■\n";
		cout<<"                                                                                                               \n";
        Color (2);
		cout<<"                                            欢迎来到 mc 游戏!!!\n";
		cout<<"                                                按任意键继续~~";
		for(int i=1;i<26;i++){
			Sleep(1);
			if(p)return;
		}
	}
}
int main ()
{
	srand (time (0));
	SetConsoleTitle ("mc");
	HideCursor ();
	system ("mode con cols=111 lines=50"); 
	ifstream fin;
	string s,t,l;
	thread t1 (smile);
	char ch=_getch ();
	t1.join ();
	Color (7);
	system ("cls");
	cout<<"欢迎来到mc(自编),版本:0.8.1\n";
	cout<<"伟大的作者大大的赞扬:hhhcj,协助者:hhztl\n";
	cout<<"请输入你的用户名:";
	cin>>t;
	cout<<"请输入你的密码:";
	char q;
	while (q!='\r')
	{
		q=_getch ();
		if (q=='\r') break;
		l+=q;
		cout<<'*';
	}
	fin.open ("容器.s");
	fin>>s;
	if (s!=t) return 0;
	fin>>s;
	if (s!=l) return 0;
	fin.close ();
	for (int i=1;i<=100;i++)
	{
		system ("cls");
		Color (7); 
		cout<<"游戏加载中——————      "<<i<<'%'<<endl;
		Color (1);
		for (int j=1;j<=i*0.55;j++)
			cout<<"▄";
		Sleep (1);
	}
	Sleep (1000);
	system ("cls");
	fin.open ("地图.map");
	for (int i=1;i<=30;i++)
	{
		fin>>s;
		for (int j=1;j<=30;j++)
			a[i][j].x=s[j-1]; 
	} 
	cout<<1;
	fin.close ();
	fin.open ("数据.s");
	fin>>s;
	st.x=zh (s);
	fin>>s;
	st.y=zh (s);
	for (int i=1;i<=35;i++)
	{
		fin>>s;
		st.a[i].name=s;
		fin>>s;
		st.a[i].sl=zh (s);
		cout<<i;
	}
	cout<<2;
	for (int i=1;i<=34;i++)
		for (int j=i+1;j<36;j++)
			if (st.a[i].sl<st.a[j].sl)
				swap (st.a[i],st.a[j]); 
	st.t=35;
	while (st.a[st.t].sl==0) st.t--;
	fin>>s;
	st.sh=zh (s);
	fin>>s;
	st.hj=zh (s); 
	fin>>s;
	st.food_good=zh (s);
	fin>>s; 
	cnt=zh (s);
	fin.close ();
	st.xe=1000;
	st.ba=1000;
	st.food=100;
	st.sh=150; 
	te=0;
	cout<<3<<endl;
	mc_main ();
	return 0;
}
2024/4/3 17:06
加载中...