/*
	Version
	1.0.0_beta_C
	2024/3/26
*/
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#define cls system("cls")
#define et cout<<endl
#define LEVEL_UP 0.5
#define pause system("pause")
using namespace std;
string name;
int enemy_level;
string FUS6231BCK;
int max_tili=100;
int zhongji_tili_need=30;
int shanbi_tili_need=10;
int tili_huifu=15;
int item_id;
int free_item_id=100000;
int skill_id=500000;
int fast_stroy=0;
int choose_count=0;
int money=1000;//开局给1000,良心 
string citiao[]={"bigdamage","smalldamage","bigdefend","smalldefend","bighealth","smallhealth","critical_hit_probability","critical_hit_damage"};
string citiaoname[]={"攻击力","攻击力","防御力","防御力","生命值","生命值","暴击率","暴击伤害"};
string citiaoname_more[]={"%","","%","","%","","%","%"};
string _places[20][100]={{},
{"风之国","风车镇",""},
{"岩之国","群岩城","众岩矿坑"},
{"雷之国",""},
{"草之国",""},
{"水之国"},
{"火之国"},
{"冰之国"}};
string special_places[]={"宝石矿洞","地牢"};
double zhucitiao_up[]={2.3,15,2.9,53,2.3,239,1.5,3.1};
double _zhucitiao[]={2.9,26,3.2,41,2.9,239,2.6,3.3};
double zb_star[]={0,0.1,0.24,0.48,0.8,1};
double fucitiao_up[10][10]={{4.1,4.7,5.3,5.8},{14,16,18,19},{5.1,5.8,6.6,7.3},{16,19,21,23},{4.1,4.7,5.3,5.8},{209,231,269,299},{2.7,3.1,3.5,3.9},{5.4,6.2,7.0,7.8}};
int zz_exp[]={0,420,840,1260,2520,3780};
int equipment_exp_need[10][50]={{},
	{0,600,725,850,975},
	{0,1200,1495,1770,2045},
	{0,1800,2225,2650,3100,3550,4000,4500,5000,5525,6075,6625,7225},
	{0,2400,2975,3550,4125,4725,5350,6000,6675,7375,8100,8850,9625,10425,12125,14075,16300},
	{0,3000,3725,4425,5150,5900,6675,7500,8350,9225,10125,11050,12025,13025,15150,17600,20375,23500,27050,31050,35575}};
int player_exp_need[]={0,0,1000,1325,1700,2150,2625,3150,3725,4350,5000,5700,6450,7225,8050,8925,9825,10750,11725,12725,13775,14875,16800,18000,19250,20550,21875,23250,24650,26100,
27575,29100,30650,32250,33875,35550,37250,38975,40750,42575,44425,46300,50625,52700,54775,56900,59075,61275,63525,65800,68125,70475,76500,79050,81650,84275,86950,89650,92400,
95175,98000,100875,108950,112050,115175,118325,121525,124775,128075,131400,134775,138175,148700,152375,156075,159825,163600,167425,171300,175225,179175,183175,216225,243025,
273100,306800,344600,386950,434425,487625,547200};
int eexp_need[]={0,0,375,500,625,725,850,950,1075,1200,1300,1425,1525,1650,1775,1875,2000,2375,2500,2625,2775,2825,3425,3725,4000,4300,4575,4875,5150,5450,5725,6025,6300,6600,6900,
7175,7475,7750,8050,8325,8625,10550,11525,12475,13450,14400,15350,16325,17275,18250,19200,26400,28800,31200,33600,36000,232350,258950,285750,312825,340125};
int item_count[10][10];
int bag[10][10000];
int ids[10][10][10000];
bool only_see_have=false;
int wuqi_id=1000000;
int rd(int l,int r){
	return rand()%(r-l+1)+l;
}
string to_string(int n){
	if(n==0)return "0";
	string t;
	bool f=false;
	if(n<0){
		f=true;
		n=-n;
	}
	while(n){
		t=char(n%10+'0')+t;
		n/=10;
	}
	return ((f)?"-":"")+t;
}
void pr(string s,int t=25){
	for(int i=0;i<s.size();i++){
		cout<<s[i];
		Sleep(t);
	}
}
void cp(string s,int fc=15,int bc=0,bool slow=0,int t=25,int _setw=0){
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|bc*16|FOREGROUND_INTENSITY|fc);
    if(slow)pr(s,t);
	else cout<<left<<setw(_setw)<<s;
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|7);
    return;
}
inline int ___ti(float a) {
	return ((int)(a*10+5))/10;
}
void Setpos(float x,float y){
	COORD pos;
	pos.X=___ti(y*4)/2;
	pos.Y=___ti(x);
	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void verison_update(){
	cls;
	cp("1.0.0_beta");et;
	cp("大体框架完成");et;
	cp("增加背包");et;
	et;
	cp("1.0.0_beta_A(当前版本)");et;
	cp("削弱闪避");et;
	et;
	cp("1.0.0_beta_B(当前版本)");et;
	cp("增加探险等功能");et;
	et;
	cp("1.0.0_beta_C(当前版本)");et;
	cp("增加抽卡");et;
	pause;
}
class Item{
	public:
		string name,story;
		int id,star,color,price;
		int type;//1.普通物品 2.武器 3.装备 4.材料 5.食物 6.技能书 7.特殊物品 
		void init(string na,int _id,int _star,int _type,int _price=0){
			name=na;
			id=_id;
			type=_type;
			star=_star;
			item_count[type][0]++;
			item_count[0][type]++;
			item_count[0][0]++;
			ids[type][star][item_count[type][star]++]=id;
			switch(star){
				case 5:color=6;break;
				case 4:color=5;break;
				case 3:color=3;break;
				case 2:color=2;break;
				case 1:color=8;break;
			}
			price=_price;
		}
		Item(){}
		Item(string na,int _id,int _star,int _type=1,int _price=0){
			init(na,_id,_star,_type,_price);
		}
		void setStory(string s){
			story=s;
		}
		void show(){
			cp(name,color,0,0,25,15);
			cp("  [",color);
			for(int i=0;i<star;i++){
				cp("☆",color);
			} 
			cp("]",color);
			for(int i=star;i<5;i++){
				cp("  ",color);
			} 
		}
		void show2(){
			show();
			et;et;
			cp(story,color);
		}
};
class Equipment:public Item{
	public:
		int star;
		int exp;
		int level;
		int type;
		int exp_need[10][50];
		pair<string,double> zhucitiao;
		vector<pair<string,double> > fucitiao;
		Equipment(int _type,int _star){
			int citiao_n;
			type=_type,star=_star;
			string tttttt;
			switch(type){
				case 1:tttttt="花";break;
				case 2:tttttt="羽";break;
				case 3:tttttt="杯";break;
				case 4:tttttt="沙";break;
				case 5:tttttt="帽";break;
			}
			init("装备"+to_string((++free_item_id)-100000)+"-"+tttttt,free_item_id,star,3);
			switch(star){
				case 1:case 2:citiao_n=1;break;
				case 3:citiao_n=((rand()%4)?1:2);break;
				case 4:citiao_n=((rand()%4)?2:3);break;
				case 5:citiao_n=((rand()%4)?3:4);break;
			}
			if(type==1)zhucitiao.first=citiao[5],zhucitiao.second=_zhucitiao[5];
			else if(type==2)zhucitiao.first=citiao[1],zhucitiao.second=_zhucitiao[1];
			else{
				int t=rand()%8;
				while(t==1||t==3||t==5)t=rand()%8;
				zhucitiao.first=citiao[t],zhucitiao.second=_zhucitiao[t];
			}
			vector<int>temp;
			while(citiao_n--){
				kkks:{}
				int t=rand()%8;
				bool tt=false;
				for(int i=0;i<temp.size();i++){
					if(temp[i]==t){
						tt=true;
						break;
					}
				}
				if(tt||citiao[t]==zhucitiao.first)goto kkks;
				fucitiao.push_back({citiao[t],fucitiao_up[t][rand()%4]});
				temp.push_back(t);
			}
		}
		vector<double>get(){
			vector<double>t(8,0);
			for(int i=0;i<8;i++)t[i]=0;
			for(int i=0;i<8;i++){
				if(zhucitiao.first==citiao[i]){
					t[i]+=zhucitiao.second;
				}
			}
			for(int i=0;i<fucitiao.size();i++){
				for(int j=0;j<8;j++){
					//cout<<fucitiao[i].first<<' '<<citiao[j]<<endl;
					if(fucitiao[i].first==citiao[j]){
						t[j]+=fucitiao[i].second;
						//cout<<fucitiao[i].second<<endl;
						break;
					}
				}
			}
			return t;
		}
		void show2(){
			show();
			et;et;
			SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|color);
			for(int i=0;i<8;i++){
				if(zhucitiao.first==citiao[i]){
					cout<<left<<setw(10)<<citiaoname[i];
					cout<<zhucitiao.second<<citiaoname_more[i];
				}
			}et;et;et;et;
			for(int i=0;i<fucitiao.size();i++){
				for(int j=0;j<8;j++){
					if(fucitiao[i].first==citiao[j]){
						if(int(fucitiao[i].second)==fucitiao[i].second)
							cout<<"+"<<left<<setw(10)<<to_string(fucitiao[i].second)+citiaoname_more[j]<<citiaoname[j];
						else{
							string s=to_string(fucitiao[i].second*10);
							s=s.substr(0,s.size()-1)+"."+s.substr(s.size()-1);
							cout<<"+"<<left<<setw(10)<<s+citiaoname_more[j]<<citiaoname[j];
						}
						et;
						break;
					}
				}
			}
			SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|7);
		}
};
class Wuqi:public Item{
	public:
		void __init(string na,int _level,int _star,int _type){
			name=na;
			id=wuqi_id++;
			type=_type;
			star=_star;
			level=_level;
			switch(star){
				case 5:color=6;break;
				case 4:color=5;break;
				case 3:color=3;break;
				case 2:color=2;break;
				case 1:color=8;break;
			}
		}
		int level;
		Wuqi(){}
		Wuqi(string na,int _level,int _star,int wuqi_type,int t=0,int _id=-1){
			if(t==0)__init(na,_level,_star,2);//1.剑 2.弓 3.法器 
			else init(na,_id,_star,2),level=1;
		}
};
class Skill:public Item{
	public:
		int dazhao_need;
		int dazhao_give;
		Skill(){}
		Skill(string na,int type,int _id,int _star,int a=0){//1.技能 2.大招 3.后台技能 
			init(na,_id,_star,6);
			if(type==2)dazhao_need=a;
			if(type==1)dazhao_give=a;
		}
};
Item items[10][10000]={{},
	{
		Item("鸟蛋",1,1,1,150),Item("兽肉",2,1,1,500),Item("禽肉",3,1,1,400),Item("鱼肉",4,1,1,600),
		Item("虾仁",5,1,1,1000),Item("螃蟹",6,1,1,1500),Item("松茸",7,1,1,350),Item("盐",9,1,1,100),
		Item("糖",10,1,1,100),Item("香辛果",11,1,1,3000)
	},{
		Item("火腿",12,2,1,3000),Item("香辛料",13,2,1,5000),Item("牛奶",14,2,1,1000)
	},{
		Item("奶酪",15,3,1,10000)
	},{
		Item("果酱",16,4,1,10000)
	},{
		Item("海龟头",17,5,1)
	}
};
Wuqi wuqi[10][10000]={{},
	{
		Wuqi("钝剑",1,1,1,1,25)
	},{
		Wuqi("铁剑",1,2,1,1,26)
	},{
		Wuqi("钻石剑",1,3,1,1,27),Wuqi("弹弓",1,3,2,1,32),Wuqi("某人的笔记本",1,3,3,1,33) 
	},{
		Wuqi("冰冻罗非鱼",1,4,1,1,28),Wuqi("U1~U8单词和课文",1,4,3,1,34),Wuqi("管弦乐器",1,4,2,1,35) 
	},{
		Wuqi("黄金之书",1,5,3,1,29),Wuqi("黄金之弓",1,5,2,1,30),Wuqi("黄金之剑",1,5,1,1,36)
	}
};
vector<Wuqi>more_wuqi[10];
vector<Equipment>equipment[10];
Item cailiao[10][10000]={{},
	{
		//Item("有瑕疵的宝石",39)
	},{
		//Item("的宝石",40)
	},{
		
	},{
		
	},{
		
	}
};
struct Cook_Time{
	int perfect_sec1;
	int perfect_msec1;
	int perfect_sec2;
	int perfect_msec2;
	Cook_Time(){}
	Cook_Time(int a,int b,int c,int d){
		perfect_sec1=a;
		perfect_msec1=b;
		perfect_sec2=c;
		perfect_msec2=d;
	}
};
Item foods[10][10000]={{},
	{
		Item("煎蛋",18,1,5),Item("煎肉",19,1,5)
	},{
		Item("烤鸡",20,2,5)
	},{
		Item("红烧肉",39,3,5)
	},{
		Item("千灵慕斯",40,4,5)
	},{
		Item("佛跳墙",21,5,5),Item("土豆煎饼",37,5,5),Item("麻薯",38,5,5) 
	}
};
Cook_Time cook_time[10][10000]={{},
	{
		Cook_Time(2,31,5,20),Cook_Time(5,20,8,86)
	},{
		Cook_Time(5,20,7,31)
	},{
		Cook_Time(6,31,7,31)
	},{
		Cook_Time(6,31,6,82)
	},{
		Cook_Time(6,31,6,66),Cook_Time(4,31,4,63),Cook_Time(2,50,2,80)
	}
};
Skill skills[10][10000]={{},{},{},
	{
		
	},{
		
	},{
		Skill("潮水喷发",3,22,5),Skill("万水之源",1,41,5,40),Skill("洪波涌起",2,23,5,70) 
	}
};
vector<Skill>more_skills[10];
Item special_items[10][10000]={{},
	{
		
	},{
		
	},{
		
	},{
		
	},{
		Item("神秘的碎片",24,5,7),Item("世界万物的一块",31,5,7)
	}
};
struct Kachi_Item{
	int n,star,i,id,count;
	Kachi_Item(int _n,int _star,int _i,int _id,int _count=1){
		n=_n;
		star=_star;
		i=_i;
		id=_id;
		count=_count;
	}
	Kachi_Item(){}
};
vector<Kachi_Item>kachiitem_star3,kachiitem_star4,kachiitem_star5;
void init(){
	kachiitem_star3.push_back(Kachi_Item(2,3,0,27));
	kachiitem_star3.push_back(Kachi_Item(2,3,1,32));
	kachiitem_star3.push_back(Kachi_Item(2,3,2,33));
	kachiitem_star4.push_back(Kachi_Item(2,4,0,28));
	kachiitem_star4.push_back(Kachi_Item(2,4,1,34));
	kachiitem_star4.push_back(Kachi_Item(2,4,2,35));
	kachiitem_star5.push_back(Kachi_Item(2,5,0,29));
	kachiitem_star5.push_back(Kachi_Item(2,5,1,30));
	kachiitem_star5.push_back(Kachi_Item(2,5,2,36));
	skills[5][0].setStory("装备该技能,攻击范围20。若“水滴”存在,消耗1点使用次数,并消耗1个“水滴”,否则消耗5点使用次数。\n\
之后,每0.4秒对场上所有敌人造成10%/15%/20%/25%/30%生命值上限的伤害,持续3秒。\n\
每0.4秒,减少自身10%生命值上限的生命值,当自身生命值不到50%的生命值上限是,不再减少生命值\n\
当消耗1个“水滴”,回复自身50%生命值上限的生命值。\n\
若本技能满级,则每2秒额外造成20%生命值上限的伤害。\n\n\n获得方式:抽卡");
	skills[5][0].setStory("该技能每1回合可释放1次,使用5次使用次数,攻击范围5,增加1个“水滴”,\
对敌人造成15%/20%/25%/30%/35%生命值上限的,并为大招回复40点能量。\n\
若本技能满级,则额外造成100%生命值上限的伤害。\n\
\n\n\n获得方式:抽卡");
	skills[5][1].setStory("该大招每2回合可释放1次,使用5次使用次数,攻击范围20,增加2个“水滴”需要70点能量\n\
在大招释放后,对场上所有敌人造成100%/120%/140%/160%/250%生命值上限的伤害\
\n\n\n获得方式:抽卡");
	items[1][0].setStory("一只鸟下的蛋\n\n\n获得方式:探险获得、商店购买");
	items[1][1].setStory("一只野兽的肉\n\n\n获得方式:探险获得、商店购买");
	items[1][2].setStory("一只鸟的肉\n\n\n获得方式:探险获得、商店购买");
	items[1][3].setStory("一条鱼的肉\n\n\n获得方式:探险获得、商店购买");
	items[1][4].setStory("一只虾的肉\n\n\n获得方式:探险获得、商店购买");
	items[1][5].setStory("只是路边捡的东西\n\n\n获得方式:探险获得、商店购买");
	items[2][0].setStory("将兽肉用盐腌制后的产物\n有独特的香味\n\n\n获得方式:食品加工获得、商店购买");
	items[3][0].setStory("用某种方法用牛奶制成的食物\n\n\n获得方式:食品加工获得、商店购买");
	items[1][6].setStory("某种有着奇妙香味的果子\n\n\n获得方式:食品加工获得、商店购买");
	items[2][1].setStory("把香辛果磨成粉\n做成的一种调味料\n\n\n获得方式:食品加工获得、商店购买");
	foods[5][0].setStory("工艺复杂的名菜\n将各种山珍海味汇集在碗中\n\n\n获得方式:烹饪");
	special_items[5][0].setStory("神秘的碎片,散布在世界各地,散发着神秘的光芒,似乎有着分化成其他物品的能力。\n\n\n获得方式:探险获得");
	special_items[5][1].setStory("大量神秘的碎片,聚在一起,形成了一块物品,散发着大量神秘的光芒,\n\
有着分化成其他物品的能力,是世界万物物品的起源\n\n\n获得方式:商店兑换、商店购买");
}
int star_5_c=0,star_4_c=0;
int choose_star(){//4:1.6% 5:0.6%
	int n=rand()%10000+1;
	choose_count++,star_5_c++,star_4_c++;
	int gailu[3][100]={{0,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,
	60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,
	60,60,60,60,60,60,660,1260,1860,2460,3060,3660,4260,4860,5460,6060,6660,7260,7860,8460,9060,9660,10000},
	{0,160,160,160,160,160,2160,4160,6160,8160,10160}};
	if(n<=gailu[0][star_5_c%90+1]){if(rand()%10)star_5_c=0;return 5;}
	if(n<=gailu[1][star_4_c%10+1]){if(rand()%5)star_4_c=0;return 4;}
	return 3;
}
int _____star_____[]={0,0,0,3,5,6};
void hahaha(int _star){
	string s=")",t;
	for(int i=0;i<5;i++){
		cls;et;et;cp(s,3);s="===="+s;et;et;Sleep(1);
	}
	for(int i=0;i<5;i++){
		cls;cp(t+="----",6);et;et;cp(s,3);et;et;cp(t,6);Sleep(1);
	}
	for(int i=0;i<5;i++){
		cls;cp(t,6);et;et;cp(s,_____star_____[_star]);et;et;cp(t,6);Sleep(1);
	}
}
Item*_show(int n,int star,int i,int id){
	Item *t;
	switch(n){
		case 1:{
			t=&items[star][i];
			break;
		}
		case 2:{
			t=&wuqi[star][i];
			break;
		}
		case 3:{
			t=&equipment[star][i];
			break;
		}
		case 4:{
			t=&cailiao[star][i];
			break;
		}
		case 5:{
			t=&foods[star][i];
			break;
		}
		case 6:{
			t=&skills[star][i];
			break;
		}
		case 7:{
			t=&special_items[star][i];
			break;
		}
	}
	return t;
}
void ci(int n,int star,int i,int id,int count,bool getthis=true){
	Item *t=_show(n,star,i,id);
	cp(t->name,t->color,0,0,0,15);
	if(getthis)cp("*"+to_string(count),t->color);
	if(getthis)bag[n][t->id]+=count;
}
Equipment nzb(int type,int star){
	Equipment zb(type,star);
	equipment[star].push_back(zb);
	cp(zb.name,zb.color,0,0,0,15);et;
	return zb;
}
int goal_item=-1,goal_item_count=0;
void choose(){
	yzh:{}
	cls;
	cp("抽卡   ",3);
	cp("神秘的碎片:"+to_string(bag[7][24]),6,0,0,0,20);
	cp("   世界万物的一块:"+to_string(bag[7][31]),6);et;
	if(goal_item!=-1){
		cp("已选");
		Kachi_Item t=kachiitem_star5[goal_item];
		ci(t.n,t.star,t.i,t.id,1,false);
		cp("作为目标");et;
		cp("“不幸值”:("+to_string(goal_item_count)+"/2)");et;
	}
	cp("1.单抽 2.10连抽 3.选择目标 4.玄学 0.退出");et;
	string s;
	cin>>s;
	vector<int>stars;
	int max_stars=-114514;
	if(s=="1"){
		if(bag[7][31]<1){
			cp("世界万物的一块",6);
			cp("数量不足,",4);et; 
			cp("是否花");
			cp("神秘的碎片",6);
			cp("*100,",4);
			cp("换取等量的");
			cp("世界万物的一块",6);
			cp("?");et;
			cp("1.是 2.否");et;
			string kkksc;
			cin>>kkksc;
			if(kkksc=="1"){
				if(bag[7][24]<100){
					cp("神秘的碎片",6);
					cp("数量不足",4);et;
					pause;
					goto yzh;
				}else{
					bag[7][31]++;
					bag[7][24]-=100;
				}
			}else{
				goto yzh;
			}
		}
		bag[7][31]--;
		stars.push_back(choose_star());
		max_stars=stars[0];
	}else if(s=="2"){
		if(bag[7][31]<10){
			int lxz=10-bag[7][31];
			lxz*=100;
			cp("世界万物的一块",6);
			cp("数量不足,",4);et; 
			cp("是否花");
			cp("神秘的碎片",6);
			cp("*"+to_string(lxz)+",",4);
			cp("换取等量的");
			cp("世界万物的一块",6);
			cp("?");et;
			cp("1.是 2.否");et;
			string kkksc;
			cin>>kkksc;
			if(kkksc=="1"){
				if(bag[7][24]<lxz){
					cp("神秘的碎片",6);
					cp("数量不足",4);et;
					pause;
					goto yzh;
				}else{
					bag[7][31]+=lxz/100;
					bag[7][24]-=lxz;
				}
			}else{
				goto yzh;
			}
		}
		bag[7][31]-=10;
		for(int i=0;i<10;i++){
			int t=choose_star();
			stars.push_back(t);
			max_stars=max(max_stars,t);
		}
	}else if(s=="4"){
		cls;
		cp("请输入n,n∈[0,");
		cp(to_string(INT_MAX));
		cp("]:");
		int n,t=rand()%100000;
		cin>>n;
		srand(n);
		cp("请稍后……");
		while(t--)rand();
		goto yzh;
	}else if(s=="3"){
		cls;
		cp("选择目标");et;
		if(goal_item!=-1){
			cp("已选");
			Kachi_Item t=kachiitem_star5[goal_item];
			ci(t.n,t.star,t.i,t.id,1,false);
			cp("作为目标");et;
			cp("“不幸值”:("+to_string(goal_item_count)+"/2)");et;
			cp("-2.取消选择目标");et;
		}
		cp("-1.退出");et;
		cp("0.查看作用");et;
		for(int i=0;i<kachiitem_star5.size();i++){
			Kachi_Item t=kachiitem_star5[i];
			cp(to_string(i+1)+".",6);ci(t.n,t.star,t.i,t.id,1,false);et;
		}
		string kkksc03;
		cin>>kkksc03;
		if(kkksc03=="-1")goto yzh;
		else if(kkksc03=="0"){
			cp("选择武器后,每一次抽出的五星物品非目标物品,增加1点“不幸值”。");et;
			cp("当“不幸值”到达2时,下一次抽出的五星物品一定是目标物品。");et;
			cp("当抽出的五星物品是目标物品或更换目标物品,“不幸值”清零。");et;
			pause;
		}else if(goal_item!=-1&&kkksc03=="-2"){
			cp("Waring:取消选择目标,将会清零“不幸值”!",4);et;
			cp("是否取消选择目标?");et;
			cp("1.是 2.否");et;
			string kkksc0;
			cin>>kkksc0;
			if(kkksc0=="2")goto yzh;
			if(kkksc0=="1"){
				goal_item=-1;
				goal_item_count=0;
			}
		}else{
			int kkksc0=0;
			for(int i=0;i<kkksc03.size();i++)
				if(isdigit(kkksc03[i]))
					kkksc0=kkksc0*10+kkksc03[i]-'0';
			goal_item=kkksc0-1;
			cp("选");
			Kachi_Item t=kachiitem_star5[goal_item];
			ci(t.n,t.star,t.i,t.id,1,false);
			cp("作为目标");et;
			goal_item_count=0;
			pause;
		}
		goto yzh;
	}else{
		return;
	}
	hahaha(max_stars);cls;
	sort(stars.begin(),stars.end());
	for(int i=stars.size()-1;i>=0;i--){
		Kachi_Item t;
		switch(stars[i]){
			case 3:{
				t=kachiitem_star3[rand()%kachiitem_star3.size()];
				break;
			}
			case 4:{
				t=kachiitem_star4[rand()%kachiitem_star4.size()];
				break;
			}
			case 5:{
				if(goal_item==-1){
					t=kachiitem_star5[rand()%kachiitem_star5.size()];
					break;
				}
				int kkkkk;
				if(goal_item_count>=2||rand()%10000<=2316)kkkkk=goal_item;
				else kkkkk=rand()%kachiitem_star5.size();
				t=kachiitem_star5[kkkkk];
				if(kkkkk!=goal_item)goal_item_count++;
				else goal_item_count=0;
				break;
			}
		}
		ci(t.n,t.star,t.i,t.id,1);et;
	}
	pause;
	goto yzh;
}
inline string ___fun(int n){
	string s=to_string(n);
	if(n<10)s="0"+s;
	return s;
}
void cook(){
	cls;
	cp("烹饪",6);et;et;
	cp("1.烹饪 0.退出");et;
	string s;
	cin>>s;
	if(s=="0")return;
	if(s=="1"){
		cls;
		int cnt=0;
		vector<pair<Item,pair<int,int> > >temp_item;
		for(int j=5;j>=1;j--){
			for(int i=0;i<item_count[5][j];i++){
				Item t=foods[j][i];
				cp(to_string(++cnt)+".",t.color);ci(5,t.star,i,t.id,1,false);et;
				temp_item.push_back({t,{j,i}});
			}
		}
		int kkk,fs,fi;
		cin>>kkk;
		Item temp=temp_item[kkk-1].first;
		fs=temp_item[kkk-1].second.first;
		fi=temp_item[kkk-1].second.second;
		cls;
		Setpos(2.5,0);
		cp("时间在00:",6);
		cp(___fun(cook_time[fs][fi].perfect_sec1),6);
		cp(":"+___fun(cook_time[fs][fi].perfect_msec1),6);
		cp("至00:",6);
		cp(___fun(cook_time[fs][fi].perfect_sec2),6);
		cp(":"+___fun(cook_time[fs][fi].perfect_msec2),6);
		cp("之间完美",6);
		Setpos(0,0);
		cout<<"00:";
		bool kkksc0=false;
		int sec,msec;
		for(int i=0;i<60;i++){
			Setpos(0,1.5);
			if(i<10){
				cout<<"0"<<i;
			}else{
				cout<<i;
			}
			cout<<":";
			for(double j=0;j<100;j+=1.625){
				Setpos(0,3);
				if(j<10){
					cout<<"0"<<int(j);
				}else{
					cout<<int(j);
				}
				if(GetAsyncKeyState(VK_SPACE)&0x8000){
					sec=i;
					msec=int(j);
					kkksc0=true;et;
					break;
				}
				Sleep(1);
			}
			if(kkksc0)break;
		}
		int food_count=-1;
		Setpos(3.5,0);
		if(cook_time[fs][fi].perfect_sec1<=sec&&sec<=cook_time[fs][fi].perfect_sec2)
		if(cook_time[fs][fi].perfect_msec1<=msec&&msec<=cook_time[fs][fi].perfect_msec2){
			cp("完美!",6);
			food_count=((rand()%2)?2:1);
			if(food_count==2){
				cp("获得双倍食物!",4);
			}
		}
		if(food_count==-1)food_count=1;
		et;
		ci(5,temp.star,fi,temp.id,food_count);et;et;
		pause;
	}
}
class Effect{
	public:
		int addDamage;
		int addDefend;
		int addHealth;
		int addCriticalHitProbability;
		int addCriticalHitDamage;
		int time;
		int type;
		Effect(int _type,int _time,int a=0,int b=0,int c=0){
			type=_type;
			time=_time;
			switch(type){
				case 1:{
					addDamage=a;
					break;
				}
				case 2:{
					addHealth=a;
					break;
				}
				case 3:{
					addDefend=a;
					break;
				}
				case 4:{
					addCriticalHitProbability=a;
					break;
				}
				case 5:{
					addCriticalHitDamage=a;
					break;
				}
			}
		}
};
class Player{
	public:
		int gender;//1.boy 2.girl 3.other
		int elevel;
		int playerlevel;
		int eexp;
		int playerexp;
		int baseHealth;
		Equipment*_equipment[10];
		Wuqi*_wuqi;
		Skill skills[5];
		vector<Effect>effects;
		Player():baseHealth(1631),baseDamage(231),baseDefend(31){}
		void init(){
			eexp=playerexp=0;
			playerlevel=elevel=1;
			health=maxHealth=baseHealth;
			attackRange=2;
			critical_hit_probability=6.31;
			critical_hit_damage=63.1;
			addDamage=0;
			attackDamage[0]=23.1;
			attackDamage[1]=24.3;
			attackDamage[2]=32.6;
			attackDamage[3]=21.3;
			attackDamage[4]=38.1;
			attackDamage[5]=154.1;
			if(gender==2){
				for(int i=0;i<6;i++){
					attackDamage[i]*=1.2;
				}
			}
			for(int i=1;i<=5;i++){
				_equipment[i]=NULL;
			}
			update();
		}
		void update(){
			while(elevel<60&&eexp>=eexp_need[elevel+1])
				eexp-=eexp_need[++elevel];
			if(elevel==60){
				long long ttt=money+10*eexp;
				money=min(ttt,2000000000ll);
				money+=10*eexp;
				eexp=0;
			}
			while(playerlevel<90&&playerexp>=player_exp_need[playerlevel+1])
				playerexp-=player_exp_need[++playerlevel];
			if(playerlevel==90)playerexp=0;
			double t=health*1.0/maxHealth;
			baseDefend=31+playerlevel*13;
			baseDamage=231+playerlevel*31;
			baseHealth=1631+playerlevel*231;
			baseCriticalHitProbability=2.31+playerlevel*3.1/10*gender;
			baseCriticalHitDamage=23.1+playerlevel*6.31/10*gender;
			vector<double>a(10);
			for(int i=1;i<=5;i++){
				if(_equipment[i]){
					vector<double>x=_equipment[i]->get();
					for(int j=0;j<x.size();j++){
						a[j]+=x[j];
					}
				}
			}
			baseDamage*=(1+a[0]/100.0);
			baseDamage+=a[1];
			baseDefend*=(1+a[2]/100.0);
			baseDefend+=a[3];
			baseHealth*=(1+a[4]/100.0);
			baseHealth+=a[5];
			baseCriticalHitProbability+=a[6];
			baseCriticalHitDamage+=a[7];
			maxHealth=baseHealth;
			health=maxHealth*t;
			damage=baseDamage;
			defend=baseDefend;
			critical_hit_probability=baseCriticalHitProbability;
			critical_hit_damage=baseCriticalHitDamage;
			if(health<=0){
				effects.clear();
				health=maxHealth*0.05;
			}
			for(int i=0;i<effects.size();i++){
				switch(effects[i].type){
					case 1:{
						damage+=effects[i].addDamage;
						break;
					}
					case 2:{
						health+=effects[i].addHealth;
						break;
					}
					case 3:{
						defend+=effects[i].addDefend;
						break;
					}
					case 4:{
						critical_hit_probability+=effects[i].addCriticalHitProbability;
						break;
					}
					case 5:{
						critical_hit_damage+=effects[i].addCriticalHitDamage;
						break;
					}
				}
			}
		}
		void show(){
			cls;
			cp("名字:");
			cp(name,(gender==2)?12:1);et;
			cp("等级:"+to_string(playerlevel));et;
			cp("生命值:"+to_string(health)+"/"+to_string(maxHealth));et;
			cp("攻击力:"+to_string(damage));et;
			cp("防御力:"+to_string(defend));et;
			cp("暴击率:"+to_string(critical_hit_probability));et;
			cp("暴击伤害:"+to_string(critical_hit_damage));et;
			et;et;et;et;
			pause;
		}
		int baseDamage;
		int baseDefend; 
		int health;
		int maxHealth;
		int damage;
		int defend;
		int attackRange;
		double baseCriticalHitProbability;
		double baseCriticalHitDamage;
		double critical_hit_probability;
		double critical_hit_damage;
		double addDamage;
		double attackDamage[10];
		double luck;
}player;
void tujian(){
	cls;
	cp("1.普通物品 2.武器 4.材料 5.食物 6.技能书 7.特殊物品");et;
	int n;
	cin>>n;
	if(n==0)return;
	cp("--------------------------图鉴--------------------------\n");
	for(int star=5;star>=1;star--){
		for(int i=0;i<item_count[n][star];i++){
			int id=ids[n][star][i];
			Item*t=_show(n,star,i,id);
			id=t->id;
			cp("编号 "+to_string(id)+":",t->color,0,0,0,15);
			t->show();
			cp("     ");
			if(bag[n][id]<=0)cp("未拥有",t->color);
			else cp("已拥有",t->color);
			et;
		} 
	}
	cp("1.详情  0.退出");et;
	int t;
	cin>>t;
	if(t==0)return;
	if(t==1){
		cp("物品编号?\n");
		cin>>t;
		for(int star=5;star>=1;star--)
			for(int i=0;i<item_count[n][star];i++){
				int id=ids[n][star][i];
				cout<<id<<' ';
				Sleep(100); 
				if(id==t){
					cls;
					_show(n,star,i,id)->show2();
					et;
					break;
				}
			}
		et;et;et;et;
		pause;
	}
	tujian();
} 
void show_bag(){
	cls;
	cp("1.普通物品 2.武器 3.装备 4.材料 5.食物 6.技能书 7.特殊物品 0.退出");et;
	int n;
	cin>>n;
	if(n==0)return;
	cp("--------------------------背包--------------------------\n");
	bool f=false;
	for(int star=5;star>=1;star--){
		if(n==2){
			for(int i=0;i<more_wuqi[star].size();i++){
				f=true;
				Wuqi t=more_wuqi[star][i];
				cp("编号 "+to_string(t.id)+":",t.color,0,0,0,15);
				t.show();
				cp("     Lv.");
				cp(to_string(t.level)+"     ");
				if(player._wuqi&&player._wuqi->id==wuqi[star][i].id)cp("已装备",t.color);
				else cp("未装备",t.color);
				et;
			}
			for(int i=0;i<item_count[n][star];i++){
				int id=ids[n][star][i];
				if(bag[n][id]<=0&&n!=3)continue;
				f=true;
				Item*t=_show(n,star,i,id);
				id=t->id;
				int ttttt=bag[n][id]-1;
				yzh:{}
				cp("编号 "+to_string(id)+":",t->color,0,0,0,15);
				t->show();
				cp("     ");
				cp("Lv.1",t->color);et;
				if(ttttt>0){
					ttttt--;
					goto yzh;
				}
			}
		}else
		for(int i=0;i<item_count[n][star];i++){
			int id=ids[n][star][i];
			if(bag[n][id]<=0&&n!=3)continue;
			f=true;
			Item*t=_show(n,star,i,id);
			id=t->id;
			cp("编号 "+to_string(id)+":",t->color,0,0,0,15);
			t->show();
			cp("     ");
			if(n!=3){
				if(bag[n][id]<=0)cp("未拥有",t->color);
				else if(n!=2)cp(to_string(bag[n][id])+"个",t->color);
				else cp("Lv.1",t->color);
			}else{
				bool f=false;
				for(int j=0;j<5;j++){
					if(!player._equipment[j])continue;
					if(player._equipment[j]->id==equipment[star][i].id){
						f=true;
					}
				}
				if(f)cp("已装备",t->color);
				else cp("未装备",t->color);
			}
			et;		
		}
	}
	if(!f)cp("背包内没有物品!\n");
	cp("1.详情  0.退出");et;
	int t;
	cin>>t;
	if(t==0)return;
	if(t==1){
		cp("物品编号?\n");
		cin>>t;
		if(n==3)for(int star=5;star>=1;star--)
			for(int i=0;i<item_count[n][star];i++){
				int id=ids[n][star][i];
				if(id==t){
					cls;
					equipment[star][i].show2();
					cp("1.装备 0.退出\n");
					string sss;
					cin>>sss;
					if(sss=="1"){
						player._equipment[equipment[star][i].type]=&equipment[star][i];
						player.update();
					}
					et;
					break;
				}
			}
		else if(n==2)for(int star=5;star>=1;star--){
			for(int i=0;i<more_wuqi[star].size();i++){
				if(more_wuqi[star][i].id==t){
					cls;
					more_wuqi[star][i].show2();
					cp("1.装备 0.退出\n");
					string sss;
					cin>>sss;
					if(sss=="1"){
						player._wuqi=&more_wuqi[star][i];
						player.update();
					}
					et;
					break;
				}
			}
			for(int i=0;i<item_count[n][star];i++){
				int id=ids[n][star][i];
				if(id==t){
					cls;
					wuqi[star][i].show2();
					cp("1.装备 0.退出\n");
					string sss;
					cin>>sss;
					if(sss=="1"){
						player._wuqi=&wuqi[star][i];
						player.update();
					}
					et;
					break;
				}
			}
		}
		else for(int star=5;star>=1;star--)
			for(int i=0;i<item_count[n][star];i++){
				int id=ids[n][star][i];
				if(id==t){
					cls;
					_show(n,star,i,id)->show2();
					et;
					break;
				}
			}
		et;et;et;et;
		pause;
	}
	show_bag();
}
class Enemy{
		int _health,_damage,_defend;
	public:
		string name;
		int level;
		int health;
		int maxHealth;
		int damage;
		int defend;
		Enemy(){
			maxHealth=health=1000;
		}
		Enemy(string _name,int _level,int __health,int __damage,int __defend,int _attackRange=2,double _addDamage=0,double _critical_hit_probability=0,double _critical_hit_damage=0){
			name=_name;
			level=_level;
			_health=__health;
			_damage=__damage;
			_defend=__defend;
			maxHealth=health=_health*level*LEVEL_UP;
			damage=_damage*level*LEVEL_UP;
			defend=_defend*level*LEVEL_UP;
			attackRange=_attackRange;
			addDamage=_addDamage;
			critical_hit_probability=_critical_hit_probability;
			critical_hit_damage=_critical_hit_damage;
		}
		void update(){
			maxHealth=health=_health*level*LEVEL_UP;
			damage=_damage*level*LEVEL_UP;
			defend=_defend*level*LEVEL_UP;
		}
		void show(){
			cp(name+": Lv "+to_string(level),12,0,0,25,30);
			if(health>=0){
				cp(" [",12);
				int t=double(health)/maxHealth*10;
				int t2=10-t;
				while(t--){
					cp("▄",12);
				}
				while(t2--){
					cp(" ",12);
				}
				cp(" ] ",12);
				t=double(health)/maxHealth*100;
				cp(" (",12);
				cp(to_string(t),12);
				cp("% ",12);
				cp(to_string(health),12);
				cp("/",12);
				cp(to_string(maxHealth),12);
				cp(")",12);
			}else{
				cp("已死亡",12);
			}
		}
		int attackRange;
		double critical_hit_probability;
		double critical_hit_damage;
		double addDamage;
};
typedef vector<Enemy> ve;
inline ve _nn(Enemy enemy,ve enemies){
	enemies.push_back(enemy);
	return enemies;
}
inline ve _n1(Enemy enemy){
	ve enemies;
	enemies.push_back(enemy);
	return enemies;
}
char read(){
	cls;
	cp("Warning:没有存档文件时请勿读档!",12,0,1,50);et;
	vector<int>a;
	string tname;
	ifstream fin("save1.dat");
	fin>>tname;
	cout<<"读取到"<<tname<<"的存档!是否读取?(1.是/ 其他.否)\n"; 
	char c;
	cin>>c;
	if(c!='1'){
		fin.close();
		return false;
	}
	name=tname;
	fin>>player.elevel>>player.playerlevel;
	fin>>player.eexp>>player.playerexp>>player.health;
	fin>>player.attackRange>>player.critical_hit_probability>>player.critical_hit_damage;
	fin>>player.addDamage;
	fin.close();
	player.update();
	return true;
}
void save(){
	//ofstream outfile("save1.dat",std::ios::trunc|ios::binary|ios::in|ios::out);
	//outfile<<player.elevel<<' '<<play;
	//outfile.close();
	ofstream outfile("save1.dat",std::ios::trunc|ios::binary|ios::in|ios::out);
	outfile<<name<<endl;
	outfile<<player.elevel<<' '<<player.playerlevel<<' ';
	outfile<<player.eexp<<' '<<player.playerexp<<' '<<player.health<<' ';
	outfile<<player.attackRange<<' '<<player.critical_hit_probability<<' '<<player.critical_hit_damage<<' ';
	outfile<<player.addDamage<<' ';
	outfile.close();
}
int getDamage(int damge,int defend,double addDamage=0,int critical_hit_probability=0,double critical_hit_damage=0){
	return max(int(max((max(damge-defend*0.3,0.0)+rand()%2)*(addDamage+1)+rand()%3-1,0.0)*((rand()%100<critical_hit_probability)?((critical_hit_damage/100)+1):1)),0);
}
int ai1(Enemy enemy,int distance,int damage=0){
	if(distance<=enemy.attackRange&&distance>player.attackRange)
		return 1;
	if(distance>enemy.attackRange)
		return 2;
	if(distance<=enemy.attackRange&&distance<=player.attackRange)
		if(player.health-damage<=0)return 1;
		else return ((rand()%3)?1:3);

}
bool fight(vector<Enemy>enemies){
	player.update();
	SetConsoleTitle("Fight!");
	vector<int>distance;
	distance.resize(enemies.size());
	for(int i=0;i<enemies.size();i++){
		distance[i]=10+rand()%5;
	}
	int chongneng=0,needchongneng=80;
	int jinengcooldown=0;
	int dazhaocooldown=0;
	int tili=max_tili;
	int shanbi=0;
	bool f;
	vector<pair<int,int> >_shanbi;
	while(1){
		int num=((player.gender==1)?6:5);
		kkks:{}
		f=true;
		kkk:{}
		vector<int>temp;
		cls;
		cp(name+": Lv "+to_string(player.playerlevel),3,0,0,25,30);
		if(player.health>0){
			cp(" [",3);
			int t=double(player.health)/player.maxHealth*10;
			int t2=10-t;
			while(t--){
				cp("▄",3);
			}
			while(t2--){
				cp(" ",3);
			}
			cp(" ] ",3);
			t=double(player.health)/player.maxHealth*100;
			cp(" (",3);
			cp(to_string(t),3);
			cp("% ",3);
			cp(to_string(player.health),3);
			cp("/",3);
			cp(to_string(player.maxHealth),3);
			cp(")",3);
			cp("    体力:",6);
			cp(to_string(tili),6);
		}else{
			cp("已死亡",12);
		}
		et;
		for(int i=0;i<enemies.size();i++){
			enemies[i].show();
			if(enemies[i].health<=0){
				et;
				continue;
			}
			cp("    距离 ",1);
			cp(to_string(distance[i]),1);
			if(distance[i]<=player.attackRange){
				cp("    位于攻击范围内",2);
				temp.push_back(i);
			}
			if(distance[i]<=enemies[i].attackRange){
				cp("    位于敌人攻击范围内",12);
			}
			et;
		}
		for(int i=1;i<=30;i++){
			cp("--",i%15+1,0);
		}
		et;
		string s=FUS6231BCK;
		if(f){
			cp("你要干什么?     还可以进行");
			cp(to_string(num),((num>=3)?2:12));
			cp("次操作");
			et;
			cp("1.普通攻击  ");
			cp("2.技能  ",((jinengcooldown<=0)?2:8));
			cp("3.大招  ",((jinengcooldown<=0&&chongneng>=needchongneng)?2:8));
			cp("4.移动  5.吃饭  6.闪避"); 
			et; 
			cin>>s;
		}
		if(s=="1"){
			cp("进行几段伤害?(1~5,6:重击)");
			int n;
			cin>>n;
			bool t=false;
			if(n==6){
				if(tili<zhongji_tili_need){
					cp("体力不足!",12);
					Sleep(1000);
					goto kkks;
				}
				if(num<2){
					cp("操作进行次数不足!",12);
					Sleep(1000);
					goto kkks;
				}
				tili-=zhongji_tili_need;
				for(int i=0;i<temp.size();i++){
					t=true;
					int damage=getDamage(player.damage*player.attackDamage[5]/100,enemies[temp[i]].defend,player.addDamage,player.critical_hit_probability,player.critical_hit_damage);
					enemies[temp[i]].health-=damage;
					cp("对");
					cp(enemies[temp[i]].name,12);
					cp("造成");
					cp(to_string(damage),12);
					cp("点伤害\n");
				}
				if(t)num-=2;
			}else{
				n=max(n,1);
				n=min(n,num);
				for(int j=0;j<n;j++){
					for(int i=0;i<temp.size();i++){
						t=true;
						int damage=getDamage(player.damage*player.attackDamage[j]/100,enemies[temp[i]].defend,player.addDamage,player.critical_hit_probability,player.critical_hit_damage);
						enemies[temp[i]].health-=damage;
						cp("对");
						cp(enemies[temp[i]].name,12);
						cp("造成");
						cp(to_string(damage),12);
						cp("点伤害\n");
					}
				}
				if(t)num-=n;
			}
		}else if(s=="2"){ 
			if(!(jinengcooldown<=0)){
				cp("无法使用技能!",12);
				Sleep(250);
				goto kkks;
			}else{
				switch(player.skills[0].id){
					
				}
			}
		}else if(s=="3"){
			if(!(jinengcooldown<=0&&chongneng>=needchongneng)){
				cp("无法使用大招!",12);
				Sleep(250);
				goto kkks;
			}else{
				num-=2;
			}
		}else if(s=="4"){
			cp("移动方向?(1.前 / 2.后)");
			cin>>s;
			cp("移动距离?");
			int n;
			cin>>n;
			n=max(min(n,num),0);
			num-=n;
			if(s=="1")n*=-1;
			for(int i=0;i<enemies.size();i++){
				distance[i]+=n;
				distance[i]=max(distance[i],0);
			}
		}else if(s=="5"){
			/*
			Item("煎蛋",18,1,5),Item("煎肉",19,1,5)
			Item("烤鸡",20,2,5)
			Item("红烧肉",39,3,5)
			Item("千灵慕斯",40,4,5)
			Item("佛跳墙",21,5,5),Item("土豆煎饼",37,5,5),Item("麻薯",38,5,5)
			*/
			cp("要吃什么?",6);et;
			int cnt=0;
			vector<pair<Item,pair<int,int> > >temp_item;
			for(int j=5;j>=1;j--){
				for(int i=0;i<item_count[5][j];i++){
					Item t=foods[j][i];
					cp(to_string(++cnt)+".",t.color);ci(5,t.star,i,t.id,1,false);et;
					temp_item.push_back({t,{j,i}});
				}
			}
			int kkk,fs,fi;
			cin>>kkk;
			Item temp=temp_item[kkk-1].first;
			fs=temp_item[kkk-1].second.first;
			fi=temp_item[kkk-1].second.second;
			cp("是否食用");
			ci(5,temp.star,fi,temp.id,1,false);et;
			cp("1.是 2.否");et;
			string s;
			cin>>s;
			if(s=="1"&&num>=1){
				num--;
				switch(temp.id){
					case 18:case 19:{
						player.health=min(player.maxHealth,player.health+300);
						break;
					}
					case 20:{
						player.health+=player.maxHealth*0.2;
						player.health+=1500;
						player.health=min(player.maxHealth,player.health);
						break;
					}
					case 39:{
						player.health+=player.maxHealth*0.35;
						player.health+=3100;
						player.health=min(player.maxHealth,player.health);
						break;
					}
					case 40:{
						player.effects.push_back(Effect(1,5,int(player.baseDamage*0.35+100)));
						break;
					}
					case 21:{
						player.effects.push_back(Effect(1,6,int(player.baseDamage*0.20+100)));
						player.effects.push_back(Effect(4,6,36));
						player.effects.push_back(Effect(4,6,120));
						break;
					}
				}
				player.update();
			}
		}else if(s=="6"){
			if(tili<shanbi_tili_need){
				cp("体力不足!",12);
				Sleep(1000);
				goto kkks;
			}
			tili-=shanbi_tili_need;
			cp("闪避!可免疫伤害"+to_string(++shanbi)+"次",2);
			num--;
			_shanbi.push_back({3,1});
		}else if(s!=FUS6231BCK){
			cp("非法输入!",12);
			Sleep(250);
			goto kkks;
		}
		if(f){
			et;et;
			cp("还可以进行");
			cp(to_string(num),((num>=3)?2:12));
			cp("次操作");et;et;
			pause;
			bool fl=true;
			for(int i=0;i<enemies.size();i++)
				fl&=(enemies[i].health<=0);
			if(fl){
				if(f){
					cls;
					f=false;
					goto kkk;
				}
				cp("你赢了!\n",2,0,1,75);
				Sleep(1000);
				return true;
			}
			if(num>0)goto kkk;
		}
		bool fl=true;
		for(int i=0;i<enemies.size();i++)
			fl&=(enemies[i].health<=0);
		if(fl){
			if(f){
				cls;
				f=false;
				goto kkk;
			}
			cp("你赢了!\n",2,0,1,75);
			Sleep(1000);
			return true;
		}
		if(player.health<=0){
			if(f){
				cls;
				f=false;
				goto kkk;
			}
			cp("你凉了……\n",12,0,1,75);
			Sleep(1000);
			return false;
		}
		////////////////////////
		if(f){
			cls;
			f=false;
			goto kkk;
		}
		f=true;
		if(player.health>0){
			for(int i=0;i<enemies.size();i++){
				cho:{}
				if(enemies[i].health<=0)continue;
				int damage=getDamage(enemies[i].damage,player.defend,enemies[i].addDamage,enemies[i].critical_hit_probability,enemies[i].critical_hit_damage);
				int t=ai1(enemies[i],distance[i],damage);
				if(t==1){
					player.health-=damage;
					cp(enemies[i].name,12);	
					cp("对你造成");
					cp(to_string(damage),12);
					cp("点伤害  ");
					if(shanbi>0){
						sort(_shanbi.begin(),_shanbi.end());
						shanbi--;
						_shanbi.erase(_shanbi.begin(),_shanbi.begin()+1);
						cp("闪避,免疫该次伤害,还可以免疫伤害"+to_string(shanbi)+"次",2);
						player.health+=damage;
					}
					et;
				}
				if(t==2){
					int x=distance[i]-enemies[i].attackRange;
					x=min(x,3)-rand()%2;
					distance[i]-=x;
					cp(enemies[i].name,12);
					cp("向前移动");
					cp(to_string(x),12);
					cp("格\n");
				}
				if(t==3){
					int x=enemies[i].attackRange-distance[i];
					x=min(x,3);
					if(x==0){
						t=1;
						goto cho;
					}
					distance[i]+=x;
					cp(enemies[i].name,12);
					cp("向后移动");
					cp(to_string(x),12);
					cp("格\n");
				}
			}
		}
		et;et;
		if(player.health<=0){
			if(f){
				cls;
				f=false;
				goto kkk;
			}
			cp("你凉了……\n",12,0,1,75);
			Sleep(1000);
			return false;
		}
		if(tili<max_tili){
			int ttt=min(tili+tili_huifu,max_tili),ttt2;
			ttt2=ttt-tili;
			tili=ttt;
			cp("体力恢复"+to_string(ttt2)+"点",6);
			et;et;
		}
		for(int i=0;i<_shanbi.size();i++){
			_shanbi[i].first--;
			if(_shanbi[i].first<=0){
				_shanbi.erase(_shanbi.begin()+i,_shanbi.begin()+i+1);
				shanbi--;
			}
		}
		for(int i=0;i<player.effects.size();i++){
			player.effects[i].time--;
			if(player.effects[i].time<=0){
				player.effects.erase(player.effects.begin()+i,player.effects.begin()+i+1);
				player.update();
			}
		}
		pause;
	}
}
int setting(){
	cls;
	cp("1.存档 2.其他 0.退出");et;
	string s;
	cin>>s;
	if(s=="1"){
		save();
		cls;
		cp("保存成功",2);
		return 0;
	}else if(s=="2"){
		cls;
		while(1){
			cp("1.查看背包时只显示已拥有的物品  ");
			cp((only_see_have?"是":"否"));et;
			cp("0.退出");et;
			char c=_getch();
			if(c=='1')only_see_have=(!only_see_have);
			if(c=='0')break;
			cls;
		}
		return 114514;
	}
	return 0;
}
Enemy enemies[10000]={
	Enemy("小型史莱姆",1,250,10,10,2,0,5,231),
	Enemy("大型史莱姆",1,1150,50,40,3,0,5,250),
	Enemy("野人",1,575,31,15,2,0,5,250),
	Enemy("持盾野人",1,1500,31,15,2,0,5,250),
	Enemy("木棍野人",1,575,80,12,3,0,35,200),
	Enemy("石子野人",1,500,80,5,8,0,5,250),
	Enemy("石斧野人暴徒",1,1500,80,15,4,0,35,200),
	Enemy("木盾野人暴徒",1,1750,30,15,4,0,5,10),
	Enemy("暴怒之花",1,500,50,5,2,0,5,200),
	Enemy("经历烈焰洗礼的一棵大树",1,2500,100,0,3,0,5,200),
	Enemy("经历寒冰洗礼的一棵大树",1,2500,100,0,3,0,5,200)
};
Enemy _ney(int n,int level){
	Enemy t=enemies[n];
	t.level=level;
	t.update();
	return t;
}
void mijing(){
	yzh:{}
	cls;
	cp("秘境",3);et;et;
	cp("1.装备秘境 0.退出");et;
	string s;
	cin>>s;
	if(s=="0")return;
	if(s=="1"){
		cls;
		cp("选择难度",3);et;
		if(player.elevel>25)cp("1.幽冥之宫 I",2);
		else cp("1.幽冥之宫 I          冒险等级达到25级后解锁",4);
		et;
		if(player.elevel>30)cp("1.幽冥之宫 II",2);
		else cp("2.幽冥之宫 II         冒险等级达到30级后解锁",4);
		et;
		if(player.elevel>35)cp("1.幽冥之宫 III",2);
		else cp("3.幽冥之宫 III        冒险等级达到35级后解锁",4);
		et;
		if(player.elevel>40)cp("1.幽冥之宫 IV",2);
		else cp("4.幽冥之宫 IV         冒险等级达到40级后解锁",4);
		et;
		if(player.elevel>45)cp("1.幽冥之宫 V",2);
		else cp("5.幽冥之宫 V          冒险等级达到45级后解锁",4);
		et;
		int kkk;
		cin>>kkk;
		switch(kkk){
			case 1:{
				vector<Enemy>enemies;
				for(int i=0;i<5;i++)
					enemies.push_back(_ney(0,25));
				for(int i=0;i<2;i++)
					enemies.push_back(_ney(1,25));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				enemies.clear();
				for(int i=0;i<3;i++)
					enemies.push_back(_ney(3,25));
				for(int i=0;i<2;i++)
					enemies.push_back(_ney(4,25));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				break;
			}
			case 2:{
				vector<Enemy>enemies;
				for(int i=0;i<3;i++)
					enemies.push_back(_ney(1,35));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				enemies.clear();
				enemies.push_back(_ney(2,35));
				enemies.push_back(_ney(3,35));
				enemies.push_back(_ney(4,35));
				enemies.push_back(_ney(5,35));
				enemies.push_back(_ney(6,35));
				enemies.push_back(_ney(7,35));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				break;
			}
			case 3:{
				vector<Enemy>enemies;
				for(int i=0;i<2;i++)
					enemies.push_back(_ney(8,50));
				for(int i=0;i<2;i++)
					enemies.push_back(_ney(1,50));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				enemies.clear();
				for(int i=0;i<3;i++)
					enemies.push_back(_ney(3,50));
				for(int i=0;i<2;i++)
					enemies.push_back(_ney(4,50));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				enemies.clear();
				enemies.push_back(_ney(2,50));
				enemies.push_back(_ney(3,50));
				enemies.push_back(_ney(4,50));
				enemies.push_back(_ney(5,50));
				enemies.push_back(_ney(6,50));
				enemies.push_back(_ney(7,50));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				break;
			}
			case 4:{
				vector<Enemy>enemies;
				for(int i=0;i<2;i++)
					enemies.push_back(_ney(0,80));
				for(int i=0;i<2;i++)
					enemies.push_back(_ney(1,80));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				enemies.clear();
				enemies.push_back(_ney(10,80));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				break;
			}
			case 5:{
				vector<Enemy>enemies;
				enemies.clear();
				for(int i=0;i<3;i++)
					enemies.push_back(_ney(3,90));
				for(int i=0;i<2;i++)
					enemies.push_back(_ney(4,90));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				enemies.clear();
				enemies.push_back(_ney(10,90));
				if(!fight(enemies)){
					cls;
					cp("你死了!",4);
					Sleep(1000);
					goto yzh;
				}
				break;
			}
		}
		cls;
		kkksc0:{}
		switch(kkk){
			case 1:{
				int t=rand()%10;
				if(t==0){
					nzb(rand()%5+1,3);
					nzb(rand()%5+1,3);
				}
				else nzb(rand()%5+1,3);
				t=rand()%2+5;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,2);
				}
				t=rand()%2+5;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,1);
				}
				break;
			}
			case 2:{
				int t=rand()%2;
				if(t){
					t=rand()%10;
					if(t==0){
						nzb(rand()%5+1,4);
						nzb(rand()%5+1,4);
					}
					else nzb(rand()%5+1,4);
				}
				t=rand()%2+3;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,3);
				}
				t=rand()%2+6;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,2);
				}
				t=rand()%2+6;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,1);
				}
				break;
			}
			case 3:{
				int t=rand()%10;
				if(t==0){
					nzb(rand()%5+1,4);
					nzb(rand()%5+1,4);
				}
				else nzb(rand()%5+1,4);
				t=rand()%2+5;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,3);
				}
				t=rand()%2+6;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,2);
				}
				t=rand()%2+6;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,1);
				}
				break;
			}
			case 4:{
				int t=rand()%2;
				if(t){
					t=rand()%10;
					if(t==0){
						nzb(rand()%5+1,5);
						nzb(rand()%5+1,5);
					}
					else nzb(rand()%5+1,5);
				}
				t=rand()%2+3;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,4);
				}
				t=rand()%2+5;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,3);
				}
				t=rand()%2+6;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,2);
				}
				t=rand()%2+6;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,1);
				}
				break;
			}
			case 5:{
				int t=rand()%10;
				if(t==0){
					nzb(rand()%5+1,5);
					nzb(rand()%5+1,5);
				}
				else nzb(rand()%5+1,5);
				t=rand()%2+3;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,4);
				}
				t=rand()%2+5;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,3);
				}
				t=rand()%2+6;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,2);
				}
				t=rand()%2+6;
				for(int i=0;i<t;i++){
					nzb(rand()%5+1,1);
				}
				break;
			}
		}
		pause;
		goto yzh;
	}
}
void tanxian(){
	player.playerlevel=90;
	yzh:{}
	cls;
	cp("你要去哪?",2);et;
	for(int i=1;i<=30;i++)
		cp("--",i%15+1,0);
	et;
	cp("1.野外 2.旅馆 3.商店 4.秘境 5.烹饪 6.挖矿 0.退出");et;
	string s;
	cin>>s;
	if(s=="0")return;
	else if(s=="2"){
		cls;
		cp("你遇到了旅馆",2,0,1);et;et;
		cp("旅馆老板欢迎你到旅馆休息",2,0,1);et;et;
		cp("只需要",4);
		cp("5000个金币",6);et;et;
		cp("1.是 2.否");et;
		cin>>s;
		if(s=="1"&&money>=5000){
			cp("你在旅馆睡了一觉……",2);et;
			cp("血量+"+to_string(player.maxHealth-player.health),2);et;
			player.health=player.maxHealth;
			money-=5000;
		}else{
			cp("你离开了旅馆。");
			if(s=="1"&&money<5000){
				cp("更重要的是");
				cp("你钱不够……",4); 
			}
		}
		et;et;
		pause;
		return;
	}else if(s=="3"){
		cls;
		cp("你来到了商店",15,0,1);et;et;
		cp("你要买什么?");et;
		for(int i=1;i<=30;i++)
			cp("--",i%15+1,0);
		et;
		cp("1.普通物品 2.材料 0.退出");et;
		cin>>s;
		if(s=="1"){
			cls;
			cp("你来到了商店");et;et;
			cp("你要买什么?");et;
			for(int i=1;i<=30;i++)
				cp("--",i%15+1,0);
			et;
			int cnt=0;
			vector<pair<Item,pair<int,int> > >temp_item;
			for(int j=5;j>=1;j--){
				for(int i=0;i<item_count[1][j];i++){
					Item t=items[j][i];
					if(t.id==17)continue;
					cp(to_string(++cnt)+".",t.color);
					ci(1,t.star,i,t.id,1,false);
					cp("$",6);
					cp(to_string(t.price),6);et;
					temp_item.push_back({t,{j,i}});
				}
			}
			int kkk,fs,fi;
			cin>>kkk;
			Item temp=temp_item[kkk-1].first;
			fs=temp_item[kkk-1].second.first;
			fi=temp_item[kkk-1].second.second;
			cp("要买几个?");et;
			int n;
			cin>>n;
			if(temp.price*n<=money){
				cp("购买成功!",2);et;
				ci(1,temp.star,fi,temp.id,n);et;
				money-=temp.price*n;
			}else{
				cp("购买失败!",4);et;
			}
		}else if(s=="2"){
			cls;
			cp("你来到了商店");et;et;
			cp("你要买什么?");et;
			for(int i=1;i<=30;i++)
				cp("--",i%15+1,0);
			et;
			int cnt=0;
			vector<pair<Item,pair<int,int> > >temp_item;
			for(int j=5;j>=1;j--){
				for(int i=0;i<item_count[4][j];i++){
					Item t=items[j][i];
					cp(to_string(++cnt)+".",t.color);
					ci(1,t.star,i,t.id,1,false);
					cp("$",6);
					cp(to_string(t.price),6);et;
					temp_item.push_back({t,{j,i}});
				}
			}
			cp("Error:没有物品",4);
			/*
			int kkk,fs,fi;
			cin>>kkk;
			Item temp=temp_item[kkk-1].first;
			fs=temp_item[kkk-1].second.first;
			fi=temp_item[kkk-1].second.second;
			*/
		}
		et;
		pause;
		return;
	}else if(s=="4"){
		mijing();
		goto yzh;
	}else if(s=="5"){
		cook();
		goto yzh;
	}
	int t=rand()%5*3;
	for(int i=0;i<=t;i++){
		cls;
		cp("探险中");
		for(int j=0;j<=i%3+1;j++)
			cp(".");
		Sleep(50);
	}
	cls;
	t=rand()%5+1;
	switch(t){
		case 1:{
			t=rand()%1000;
			cp("你遇到了",2);
			int kkks;
			if(t<=1+player.luck*100){
				cp("传奇",4);
				kkks=1;
			}else if(t<=50+player.luck*100){
				cp("珍贵",6);
				kkks=2;
			}else if(t<=300+player.luck*100){
				cp("稀有",3);
				kkks=3;
			}else{
				cp("普通",8);
				kkks=4;
			}
			cp("宝箱",2);
			et;
			t=rand()%100;
			int kkksc;
			if(t<=10+(4-kkks)){
				cp("宝箱里面塞满了东西",4);
				kkksc=1;
			}else if(t<=80+(4-kkks)){
				cp("宝箱里有一些东西,但不多",6);
				kkksc=2;
			}else if(t<=95+(4-kkks)){
				cp("宝箱里有一些神秘的碎片和金币",3);
				kkksc=3;
			}else{
				cp("宝箱里面什么也没有",8);
				kkksc=4;
			}
			if(kkksc!=4){
				int kkksc0[]={0,5000,500,100,50};
				et;
				t=rand()%(rand()%500+500)+kkksc0[kkks]*31;
				ci(7,5,0,24,kkksc0[kkks]);et;
				cp("金币+"+to_string(t),6);
				money+=t;
			}
			break;
		}
		case 2:{
			t=rand()%(rand()%500+500)+501;
			cp("你在路上捡到"+to_string(t)+"元钱",6);
			money+=t;
			break;
		}
		case 3:{
			cp("你什么也没有看到"); 
			break;
		}
		case 4:{
			int ttt[]={0,1,3,4,5,6,7,8};
			int tttt=rand()%8;
			fight(_n1(_ney(ttt[tttt],enemy_level)));
			break;
		}
		case 5:{
			cp("你在路上捡到一些神秘的碎片",3);et;
			ci(7,5,0,24,rand()%100+1);
			break;
		}
	}
	et;et;et;et;
	pause;
	goto yzh;
}
string tips[]={
"你说得对,但是……","Never gonna give you up~",
"应该 嘲讽并踩爆这个蒟蒻!","吃好喝好,一路走好",
"IOI AK ME!","g(cy)zh",
"警告 此人太蒻了,请小心","AFO",
"A trip to f**ky island","七下生物",//10
"小考小完,大考大完,中考中完,高考()()","逸一时,误一世",
"这不是Tips","6",
"美国的金钱叫美金,英国的金钱叫()()","不行了,太烧了,我要开始lg了!",
"飞机飞了飞机飞了飞机飞了飞机飞了","菜就多练",
"什么实力啊","不如原神(",//20 
"闪避只能持续3回合","++cjy",
"c++","不可以,总司令",
"Windows收到了毁灭性打击!","231",
"631","L",
"F**K","姬铌食哉始胎媒", //30
"抽卡必歪真菌","十连多黄真菌",
"你拍1,我拍1,你就是个大*B","froepen",
"//freopen","freopen(\"___.in\",\"r\",stdout)",
"如果你的性别永久转变,但是你会得到 1200 万美元,你愿意吗?我超,还有这种好事?","我是__的狗!",
"     :( 你的电脑遇到问题,需要重新启动。","     :(",//40
"    :)","     :D",
"听我说撅撅你","可爱捏,超了",
"olo","^v^",
"发射犇犇!","QwQ",
"我宣布个事!我是个**!","好,很有精神!",//50
"身寸米青","彳亍",
"艹","与朋友交而不身寸乎",
"三十而立","C艹",
"搏一搏,单车变摩托","搏一搏,摩托变单车",
"勃一勃,单车变摩托","勃一勃,摩托变单车",//60
"探险有风险,探前须谨慎" 
};
int _main(){
	
	while(1){
		player.update();
		SetConsoleTitle("A Game   by BC20260086");
		enemy_level=max(player.elevel-15,0)/5*10+3;
		cls;
		string s;
		cp("名字:",5);
		cp(name,5);et;
		cp("冒险等级:",3);
		cp(to_string(player.elevel),3);et;
		cp("玩家等级:",6);
		cp(to_string(player.playerlevel),6);et;
		cp("血量:",12);
		cp(" [",12);
		int t=double(player.health)/player.maxHealth*10;
		t=max(0,t);
		int t2=10-t;
		while(t--)
			cp("▄",12);
		while(t2--)
			cp(" ",12);
		cp(" ] ",12);
		t=double(player.health)/player.maxHealth*100;
		cp(" (",12);
		cp(to_string(t),12);
		cp("% ",12);
		cp(to_string(player.health),12);
		cp("/",12);
		cp(to_string(player.maxHealth),12);
		cp(")",12);
		et;
		cp("金钱:",6);
		cp(to_string(money),6);et;
		//////
		for(int i=1;i<=30;i++)
			cp("--",i%15+1,0);
		et;
		cp("你要干什么?\n");
		cp("1.探险 3.属性 4.移动 6.背包 7.图鉴 8.抽卡 1000.设置 1001.更新日志");et;et;
		cp("Tips:"+tips[rand()%61]);et;
		cin>>s;
		if(s=="1"){
			tanxian();
		}else if(s=="3"){
			player.show();
		}else if(s=="6"){
			show_bag();
		}else if(s=="7"){
			tujian();
		}else if(s=="8"){
			choose();
		}else if(s=="1000"){
			setting();
		}else if(s=="1001"){
			verison_update();
		}else if(s=="give"&&name=="Zuozhe"){
			int kkk,kkks,kkksc;
			cin>>kkk>>kkks>>kkksc;
			bag[kkk][kkks]+=kkksc;
			cout<<bag[kkk][kkks]<<endl;
			pause;
		}else if(s=="money"&&name=="Zuozhe"){
			money+=114514;
		}
	}
}
int main(){
	//bag[7][31]=1145;
	//HideCursor();
	cls;
	srand(time(NULL));
	srand(time(NULL)+rand()%114514);
	for(int i=0;i<16231;i++)
		FUS6231BCK+=char(rd(33,128));
	SetConsoleTitle("A Game   by BC20260086");
	cp("     Welcome to\n",8,0,1,30);
	cp("       Game\n",1,0);
	cp("     by BC20260086\n",12,0);
	for(int i=1;i<=15;i++)
		cp("--",i,0,1);
	et;et;
	int t=rand()%10;
	enemy_level=3;
	init();
	player.gender=2;
	if(t==0){
		cp("输入2开始\n",10,4);
		string s;
		cin>>s;
		if(s=="114514"){
			cp("home特有的无处不在(恼)\n",12,0);
			for(int i=0;i<1000;i++)
				cp("Windows收到了毁灭性打击!\n",12,0);
			while(1){malloc(10000);}
		}
		if(s=="0231"){
			name="Zuozhe";
			player.init();
			_main();
		}
		if(s!="2"){
			cls;
			cp("你真无聊\n",12,0,1,30);
			cp("输入2开始都不愿意吗?\n",12,0,1,50);
			cp("啊?\n",12,0,1,100);
			for(int i=120;i>=0;i--){
				cls;
				cp(to_string(i));
				cp("秒后进入游戏\n");
				Sleep(1000);
			}
		} 
		cp("恭喜你找到彩蛋!\n",2,0,1,100);
		Sleep(500);
	}else{
		cp("输入1开始\n",15,0);
		string s;
		cin>>s;
		if(s=="114514"){
			cp("home特有的无处不在(恼)\n",12,0);
			for(int i=0;i<1000;i++)
				cp("Windows收到了毁灭性打击!\n",12,0);
			while(1){malloc(10000);}
		}//631,yzhlover
		if(s=="0231"){
			name="Zuozhe";
			player.init();
			_main();
		}
		if(s!="1"){
			cls;
			cp("你真无聊\n",12,0,1,30);
			cp("输入1开始都不愿意吗?\n",12,0,1,50);
			cp("啊?\n",12,0,1,100);
			for(int i=120;i>=0;i--){
				cls;
				cp(to_string(i));
				cp("秒后进入游戏\n");
				Sleep(1000);
			}
		} 
	}
	cls;
	ji:{}
	cls;
	SetConsoleTitle("Read?");
	cp("是否读取存档?(1.是/ 其他.否)\n",15,0,1);
	string s;
	cin>>s;
	if(s=="1"){
		if(!read()){
			goto ji;
		}else{
			_main();
		}
	}
	else if(s=="114514"){
		cp("home特有的无处不在(恼)\n",12,0);
		for(int i=0;i<1000;i++)
			cp("Windows收到了毁灭性打击!\n",12,0);
		while(1){malloc(10000);}
	}
	else{
		player.update();
		SetConsoleTitle("Name?");
		cin.clear();
		while(1){
			cls;
			cp("你的名字(不支持空格)?\n",15,0,1);
			cin>>name;
			pr("你确定吗?");
			pr(name,100);
			pr("?(1.是/ 其他.否)\n");
			char c;
			cin>>c;
			cin.clear();
			if(c=='1')break;
		}
		player.init();
		while(1){
			cls;
			cp("你的性别?(",15,0,1);
			cp("1.男♂",1,0,1);
			cp("/2.女♀ ",4,0,1);
			cp(")\n");
			string s;
			cin>>s;
			player.gender=s[0]-'0';
			if(player.gender==1||player.gender==2)break;
		}
		cls;
		SetConsoleTitle("A Game   by BC20260086");
		cp("是否查看剧情?(1.是/ 其他。否)\n");
		string s;
		cin>>s;
		cls;
		if(s=="1"){
			pr("你,和你的");
			pr((player.gender==1)?"妹妹":"哥哥");
			pr(",是异世界的旅者。\n");Sleep(100);
			pr("到达这个世界的时候,遭遇了意外。\n");Sleep(100);
			pr("天上传来声音:“");
			cp("有朋自远方来,虽远必诛!",12,0,1,100);
			pr("”\n你们俩都摔了下来。\n");
			Sleep(1000);
			pr("不知道过了多久,你醒来了。\n");Sleep(100);
			pr("而你的法力,也被封印。\n你的");Sleep(100);
			pr((player.gender==1)?"妹妹":"哥哥");
			pr("也失散了.\n准备好冒险吧!\n");
			Sleep(1000);
		}
		SetConsoleTitle("Village");
		cls;
		pr("你看到前面有一个小镇。\n");Sleep(100);
		pr("却有一个怪物,拿着武器,要进攻小镇。\n");Sleep(100);
		cp("是否保护小镇?(1.是/ 其他。否)\n");
		cin>>s;
		cls;
		if(s=="1"){
			atatz:{}
			cp("开始战斗!",15,0,1);
			Sleep(231);
			if(!fight(_n1(Enemy("小镇的刺客",enemy_level,1631,77,23,3))))
				main();
		}else{
			pr("那个怪物,");
			cp("突然向你冲来!\n",12,0,1,75);
			goto atatz;
		}
		cp("解决了威胁,你顺利进入村庄。",15,0,1);
		pause;
	}
	ikun:{_main();}
}