#define PRINTERROR 0
#define CHOOSERROR 0
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#define DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
#define None 0
#define Black 0
#define Blue 1
#define Green 2
#define Grean 3
#define Red 4
#define Pink 5
#define Yellow 6
#define Grey 8
#define grey 7
#define blue 9
#define green 10
#define graan 11
#define red 12
#define pink 13
#define yellow 14
#define white 15
#define bk0 240
#define bk1 112
#define bk2 128
#define bk3 0
#define DayLong 2000
typedef unsigned int ui;
using namespace std;
int fx;
int yx,yy;
bool gm=false;
bool xd=false;
bool ylz=false,Hurt;
short ssl;
int oo=0,kl=0,FN=0,hj;
int xf[9]= {0,0,0,-1,-1,-1,1,1,1},yf[9]= {0,-1,1,-1,0,1,-1,0,1};
int Attack=0,Rape=0,YLY=0,seed=0;
int Day=0;
long long rt=0;
bool jx;
string BODY[16]= {"","()","xx","/\\"," >"};
bool mz=false;
string head[7]= {"()","[]","{}","^_^","囧","TT","OO"};
string feet[7]= {"/\\","/||\\","/[]\\","[]","oo","LL"};
string foot[7]= {" \\","/||\\","/[]\\","[]","88"," L"};
int hd;
int ft;
bool water=false;
bool sc=false;
bool gly=false;
bool d=false;
int tx,ty;
int world=50;
int _Seed[101];
bool ss=false,sd=false;
int date;
string DAY[11]= {"正常","晴雨","阴雨","夜雨","晴雪","阴雪","夜雪","闪电","阴闪","夜闪","随机雨"};
/* 0 1 2 3 4 5 */
string names;//="0空气 1基岩2泥土3草方块4木头5石头6沙子7玻璃8铁矿9金矿0钻石1煤炭2木板3木棍4火把5 树叶6工作7箱子8木稿9石镐0铁锭1金锭2铁镐3金镐4钻镐5熔炉6木剑7石剑8铁剑9金剑0钻剑1苹果2面包3床4地狱岩5地狱砖6刷怪笼7-2水 3-6岩浆 7黑曜石 8桶9水桶0岩浆桶1烈焰棒 2传送门";
string name[128];
string BLOCK[128]= {" ","▓ ","▓ ","MM","■","■","※","□","〓","〓","◆","〓","〓","| ","i ","▓ ","##","[]","/\\","/\\","◆","◆","/\\","/\\","/\\","##","||","||","||","||","||","●","--","#]","■","▓ ","##","█ ","▇ ","▆ ","▅ ","▃ ","█ ","█ ","▆ ","▃ ","█ ","■","U/","U#","U#","--","◆","十","■","__","L","■","k","■","||","__","**","/","■","●","▓ ","●","〓"," 0"," X"," ?","/\\","||","||","/\\","■","^^","■","■","火","||","∵","●"};
int BLOCK_COL[128]= {Black,Black,Yellow,Green,Yellow,Grey,Yellow,blue,grey,yellow,blue,Grey,Yellow,Yellow,Red,Green,Yellow,Yellow,Yellow,Grey,grey,yellow,grey,yellow,blue,Grey,Yellow,Grey,grey,yellow,blue,Red,Yellow,Red,Pink,Pink,Black,Blue,Blue,Blue,Blue,Blue,Red,Red,Red,Red,Red,Black,Black,Blue,Red,Red,Red,Yellow,white,Grey,Yellow,Black,Black,Red,Blue,Blue,white,Blue,blue,blue,Yellow,Blue,Green,Red,Grean,Black,Black,Black,Red,Grean,Yellow,Red,grey,Grey,Red,Yellow,Black,Green};
int Hard[128]= {None,60000,100,0,200,500,100,0,500,500,700,400,200,0,10,30,200,200,0,0,0,0,0,0,0,500,0,0,0,0};
int Hardmu[128]= {None,60000,100,0,200,200,100,0,500,500,700,220,200,0,10,30,200,200,0,0,0,0,0,0,0,200,0,0,0};
int Hardsh[128]= {None,60000,100,0,200,100,100,0,150,140,700,120,200,0,10,30,200,200,0,0,0,0,0,0,0,100,0,0,0};
int Hardti[128]= {None,60000,100,0,200,70,100,0,70,70,70,60,200,0,10,30,200,200,0,0,0,0,0,0,0,70,0,0,0};
int Hardji[128]= {None,60000,100,0,200,30,100,0,30,30,40,20,200,0,10,30,200,200,0,0,0,0,0,0,0,30,0,0,0};
int Hardzu[128]= {None,60000,100,0,200,60,100,0,60,60,60,60,200,0,10,30,200,200,0,0,0,0,0,0,0,60,0,0,0};
int CANPUT[128]= {0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
string NODE[128][2]= {{"xx","/\\"},{"[]","/\\"},{"[]","^^"},{"BO","SS"},{"[]","||"},{"[]","[]"},{"()","::"},{"][",".."},{"()","/\\"},{"[:",":\\"}};
string gjqy[128][2]= {{"=x","/\\"},{"{}","/\\"},{"[]","<>"},{"BS","OS"},{"[]","//"},{"[]","__"},{"[]","=="},{"][","::"},{"()","/\\"},{":]","/:"}};
int no=9;
int NODE_COL[16]= {Green,Green,Red,Grey,white,Yellow,Grey,Red},tot,tot1;
string tanghua[1001];
int ttott;
string hua[1001]= {"","你看不到明天的太阳了","挖矿,挖矿,钻石,钻石!","村民的低语","...","???","!!!","?!?","asdasd","114514","dsfs","dsfadsf","????","icu","你个老六"};
int toptop=14;
int dsd=1;
int thc[1001];
//FILE *nowworld;
int tott;
int xzx[1001],xzy[1001];
ui s;
ui frandf(ui x) {
x ^= x << 13;
x ^= x >> 17;
x ^= x << 5;
return s = x;
}
void add(string a,int b) {
tanghua[++ttott]=a;
thc[ttott]=b;
}
void GOTO(int x,int y) {
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
HANDLE hConsoleOut;
hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsoleOut,&csbiInfo);
csbiInfo.dwCursorPosition.Y = x;
csbiInfo.dwCursorPosition.X = y;
SetConsoleCursorPosition(hConsoleOut,csbiInfo.dwCursorPosition);
}
void setcolor(int bkcol,int col) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),bkcol+col);
}
void th() {
system("cls");
for(int i=dsd; i<=ttott; i++) {
setcolor(bk0,thc[i]);
cout<<tanghua[i]<<endl;
}
system("pause");
}
struct ylb {
int x,y,gd;
};
ylb yl[1001];
int tt;
struct CD {
int x=0,y=0;
} cdlist[101][500010],boxlist[101][50010];
struct sp {
int n,n1;
int s,s1;
};
sp shop[4];
struct GUI {
int heal,node,x,y,Delete,jl;
bool hurt=false;
bool make=false;
bool attack=false;
} wor[70];
/* 背包:4*9 */
struct BAG {
int thing=0,num=0,nj=0;
} bag[7][16];
int Health,Eat,Time;
int UPDOWN_SPEED=0,now=1;
struct note {
int x2,y2;
string title;
string nr;
};
note pad[259][1028];
struct xc {
int x,y;
int R;
};
xc sf[9];
int x,y,move,DIE;
double Rx,Ry;
int xj[259][1028];
int block[300][2000];
string xg[259][1028];
int rs[259][1028];
int xga[259][1028],xgb[259][1028];
BAG box[259][1028][16];
int bk=bk0,op,Dpx[1028]= {200};
char my_name[1001];
char npc_name[1001][1001]={"","gyx","出征","嬴政","秦始皇","ETO成员","三体人","oh","god","God","密码","萌萌","plase","a_wisard","what?","no!","???","说话呀!","sun","kunkun","haha"};
int Hc[64][10]= {{0,12,12,12,12,16},{0,4,0,0,0,12},{0,0,4,0,0,12},{0,0,0,4,0,12},{0,0,0,0,4,12},{0,12,0,0,0,13},{0,0,12,0,0,13},{0,0,0,12,0,13},{0,0,0,0,12,13},{0,11,0,13,0,14},{0,0,11,0,13,14}};
int Hc2[64][32]= {{0,20,0,20,0,20,0,0,0,0,48},{0,12,12,0,12,12,0,0,0,0,16},{0,4,0,0,0,0,0,0,0,0,12},{0,12,0,0,0,0,0,0,0,0,13},{0,11,0,0,0,13,0,0,0,0,14},{0,5,5,5,5,0,5,5,5,5,25},{0,12,12,12,0,13,0,0,13,0,18},{0,5,5,5,0,13,0,0,13,0,19},{0,20,20,20,0,13,0,0,13,0,22},{0,21,21,21,0,13,0,0,13,0,23},{0,10,10,10,0,13,0,0,13,0,24},{0,0,12,0,0,12,0,0,13,0,26},{0,0,5,0,0,5,0,0,13,0,27},{0,0,21,0,0,21,0,0,13,0,28},{0,0,22,0,0,22,0,0,13,0,29},{0,0,10,0,0,10,0,0,13,0,30}};
int JS(int,int);
bool ccek(int,int);
bool c_lava(int,int);
bool c_fire(int,int);
struct NPC {
int x;
int y;
string name;
int heal=10;
bool dead_ok=true,hurt=false;
int now=1;
BAG bag[4];
int mbx,mby;
void npc_ai() {
//it is the old ai,it is not like a human. And it will compling error when it x=0,y=0.
/*if(!dead_ok) {
while(!CANPUT[bag[now].thing]) {
bag[now].thing=rand()%80;
bag[now].num=rand()%65;
}
if(block[x-1][y]==0)x--;
int where=rand()%8+1;
if(block[x+xf[where]][y+yf[where]]!=0) {
block[x+xf[where]][y+yf[where]]=0;
if(rand()%2==1&&(xf[where]!=0||yf[where]!=0)) {
x=x+xf[where];
y=y+yf[where];
}
} else {
if(rand()%2==1&&(xf[where]!=0||yf[where]!=0)) {
x=x+xf[where];
y=y+yf[where];
}
if(rand()%2==1) {
block[x+xf[where]][y+yf[where]]=bag[now].thing;
bag[now].num--;
}
}
if(rand()%5==1) {
x+=2;
block[x-1][y]=bag[now].thing;
block[x-2][y]=bag[now].thing;
}
if(bag[now].num==0)
now++;
if(now==4) {
now=1;
bag[now].