这一期潜心制作的冒险游戏,把矿洞1-3的稀有度、熔炉,及程序编写完成。铁器时代正式开始下期我们来创作后两种矿洞!
#include<bits/stdc++.h>
#include<conio.h>
#include<windows.h>
#define x Sleep(200);
using namespace std;
string arrow=">>";
int initial_choose=1;
int mi=99,mj=49;
int level=1,exe=0;
string bag[100]={""};
int ge[100];
int g,cave;
int temp;
int oo=0;
int Marki=1000000,Markj=1000000;
char pifu[100]={'0','1','2','3','4','5','6','7','8','9','~','!','@','#','$','%','^','&','*','(',')','-','_','=','+','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','[',']','|','{','}',';',':','<','>','?'};
char random_map[500][500]={
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
};
void To_continue()
{
string tcontinue;
tcontinue=getch();
system("cls");
}
void i_choose(int arr)
{
cout<<" ";
if(initial_choose==arr)
{
cout<<arrow;
}
else
{
cout<<" ";
}
}
void Print_initial()
{
cout<<endl;
cout<<" 冒 险 游 戏"<<endl<<endl;
cout<<"===================================================================="<<endl;
cout<<" W S 选择 K 确定"<<endl;
cout<<"===================================================================="<<endl<<endl<<endl<<endl;
i_choose(1);
cout<<" 1.开始游戏"<<endl<<endl;
i_choose(2);
cout<<" 2.游戏说明"<<endl<<endl;
i_choose(3);
cout<<" 3.换皮肤"<<endl<<endl;
i_choose(4);
cout<<" 4.退出游戏"<<endl<<endl;
cout<<"===================================================================="<<endl;
cout<<" 制作:Magnolia_tree"<<endl;
cout<<"===================================================================="<<endl;
}
void set_tree()
{
cout<<"系统生成树";
cout<<"·";
x;
cout<<"·";
x;
cout<<"·";
x;
cout<<"·";
x;
cout<<"·";
x;
cout<<"·";
cout<<endl;
srand(time(0));
while(g<200)
{
int treei=rand()%200,treej=rand()%100;
if(treei==mi&&treej==mj)
{
continue;
}
g++;
random_map[treei][treej]='T';
}
}
void set_cave()
{
cout<<"系统生成矿洞";
cout<<"·";
x;
cout<<"·";
x;
cout<<"·";
x;
cout<<"·";
x;
cout<<"·";
x;
cout<<"·";
x;
cout<<endl;
srand(time(0));
while(cave<40)
{
int cavei=rand()%200,cavej=rand()%100;
if(cavei==mi&&cavej==mj)
{
continue;
}
cave++;
random_map[cavei][cavej]='C';
}
}
bool muban(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="mt"&&b==c&&c==d&&d==e&&e==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(b=="mt"&&a==c&&c==d&&d==e&&e==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(c=="mt"&&a==b&&b==d&&d==e&&e==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(d=="mt"&&a==b&&b==c&&c==e&&e==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(e=="mt"&&a==b&&b==c&&c==d&&d==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(f=="mt"&&a==b&&b==c&&c==d&&d==e&&e==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(g=="mt"&&a==b&&b==c&&c==d&&d==e&&e==f&&f==h&&h==i&&i=="w")
{
return true;
}
if(h=="mt"&&a==b&&b==c&&c==d&&d==e&&e==f&&f==g&&g==i&&i=="w")
{
return true;
}
if(i=="mt"&&a==b&&b==c&&c==d&&d==e&&e==f&&f==g&&g==h&&h=="w")
{
return true;
}
return false;
}
bool mugun(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="mb"&&b==c&&c==d&&d==e&&e==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(b=="mb"&&a==c&&c==d&&d==e&&e==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(c=="mb"&&a==b&&b==d&&d==e&&e==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(d=="mb"&&a==b&&b==c&&c==e&&e==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(e=="mb"&&a==b&&b==c&&c==d&&d==f&&f==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(f=="mb"&&a==b&&b==c&&c==d&&d==e&&e==g&&g==h&&h==i&&i=="w")
{
return true;
}
if(g=="mb"&&a==b&&b==c&&c==d&&d==e&&e==f&&f==h&&h==i&&i=="w")
{
return true;
}
if(h=="mb"&&a==b&&b==c&&c==d&&d==e&&e==f&&f==g&&g==i&&i=="w")
{
return true;
}
if(i=="mb"&&a==b&&b==c&&c==d&&d==e&&e==f&&f==g&&g==h&&h=="w")
{
return true;
}
return false;
}
bool mujian(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="mb"&&d=="mb"&&g=="mg"&&b==c&&c==e&&e==f&&f==h&&h==i&&i=="w")
{
return true;
}
if(b=="mb"&&e=="mb"&&h=="mg"&&a==c&&c==d&&d==f&&f==g&&g==i&&i=="w")
{
return true;
}
if(c=="mb"&&f=="mb"&&i=="mg"&&a==b&&b==d&&d==e&&e==g&&g==h&&h=="w")
{
return true;
}
return false;
}
bool mugao(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="mb"&&b=="mb"&&c=="mb"&&e=="mg"&&h=="mg"&&d==f&&f==g&&g==i&&i=="w")
{
return true;
}
return false;
}
bool mufu(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="mb"&&b=="mb"&&d=="mb"&&e=="mg"&&h=="mg"&&c==f&&f==g&&g==i&&i=="w")
{
return true;
}
if(b=="mb"&&c=="mb"&&e=="mb"&&f=="mg"&&i=="mg"&&a==d&&d==g&&g==h&&h=="w")
{
return true;
}
return false;
}
bool shijian(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="ys"&&d=="ys"&&g=="mg"&&b==c&&c==e&&e==f&&f==h&&h==i&&i=="w")
{
return true;
}
if(b=="ys"&&e=="ys"&&h=="mg"&&a==c&&c==d&&d==f&&f==g&&g==i&&i=="w")
{
return true;
}
if(c=="ys"&&f=="ys"&&i=="mg"&&a==b&&b==d&&d==e&&e==g&&g==h&&h=="w")
{
return true;
}
return false;
}
bool shigao(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="ys"&&b=="ys"&&c=="ys"&&e=="mg"&&h=="mg"&&d==f&&f==g&&g==i&&i=="w")
{
return true;
}
return false;
}
bool shifu(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="ys"&&b=="ys"&&d=="ys"&&e=="mg"&&h=="mg"&&c==f&&f==g&&g==i&&i=="w")
{
return true;
}
if(b=="ys"&&c=="ys"&&e=="ys"&&f=="mg"&&i=="mg"&&a==d&&d==g&&g==h&&h=="w")
{
return true;
}
return false;
}
bool ronglu(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="ys"&&b=="ys"&&c=="ys"&&d=="ys"&&f=="ys"&&g=="ys"&&h=="ys"&&i=="ys"&&e=="w")
{
return true;
}
return false;
}
bool tiejian(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="td"&&d=="td"&&g=="mg"&&b==c&&c==e&&e==f&&f==h&&h==i&&i=="w")
{
return true;
}
if(b=="td"&&e=="td"&&h=="mg"&&a==c&&c==d&&d==f&&f==g&&g==i&&i=="w")
{
return true;
}
if(c=="td"&&f=="td"&&i=="mg"&&a==b&&b==d&&d==e&&e==g&&g==h&&h=="w")
{
return true;
}
return false;
}
bool tiegao(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="td"&&b=="td"&&c=="td"&&e=="mg"&&h=="mg"&&d==f&&f==g&&g==i&&i=="w")
{
return true;
}
return false;
}
bool tiefu(string a,string b,string c,string d,string e,string f,string g,string h,string i)
{
if(a=="td"&&b=="td"&&d=="td"&&e=="mg"&&h=="mg"&&c==f&&f==g&&g==i&&i=="w")
{
return true;
}
if(b=="td"&&c=="td"&&e=="td"&&f=="mg"&&i=="mg"&&a==d&&d==g&&g==h&&h=="w")
{
return true;
}
return false;
}
void work()
{
cout<<"工作指南:"<<endl;
cout<<"木头:mt"<<endl;
cout<<"木板:mb"<<endl;
cout<<"木棍:mg"<<endl;
cout<<"原石:ys"<<endl;
cout<<"铁锭:td"<<endl;
cout<<"随便一个格填入木头----------------------------------------------->4块木板(可以用来为矿石燃烧制成原料,还可以用来燃烧的——煤炭)"<<endl;
cout<<"随便一个格填入木板----------------------------------------------->2根木棍"<<endl;
cout<<"147/258/369顺序填入木板、木板、木棍------------------------------>木剑(剑:放入背包后有攻击加成)"<<endl;
cout<<"12358顺序填入木板、木板,木板、木棍、木棍------------------------>木镐(镐子:放入背包后有挖矿等效率提升)"<<endl;
cout<<"12458/23569顺序填入木板、木板、木板、木棍、木棍------------------>木斧(斧子:放入背包后有砍树等效率提升)"<<endl;
cout<<"147/258/369顺序填入原石、原石、木棍------------------------------>石剑"<<endl;
cout<<"12358顺序填入原石、原石、原石、木棍、木棍------------------------>石镐"<<endl;
cout<<"12458/23569顺序填入原石、原石、原石、木棍、木棍------------------>石斧"<<endl;
cout<<"1234679顺序填入原石、原石、原石、原石、原石、原石、原石、原石---->熔炉(熔炼矿石制成材料)"<<endl;
cout<<"147/258/369顺序填入铁锭、铁锭、木棍------------------------------>铁剑"<<endl;
cout<<"12358顺序填入铁锭、铁锭、铁锭、木棍、木棍------------------------>铁镐"<<endl;
cout<<"12458/23569顺序填入铁锭、铁锭、铁锭、木棍、木棍------------------>铁斧"<<endl;
for(int i=0;i<temp;i++)
{
cout<<bag[i]<<"拥有数:"<<ge[i]<<endl;
}
cout<<"工作台拥有数:1(上限1)"<<endl<<endl;
cout<<"1 2 3"<<endl<<endl;
cout<<"4 5 6"<<endl<<endl;
cout<<"7 8 9"<<endl<<endl;
cout<<"请分别填入物品进行合成。(不需要放置物品的格子直接输w。)"<<endl;
cout<<"1:";
string thing1;
cin>>thing1;
cout<<endl<<"2:";
string thing2;
cin>>thing2;
cout<<endl<<"3:";
string thing3;
cin>>thing3;
cout<<endl<<"4:";
string thing4;
cin>>thing4;
cout<<endl<<"5:";
string thing5;
cin>>thing5;
cout<<endl<<"6:";
string thing6;
cin>>thing6;
cout<<endl<<"7:";
string thing7;
cin>>thing7;
cout<<endl<<"8:";
string thing8;
cin>>thing8;
cout<<endl<<"9:";
string thing9;
cin>>thing9;
cout<<endl;
if(muban(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false;
for(int i=0;i<temp;i++)
{
if(bag[i]=="木头")
{
if(ge[i]==0)
{
cout<<"您没有木头!(木头可以通过砍树获得)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]--;
h=true;
break;
}
}
if(h==false)
{
cout<<"您没有木头!(木头可以通过砍树获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
cout<<"合成结果:4块木板"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="木板")
{
have=true;
ge[i]+=4;
break;
}
}
if(have==false)
{
bag[temp]="木板";
ge[temp++]=4;
}
}
if(mugun(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false;
for(int i=0;i<temp;i++)
{
if(bag[i]=="木板")
{
if(ge[i]==0)
{
cout<<"您没有木板!(木板通过用木头合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]--;
h=true;
break;
}
}
if(h==false)
{
cout<<"您没有木板!(木板通过用木头合成得到)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
cout<<"合成结果:2根木棍"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="木棍")
{
have=true;
ge[i]+=2;
break;
}
}
if(have==false)
{
bag[temp]="木棍";
ge[temp++]=2;
}
}
if(mujian(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="木板")
{
if(ge[i]<2)
{
cout<<"您没有足够的木板!(木板通过用木头合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=2;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]==0)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=2;
}
return ;
}
ge[i]--;
h1=true;
}
}
if(h==false)
{
cout<<"您没有木板!(木板通过用木头合成得到)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:木剑"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="木剑")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="木剑";
ge[temp++]=1;
}
}
if(mugao(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="木板")
{
if(ge[i]<3)
{
cout<<"您没有足够的木板!(木板通过用木头合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=3;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]<2)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=3;
}
return ;
}
ge[i]-=2;
h1=true;
}
}
if(h==false)
{
cout<<"您没有木板!(木板通过用木头合成得到)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:木镐"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="木镐")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="木镐";
ge[temp++]=1;
}
}
if(mufu(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="木板")
{
if(ge[i]<3)
{
cout<<"您没有足够的木板!(木板通过用木头合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=3;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]<2)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=3;
}
return ;
}
ge[i]-=2;
h1=true;
}
}
if(h==false)
{
cout<<"您没有木板!(木板通过用木头合成得到)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:木斧"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="木斧")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="木斧";
ge[temp++]=1;
}
}
if(shijian(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="原石")
{
if(ge[i]<2)
{
cout<<"您没有足够的原石!(原石通过挖矿获得)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=2;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]==0)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=2;
}
return ;
}
ge[i]--;
h1=true;
}
}
if(h==false)
{
cout<<"您没有原石!(原石通过挖矿获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:石剑"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="石剑")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="石剑";
ge[temp++]=1;
}
}
if(shigao(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="原石")
{
if(ge[i]<3)
{
cout<<"您没有足够的原石!(原石通过挖矿获得)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=3;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]<2)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=3;
}
return ;
}
ge[i]-=2;
h1=true;
}
}
if(h==false)
{
cout<<"您没有原石!(原石通过挖矿获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:石镐"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="石镐")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="石镐";
ge[temp++]=1;
}
}
if(shifu(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="原石")
{
if(ge[i]<3)
{
cout<<"您没有足够的原石!(原石通过挖矿获得)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=3;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]<2)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=3;
}
return ;
}
ge[i]-=2;
h1=true;
}
}
if(h==false)
{
cout<<"您没有原石!(原石通过挖矿获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:石斧"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="石斧")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="石斧";
ge[temp++]=1;
}
}
if(ronglu(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false;
for(int i=0;i<temp;i++)
{
if(bag[i]=="原石")
{
if(ge[i]<8)
{
cout<<"您没有足够的原石!(原石可以通过挖矿获得)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]--;
h=true;
break;
}
}
if(h==false)
{
cout<<"您没有足够的原石!(原石可以通过挖矿获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
cout<<"合成结果:熔炉"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="熔炉")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="熔炉";
ge[temp++]=1;
}
}
if(tiejian(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="铁锭")
{
if(ge[i]<2)
{
cout<<"您没有足够的铁锭!(铁锭通过挖矿、熔炼获得)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=2;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]==0)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=2;
}
return ;
}
ge[i]--;
h1=true;
}
}
if(h==false)
{
cout<<"您没有铁锭!(铁锭通过挖矿、熔炼获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:铁剑"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="铁剑")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="铁剑";
ge[temp++]=1;
}
}
if(tiegao(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="铁锭")
{
if(ge[i]<3)
{
cout<<"您没有足够的铁锭!(铁锭通过挖矿、熔炼获得)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=3;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]<2)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=3;
}
return ;
}
ge[i]-=2;
h1=true;
}
}
if(h==false)
{
cout<<"您没有铁锭!(铁锭通过挖矿、熔炼获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:铁镐"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="铁镐")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="铁镐";
ge[temp++]=1;
}
}
if(tiefu(thing1,thing2,thing3,thing4,thing5,thing6,thing7,thing8,thing9)==true)
{
bool h=false,h1=false,tmp=false;
int tmp1;
for(int i=0;i<temp;i++)
{
if(bag[i]=="铁锭")
{
if(ge[i]<3)
{
cout<<"您没有足够的铁锭!(铁锭通过挖矿、熔炼获得)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
ge[i]-=3;
tmp=true;
tmp1=i;
h=true;
}
if(bag[i]=="木棍")
{
if(ge[i]<2)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
if(tmp==true)
{
ge[tmp1]+=3;
}
return ;
}
ge[i]-=2;
h1=true;
}
}
if(h==false)
{
cout<<"您没有铁锭!(铁锭通过挖矿、熔炼获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
return ;
}
if(h1==false)
{
cout<<"您没有木棍!(木棍通过用木板合成得到)"<<endl;
cout<<"按任意键继续······"<<endl;
To_continue();
return ;
}
cout<<"合成结果:铁斧"<<endl;
cout<<"已放入背包!"<<endl;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="铁斧")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="铁斧";
ge[temp++]=1;
}
}
cout<<"按任意键继续······";
To_continue();
}
void rubbish()
{
char Rcave[100][100]={
"SSSSSSSSSS",
"SSSSSSSS ",
"SSSSSSSS S",
"SSS S",
"SSSSSSSSSS",
};
int Ci=1,Cj=9;
Rcave[Ci][Cj]=pifu[oo];
while(1)
{
for(int i=0;i<5;i++)
{
for(int j=0;j<10;j++)
{
cout<<Rcave[i][j];
}
cout<<endl;
}
cout<<"Tip:i挖掘,j返回下矿初始地点,原路返回即可出矿洞。"<<endl;
cout<<"当前坐标位置:("<<Ci+1<<","<<Cj+1<<")"<<endl;
string ope;
ope=getch();
if(ope=="i")
{
if(Rcave[Ci-1][Cj]=='S'||Rcave[Ci][Cj-1]=='S'||Rcave[Ci+1][Cj]=='S'||Rcave[Ci][Cj+1]=='S')
{
bool fast=false,fast1=false,fast2=false;
for(int i=0;i<temp;i++)
{
if(bag[i]=="木镐")
{
fast=true;
}
if(bag[i]=="石镐")
{
fast1=true;
}
if(bag[i]=="铁镐")
{
fast2=true;
}
}
cout<<endl;
if(fast==true||fast1==true||fast2==true)
{
bool haved=false;
if(fast2==true)
{
haved=true;
cout<<"■20%"<<endl;
Sleep(500);
cout<<"■■40%"<<endl;
Sleep(500);
cout<<"■■■60%"<<endl;
Sleep(500);
cout<<"■■■■80%"<<endl;
Sleep(500);
cout<<"■■■■■100%!"<<endl;
}
if(fast1==true&&haved==false)
{
haved=true;
cout<<"■20%"<<endl;
Sleep(700);
cout<<"■■40%"<<endl;
Sleep(700);
cout<<"■■■60%"<<endl;
Sleep(700);
cout<<"■■■■80%"<<endl;
Sleep(700);
cout<<"■■■■■100%!"<<endl;
}
if(fast==true&&haved==false)
{
haved=true;
cout<<"■20%"<<endl;
Sleep(800);
cout<<"■■40%"<<endl;
Sleep(800);
cout<<"■■■60%"<<endl;
Sleep(800);
cout<<"■■■■80%"<<endl;
Sleep(800);
cout<<"■■■■■100%!"<<endl;
}
}
else
{
cout<<"您没有木镐!(木镐通过合成获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
continue;
}
cout<<"获得原石!"<<endl<<"按任意键继续······";
To_continue();
bool no=false;
if(Rcave[Ci-1][Cj]=='S')
{
Rcave[Ci-1][Cj]=' ';
no=true;
}
if(Rcave[Ci+1][Cj]=='S'&&no==false)
{
Rcave[Ci+1][Cj]=' ';
no=true;
}
if(Rcave[Ci][Cj+1]=='S'&&no==false)
{
Rcave[Ci][Cj+1]=' ';
no=true;
}
if(Rcave[Ci][Cj-1]=='S'&&no==false)
{
Rcave[Ci][Cj-1]=' ';
no=true;
}
exe+=40;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="原石")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="原石";
ge[temp++]=1;
}
}
else
{
cout<<"您身边没有原石"<<endl;
cout<<"按任意键继续······";
To_continue();
}
}
if(ope=="d"&&Ci==1&&Cj==9)
{
return ;
}
if(ope=="w"&&Rcave[Ci-1][Cj]==' ')
{
Rcave[Ci][Cj]=' ';
Ci--;
Rcave[Ci][Cj]=pifu[oo];
}
if(ope=="a"&&Rcave[Ci][Cj-1]==' ')
{
Rcave[Ci][Cj]=' ';
Cj--;
Rcave[Ci][Cj]=pifu[oo];
}
if(ope=="s"&&Rcave[Ci+1][Cj]==' ')
{
Rcave[Ci][Cj]=' ';
Ci++;
Rcave[Ci][Cj]=pifu[oo];
}
if(ope=="d"&&Rcave[Ci][Cj+1]==' '&&Cj!=9)
{
Rcave[Ci][Cj]=' ';
Cj++;
Rcave[Ci][Cj]=pifu[oo];
}
if(ope=="b")
{
for(int i=0;i<temp;i++)
{
cout<<bag[i]<<"拥有数:"<<ge[i]<<endl;
}
cout<<"工作台拥有数:1(上限1)"<<endl;
cout<<"按任意键继续······";
To_continue();
}
if(ope=="q")
{
Marki=Ci;
Markj=Cj;
cout<<"标记目标点!"<<endl;
cout<<"按任意键继续······";
To_continue();
}
if(ope=="g")
{
Rcave[Ci][Cj]=' ';
Ci=Marki;
Cj=Markj;
Rcave[Ci][Cj]=pifu[oo];
system("cls");
continue;
}
if(ope=="j")
{
Rcave[Ci][Cj]=' ';
Ci=1;
Cj=9;
Rcave[Ci][Cj]=pifu[oo];
system("cls");
continue;
}
if(ope=="o")
{
system("cls");
work();
}
system("cls");
}
}
void L_rubbish()
{
char Lcave[100][100]={
"SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
"SSSSSSSSSSSS ",
"MSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
"MMSSSSSSSSSSSSSSSSSSSSS SSSSSSS",
"MSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
"SSSSSSSSSSSSSSSSS SSSSSSSSSSSSS",
"SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
"SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
"SSMSSSSSMSSSSSSSSSSSSSSSSSSSSS ",
"SMMMSSSSMMSSSSSSSSSSSSSSSSSSSSS",
};
int Li=1,Lj=29;
Lcave[Li][Lj]=pifu[oo];
while(1)
{
for(int i=0;i<10;i++)
{
for(int j=0;j<30;j++)
{
cout<<Lcave[i][j];
}
cout<<endl;
}
cout<<"Tip:i挖掘,j返回下矿初始地点,原路返回即可出矿洞。"<<endl;
cout<<"当前坐标位置:("<<Li+1<<","<<Lj+1<<")"<<endl;
string ope;
ope=getch();
if(ope=="i")
{
if(Lcave[Li-1][Lj]!=' '||Lcave[Li][Lj-1]!=' '||Lcave[Li+1][Lj]!=' '||Lcave[Li][Lj+1]!=' ')
{
bool front,back,left,right;
front=back=left=right=false;
if(Lcave[Li-1][Lj]!=' ')
{
front=true;
}
if(Lcave[Li+1][Lj]!=' ')
{
back=true;
}
if(Lcave[Li][Lj+1]!=' ')
{
right=true;
}
if(Lcave[Li][Lj-1]!=' ')
{
left=true;
}
cout<<"您希望挖掘:";
if(front==true)
{
cout<<"前面的(f) ";
}
if(back==true)
{
cout<<"后面的(b) ";
}
if(right==true)
{
cout<<"右面的(r) ";
}
if(left==true)
{
cout<<"左面的(l) ";
}
string aaa;
aaa=getch();
bool fast=false,fast1=false,fast2=false;
for(int i=0;i<temp;i++)
{
if(bag[i]=="木镐")
{
fast=true;
}
if(bag[i]=="石镐")
{
fast1=true;
}
if(bag[i]=="铁镐")
{
fast2=true;
}
}
cout<<endl;
if(Lj==0&&aaa=="l")
{
cout<<"不要卡BUG哦!"<<endl;
cout<<"按任意键继续······";
To_continue();
continue;
}
if(aaa=="f"&&Lcave[Li-1][Lj]==' ')
{
cout<<"您前面是空气!"<<endl;
cout<<"按任意键继续······";
To_continue();
continue;
}
if(aaa=="b"&&Lcave[Li+1][Lj]==' ')
{
cout<<"您后面是空气!"<<endl;
cout<<"按任意键继续······";
To_continue();
continue;
}
if(aaa=="r"&&Lcave[Li][Lj+1]==' ')
{
cout<<"您右面是空气!"<<endl;
cout<<"按任意键继续······";
To_continue();
continue;
}
if(aaa=="l"&&Lcave[Li][Lj-1]==' ')
{
cout<<"您左面是空气!"<<endl;
cout<<"按任意键继续······";
To_continue();
continue;
}
if(aaa!="f"&&aaa!="b"&&aaa!="r"&&aaa!="l")
{
cout<<"看,空气!"<<endl;
cout<<"按任意键继续······";
To_continue();
continue;
}
if(fast==true||fast1==true||fast2==true)
{
bool haved=false;
if(fast2==true)
{
haved=true;
if(aaa=="f")
{
if(Lcave[Li-1][Lj]=='S')
{
cout<<"■20%"<<endl;
Sleep(500);
cout<<"■■40%"<<endl;
Sleep(500);
cout<<"■■■60%"<<endl;
Sleep(500);
cout<<"■■■■80%"<<endl;
Sleep(500);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(650);
cout<<"■■40%"<<endl;
Sleep(650);
cout<<"■■■60%"<<endl;
Sleep(650);
cout<<"■■■■80%"<<endl;
Sleep(650);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="b")
{
if(Lcave[Li+1][Lj]=='S')
{
cout<<"■20%"<<endl;
Sleep(500);
cout<<"■■40%"<<endl;
Sleep(500);
cout<<"■■■60%"<<endl;
Sleep(500);
cout<<"■■■■80%"<<endl;
Sleep(500);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(650);
cout<<"■■40%"<<endl;
Sleep(650);
cout<<"■■■60%"<<endl;
Sleep(650);
cout<<"■■■■80%"<<endl;
Sleep(650);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="r")
{
if(Lcave[Li][Lj+1]=='S')
{
cout<<"■20%"<<endl;
Sleep(500);
cout<<"■■40%"<<endl;
Sleep(500);
cout<<"■■■60%"<<endl;
Sleep(500);
cout<<"■■■■80%"<<endl;
Sleep(500);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(650);
cout<<"■■40%"<<endl;
Sleep(650);
cout<<"■■■60%"<<endl;
Sleep(650);
cout<<"■■■■80%"<<endl;
Sleep(650);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="l")
{
if(Lcave[Li][Lj-1]=='S')
{
cout<<"■20%"<<endl;
Sleep(500);
cout<<"■■40%"<<endl;
Sleep(500);
cout<<"■■■60%"<<endl;
Sleep(500);
cout<<"■■■■80%"<<endl;
Sleep(500);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(650);
cout<<"■■40%"<<endl;
Sleep(650);
cout<<"■■■60%"<<endl;
Sleep(650);
cout<<"■■■■80%"<<endl;
Sleep(650);
cout<<"■■■■■100%!"<<endl;
}
}
}
if(fast1==true&&haved==false)
{
haved=true;
if(aaa=="f")
{
if(Lcave[Li-1][Lj]=='S')
{
cout<<"■20%"<<endl;
Sleep(700);
cout<<"■■40%"<<endl;
Sleep(700);
cout<<"■■■60%"<<endl;
Sleep(700);
cout<<"■■■■80%"<<endl;
Sleep(700);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(850);
cout<<"■■40%"<<endl;
Sleep(850);
cout<<"■■■60%"<<endl;
Sleep(850);
cout<<"■■■■80%"<<endl;
Sleep(850);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="b")
{
if(Lcave[Li+1][Lj]=='S')
{
cout<<"■20%"<<endl;
Sleep(700);
cout<<"■■40%"<<endl;
Sleep(700);
cout<<"■■■60%"<<endl;
Sleep(700);
cout<<"■■■■80%"<<endl;
Sleep(700);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(850);
cout<<"■■40%"<<endl;
Sleep(850);
cout<<"■■■60%"<<endl;
Sleep(850);
cout<<"■■■■80%"<<endl;
Sleep(850);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="r")
{
if(Lcave[Li][Lj+1]=='S')
{
cout<<"■20%"<<endl;
Sleep(700);
cout<<"■■40%"<<endl;
Sleep(700);
cout<<"■■■60%"<<endl;
Sleep(700);
cout<<"■■■■80%"<<endl;
Sleep(700);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(850);
cout<<"■■40%"<<endl;
Sleep(850);
cout<<"■■■60%"<<endl;
Sleep(850);
cout<<"■■■■80%"<<endl;
Sleep(850);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="l")
{
if(Lcave[Li][Lj-1]=='S')
{
cout<<"■20%"<<endl;
Sleep(700);
cout<<"■■40%"<<endl;
Sleep(700);
cout<<"■■■60%"<<endl;
Sleep(700);
cout<<"■■■■80%"<<endl;
Sleep(700);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(850);
cout<<"■■40%"<<endl;
Sleep(850);
cout<<"■■■60%"<<endl;
Sleep(850);
cout<<"■■■■80%"<<endl;
Sleep(850);
cout<<"■■■■■100%!"<<endl;
}
}
}
if(fast==true&&haved==false)
{
haved=true;
if(aaa=="f")
{
if(Lcave[Li-1][Lj]=='S')
{
cout<<"■20%"<<endl;
Sleep(800);
cout<<"■■40%"<<endl;
Sleep(800);
cout<<"■■■60%"<<endl;
Sleep(800);
cout<<"■■■■80%"<<endl;
Sleep(800);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(950);
cout<<"■■40%"<<endl;
Sleep(950);
cout<<"■■■60%"<<endl;
Sleep(950);
cout<<"■■■■80%"<<endl;
Sleep(950);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="b")
{
if(Lcave[Li+1][Lj]=='S')
{
cout<<"■20%"<<endl;
Sleep(800);
cout<<"■■40%"<<endl;
Sleep(800);
cout<<"■■■60%"<<endl;
Sleep(800);
cout<<"■■■■80%"<<endl;
Sleep(800);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(950);
cout<<"■■40%"<<endl;
Sleep(950);
cout<<"■■■60%"<<endl;
Sleep(950);
cout<<"■■■■80%"<<endl;
Sleep(950);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="r")
{
if(Lcave[Li][Lj+1]=='S')
{
cout<<"■20%"<<endl;
Sleep(800);
cout<<"■■40%"<<endl;
Sleep(800);
cout<<"■■■60%"<<endl;
Sleep(800);
cout<<"■■■■80%"<<endl;
Sleep(800);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(950);
cout<<"■■40%"<<endl;
Sleep(950);
cout<<"■■■60%"<<endl;
Sleep(950);
cout<<"■■■■80%"<<endl;
Sleep(950);
cout<<"■■■■■100%!"<<endl;
}
}
if(aaa=="l")
{
if(Lcave[Li][Lj-1]=='S')
{
cout<<"■20%"<<endl;
Sleep(800);
cout<<"■■40%"<<endl;
Sleep(800);
cout<<"■■■60%"<<endl;
Sleep(800);
cout<<"■■■■80%"<<endl;
Sleep(800);
cout<<"■■■■■100%!"<<endl;
}
else
{
cout<<"■20%"<<endl;
Sleep(950);
cout<<"■■40%"<<endl;
Sleep(950);
cout<<"■■■60%"<<endl;
Sleep(950);
cout<<"■■■■80%"<<endl;
Sleep(950);
cout<<"■■■■■100%!"<<endl;
}
}
}
}
else
{
cout<<"您没有木镐!(木镐通过合成获得)"<<endl;
cout<<"按任意键继续······";
To_continue();
continue;
}
if((aaa=="f"&&Lcave[Li-1][Lj]=='S')||(aaa=="b"&&Lcave[Li+1][Lj]=='S')||(aaa=="r"&&Lcave[Li][Lj+1]=='S')||(aaa=="l"&&Lcave[Li][Lj-1]=='S'))
{
bool no=false;
if(aaa=="f")
{
Lcave[Li-1][Lj]=' ';
no=true;
}
if(aaa=="b"&&no==false)
{
Lcave[Li+1][Lj]=' ';
no=true;
}
if(aaa=="r"&&no==false)
{
Lcave[Li][Lj+1]=' ';
no=true;
}
if(aaa=="l"&&no==false)
{
Lcave[Li][Lj-1]=' ';
no=true;
}
exe+=40;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="原石")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="原石";
ge[temp++]=1;
}
cout<<"获得原石!"<<endl<<"按任意键继续······";
}
else
{
bool no=false;
if(aaa=="f")
{
Lcave[Li-1][Lj]=' ';
no=true;
}
if(aaa=="b"&&no==false)
{
Lcave[Li+1][Lj]=' ';
no=true;
}
if(aaa=="r"&&no==false)
{
Lcave[Li][Lj+1]=' ';
no=true;
}
if(aaa=="l"&&no==false)
{
Lcave[Li][Lj-1]=' ';
no=true;
}
exe+=40;
bool have=false;
for(int i=0;i<100;i++)
{
if(bag[i]=="煤炭")
{
have=true;
ge[i]++;
break;
}
}
if(have==false)
{
bag[temp]="煤炭";
ge[temp++]=1;
}
cout<<"获得煤炭!"<<endl<<"按任意键继续······";
}
To_continue();
}
else
{
cout<<"您身边没有原石或煤炭"<<endl;
cout<<"按任意键继续······";
To_continue();
}
}
if(ope=="d"&&Li==1&&Lj==29)
{
return ;
}
if(ope=="w"&&Lcave[Li-1][Lj]==' ')
{
Lcave[Li][Lj]=' ';
Li--;
Lcave[Li][Lj]=pifu[oo];
}
if(ope=="a"&&Lcave[Li][Lj-1]==' ')
{
Lcave[Li][Lj]=' ';
Lj--;
Lcave[Li][Lj]=pifu[oo];
}
if(ope=="s"&&Lcave[Li+1][Lj]==' ')
{
Lcave[Li][Lj]=' ';
Li++;
Lcave[Li][Lj]=pifu[oo];
}
if(ope=="d"&&Lcave[Li][Lj+1]==' '&&Lj!=29)
{
Lcave[Li][Lj]=' ';
Lj++;
Lcave[Li][Lj]=pifu[oo];
}
if(ope=="b")
{
for(int i=0;i<temp;i++)
{
cout<<bag[i]<<"拥有数:"<<ge[i]<<endl;
}
cout<<"工作台拥有数:1(上限1)"<<endl;
cout<<"按任意键继续······";
To_continue();
}
if(ope=="q")
{
Marki=Li;
Markj=Lj;
cout<<"标记目标点!"<<endl;
cout<<"按任意键继续······";
To_continue();
}
if(ope=="g")
{
Lcave[Li][Lj]=' ';
Li=Marki;
Lj=Markj;
Lcave[Li][Lj]=pifu[oo];
system("cls");
continue;
}
if(ope=="j")
{
Lcave[Li][Lj]=' ';
Li=1;
Lj=29;
Lcave[Li][Lj]=pifu[oo];
system("cls");
continue;
}
if(ope=="o")
{
system("cls");
work();
}
system("cls");
}
}