srand(time(NULL));
while(1)
{
if(sheng<=0){
cout<<"you die!!!";
Sleep(1500);
return 0;
}//死亡停止
bool b=0;
if(kbhit())
{
int aa;
aa=getch();
if(aa==100){
if(dongs[0]==0){
cout<<"没水";
Sleep(1000);
continue;
}else{
water++;
if(water>10)water=10;
dongs[0]--;
dongs[2]++;
cout<<"中";
Sleep(1000);
continue;
}
}
if(aa==32){//工作方块使用改为空格
//工作方块
b=1;
if(a[ho.y][ho.x].m==6){
if(a[ho.y][ho.x].m==6&&(a[ho.y-1][ho.x].m==4||a[ho.y+1][ho.x].m==4||a[ho.y][ho.x-1].m==4||a[ho.y][ho.x+1].m==4))
{
cout<<"1:使用熔炉2:强化熔炉\n";
int sbsb;
cin>>sbsb;
if(sbsb==1){
cout<<"是否使用熔炉?是y否n\n";//提示
aa=getch();
if(aa==int('y'))
{
int sbsb1;
system("cls");
cout<<"熔炼哪个?\n1:粗铁\n2:钛矿\n3:钛合金(3钛+1铁=2钛合金)\n4:玻璃(碎片)(1些沙子)\n5:玻璃胚胎(后可制作其他不同的玻璃器品)(10玻璃碎片)\n6:玻璃瓶(1玻璃胚胎)\n";
cin>>sbsb1;
if(sbsb1==6){
if(blcx==0){
cout<<"没有玻璃胚胎!";
Sleep(1000);
system("cls");
}else{
blcx--;
cout<<"好了!";
blp++;
Sleep(1000);//延迟
system("cls");
}
}
if(sbsb1==1){
cout<<"烧几个?\n";
int sjg;
cin>>sjg;
if(dongs[7]<sjg){
cout<<"不够!";
Sleep(1000);//延迟
system("cls");
}else{
dongs[7]-=sjg;dongs[8]+=sjg;
if(ksrl[ho.y][ho.x]==false){
if(!xd3){
for(int j=0;j<sjg;j++){
for(int i=0;i<100;i+=2){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}//动画
}
}
}else{
if(!xd3){
for(int j=0;j<sjg;j++){
for(int i=0;i<100;i+=4){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}
}
}
}
cout<<name<<"用"<<sjg<<"粗铁换了"<<sjg<<"铁锭"<<endl;
Sleep(1000);//延迟
system("cls");
}
}if(sbsb1==2){
if(rlqh[ho.y][ho.x]==false){
cout<<"温度不够高(没有温度强化器)!\n";
Sleep(1000);//延迟
system("cls");
}else{
if(dongs[14]==0){
cout<<"没有钛矿!";
Sleep(1000);//延迟
system("cls");
}
else{
dongs[14]--;dongs[13]++;
if(ksrl[ho.y][ho.x]==false)
{
if(!xd3){
for(int i=0;i<100;i+=2){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}//动画
}
}else{
if(!xd3){
for(int i=0;i<100;i+=4){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}
}
}
cout<<name<<"用1钛矿铁换了1钛"<<endl;
Sleep(1000);//延迟
system("cls");
}
}
}
if(sbsb1==3){
if(rlqh[ho.y][ho.x]==false){
cout<<"温度不够高(没有温度强化器)!\n";
Sleep(1000);//延迟
system("cls");
}else{
if(dongs[14]<3||dongs[8]<1){
cout<<"钛和铁不足!";
Sleep(1000);//延迟
system("cls");
}
else{
dongs[13]-=3;dongs[15]+=2;dongs[8]-=1;
if(ksrl[ho.y][ho.x]==false){
if(!xd3){
for(int i=0;i<100;i+=2){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}//动画
}
}else{
if(!xd3){
for(int i=0;i<100;i+=4){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}
}
}
cout<<name<<"用3钛和1个铁换了2钛合金"<<endl;
Sleep(1000);//延迟
system("cls");
}
}
}if(sbsb1==4){
if(sz<=0){
cout<<"没沙子";
Sleep(1000);
system("cls");
}else{
sz--;
blsp++;
if(ksrl[ho.y][ho.x]==false){
if(!xd3){
for(int i=0;i<100;i+=2){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}//动画
}
}else{
if(!xd3){
for(int i=0;i<100;i+=4){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}
}
}
cout<<name<<"得到一块玻璃碎片"<<endl;
Sleep(1000);//延迟
system("cls");
}
}if(sbsb1==5){
if(blsp<10){
cout<<"碎片不够";
Sleep(1000);
system("cls");
}else{
blsp-=10;
blcx++;
if(ksrl[ho.y][ho.x]==false){
if(!xd3){
for(int i=0;i<100;i+=2){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}//动画
}
}else{
if(!xd3){
for(int i=0;i<100;i+=4){
cout<<"烧制"<<i<<'%';
Sleep(100);
system("cls");
}
}
}cout<<name<<"得到一块玻璃胚胎"<<endl;
Sleep(1000);//延迟
system("cls");
}
}
}
}if(sbsb==2){
cout<<"强化哪一项?\n1:温度\n2:速度\n";
int sbsbsb;
cin>>sbsbsb;
if(sbsbsb==1){
if(qhq==0){
cout<<"没有温度强化器!\n";Sleep(1000);system("cls");
}else if(rlqh[ho.y][ho.x]==true){
cout<<"已经强化过了!\n";Sleep(1000);system("cls");
}else{
cout<<"强化成功!\n";
qhq--;
rlqh[ho.y][ho.x]=true;
Sleep(1000);
}}
else{
if(daojv1[4]==0){
cout<<"没有快烧核心!\n";Sleep(1000);system("cls");
}else if(ksrl[ho.y][ho.x]==true){
cout<<"已经强化过了!\n";Sleep(1000);system("cls");
}else{
daojv1[4]--;
cout<<"强化成功!\n";
ksrl[ho.y][ho.x]=true;
Sleep(1000);
}
}
system("cls");
}
}
}else if(a[ho.y][ho.x].m==2){
if(a[ho.y][ho.x].m==2&&(a[ho.y-1][ho.x].m==3||a[ho.y+1][ho.x].m==3||a[ho.y][ho.x-1].m==3||a[ho.y][ho.x+1].m==3)){
if(dzt[ho.y][ho.x]==false){
cout<<"没有锻造锤,是否放上?是y否n\n";
int sb=getch();
if(sb==121){
if(daojv1[2]==0){
cout<<"你没有锤子!";
Sleep(1500);
}else{
daojv1[2]--;
dzt[ho.y][ho.x]=true;
cout<<"下次就可以使用了!";
}
}
}else{
cout<<"做什么\n1:捕鱼陷阱(23尼龙线5木材)\n2:鱼缸(12铁)\n3:针(1铁锭)\n4:纺织机(10木20尼龙线)\n5:温度强化器(2石3粗铁7铁锭)\n6:使用镐子设计图\n7:制药台(1玻璃胚胎2铁1钛合金)\n8:采集棒(1钛合金)";
int sb;
cin>>sb;
if(sb==1){
if(dongs[11]<23||dongs[3]<5){
cout<<"材料不够!!!";
Sleep(1000);
}else{
dongs[11]-=23;dongs[3]-=5;
cout<<"获得一个陷进";
w1++;
if(js==false){
cout<<"解锁捕鱼了!!!";
}
js=true;
}
}if(sb==2){
if(dongs[8]<12){
cout<<"材料不够!!!";
Sleep(1000);
}else{
dongs[8]-=12;jianzhu1[1]++;
cout<<"获得一个鱼缸(可以装5条鱼)";
}
}if(sb==3){
if(dongs[8]<1){
cout<<"材料不够!!!";
Sleep(1000);
}else{
dongs[8]-=1;daojv1[3]++;
cout<<"获得一个针";
}
}
if(sb==4){
if(dongs[3]<10||dongs[11]<20){
cout<<"材料不够!!!";
Sleep(1000);
}else{
dongs[3]-=10;dongs[11]-=20;jianzhu1[4]++;
cout<<"获得一个纺织机";
}
} if(sb==5){
if(dongs[5]<2||dongs[7]<3||dongs[8]<7){
cout<<"材料不够!!!";
Sleep(1000);
}else{
dongs[5]-=2;dongs[7]-=3;dongs[8]-=7;qhq++;
cout<<"获得一个温度强化器";
}
} if(sb==6){
system("cls");
for(int i=0;i<gzi;i++){
cout<<i+1<<' '<<gz[i]<<endl;
}
cout<<"做哪个?\n";
int sbgz;
cin>>sbgz;
sbgz--;
if(sbgz==0){
if(dongs[3]<3){
cout<<"不够!"<<endl;
}else{
dongs[3]-=3;
cout<<"得到一个"<<gz[0];
gz1[0]++;
}
}
if(sbgz==1){
if(dongs[5]<3){
cout<<"不够!"<<endl;
}else{
dongs[5]-=3;
cout<<"得到一个"<<gz[1];
gz1[1]++;
}
}
if(sbgz==2){
if(dongs[8]<3){
cout<<"不够!"<<endl;
}else{
dongs[8]-=3;
cout<<"得到一个"<<gz[2];
gz1[2]++;
}
}if(sbgz==3){
if(dongs[8]<2||dongs[15]<5){
cout<<"不够!"<<endl;
}else{
dongs[8]-=2;dongs[15]-=5;
cout<<"得到一个"<<gz[3];
gz1[3]++;
}
}
}if(sb==7){
if(dongs[8]<2||blcx<1||dongs[15]<1){
cout<<"材料不够!!!";
Sleep(1000);
}else{
dongs[8]-=2;blcx-=1;dongs[15]-=1;
cout<<"获得一个制药台";
jianzhu1[5]++;
}
}if(sb==8){
if(dongs[15]<1){
cout<<"材料不够!!!";
Sleep(1000);
}else{
dongs[15]-=1;
cout<<"获得一个采集棒";
daojv1[7]++;
}
}
}
}else{
cout<<"请在旁边放上铁砧!!!";
Sleep(1000);
}
}else if(a[ho.y][ho.x].m==100){
if(gh[ho.y][ho.x]==false){
cout<<"请点燃篝火!(b键)";
Sleep(1000);
continue;
}else{
cout<<"要干嘛?\n1烤鱼 2收集鱼油";
int sb;
cin>>sb;
if(sb==1){
if(fish1[0]==0){
cout<<"你没有鱼!";
Sleep(1000);continue;
}else{
fish1[0]--;
fish1[1]++;
if(!xd3){
for(int i1=0;i1<100;i1++){
cout<<"烤了"<<i1<<'%';
Sleep(70);
system("cls");
}
}
cout<<"烤好了!!!\n";
Sleep(1000);continue;
}
} if(sb==2){
if(fish1[0]==0){
cout<<"你没有鱼!";
Sleep(1000);continue;
}else{
fish1[0]--;
zycl[1]++;
if(!xd3){
for(double i1=0;i1<100;i1+=0.5){
cout<<"烤了"<<i1<<'%';
Sleep(70);
system("cls");
}
}
cout<<"得到一坨鱼油\n";
Sleep(1000);continue;
}
}
}
}else if(a[ho.y][ho.x].m==110){
cout<<"可织:\n";
for(int sad=0;sad<i2;sad++){
cout<<sad+1<<' '<<zb[sad]<<"\n";
}int sdb=getch();
cout<<i2+1<<' '<<daojv[5]<<"(1木2线)\n";
if(sdb=='1'){
if(dongs[10]<40||dongs[11]<6){
cout<<"材料不够!\n";Sleep(1000);continue;
}else{
if(daojv1[3]==0){
cout<<"没有针缝制\n";Sleep(1000);continue;
}else{
cout<<"好了,以后摸箱子不会被刺伤了!";
int sbsb=rand()%3+1;
dongs[10]-=40;dongs[11]-=6;
zbbool[0]=true;
if(sbsb==1){
cout<<"欸?针不见了";
daojv1[3]--;
}
Sleep(1000);continue;
}
}
}if(sdb=='2'){
if(dongs[10]<7||dongs[11]<2||dongs[3]<2){
cout<<"材料不够!\n";Sleep(1000);continue;
}else{
if(daojv1[3]==0){
cout<<"没有针缝制\n";Sleep(1000);continue;
}else{
zbbool[1]=true;
cout<<"好了,以后不会中暑了!";
dongs[10]-=7;dongs[11]-=2;dongs[3]-=2;
int sbsb=rand()%3+1;
if(sbsb==1){
cout<<"欸?针不见了";
daojv1[3]--;
} Sleep(1000);continue;
}
}
}if(sdb=='3'){
if(dongs[11]<2||dongs[3]<1){
cout<<"材料不够!\n";Sleep(1000);continue;
}else{
if(daojv1[3]==0){
cout<<"没有针缝制\n";Sleep(1000);continue;
}else{
daojv1[5]++;
cout<<"好了!";
dongs[11]-=2;dongs[3]-=1;
int sbsb=rand()%3+1;
if(sbsb==1){
cout<<"欸?针不见了";
daojv1[3]--;
} Sleep(1000);continue;
}
}
}
}
else if(a[ho.y][ho.x].m==5){
cout<<"1 使用 2 不用 3 用这里的玻璃瓶凝固血袋(做血块) 4 采集胃袋药水材料\n";
int sbsbsbsbsb=getch();
if(sbsbsbsbsb==4){
if(daojv1[7]<=0){
cout<<"请制作一个采集棒\n";
Sleep(1000);
continue;
}else{
if(blp<=0){
cout<<"你没有玻璃瓶!";
Sleep(1000);
continue;
}else{
blp--;
zycl[0]++;
cout<<"得到一瓶上皮组织\n";
Sleep(1000);
}
}
}
if(sbsbsbsbsb=='3'){
if(dongs[12]){
dongs[12]--;
zycl[3]++;
int j=0;
cout<<"等待中.....";
while(j<100){
j+=2;
Sleep(100);
}
cout<<"凝固了";
Sleep(1000);
}
else{
cout<<"你没有血袋!\n";
Sleep(1000);
continue;
}
}else if(sbsbsbsbsb=='1'){
bool sb=0;
int qezr=1;
cout<<"目前你会的:\n";
for(int dsz=0;dsz<y;dsz++){
if(yssjt[dsz]!=0){
sb=1;
cout<<dsz+1<<' '<<zy[dsz]<<endl;
qezr++;
}
}
if(sb==0){
cout<<"无!";
Sleep(1000);
system("cls");
continue;
}
cout<<"做哪个?";
int lz;
cin>>lz;
lz--;
cout<<zysjt[lz]<<endl;
cout<<"1开始制作2返回收集材料\n";
sbsbsbsbsb=getch();
if(sbsbsbsbsb!='1'){
cout<<"行\n";
continue;
}
if(yssjt[lz]==0){
cout<<"不会!!!!!\n";
Sleep(1000);
}else{
if(zycl[lz]<sl[lz]){
cout<<"材料不够!\n";
Sleep(700);
}else if(daojv1[5]<1){
cout<<"你需要一张滤网!\n";
Sleep(1000);
}else if(zyf<1){
cout<<"你需要一袋制药粉!\n";
Sleep(1000);
}else{
zycl[lz]-=sl[lz];
daojv1[5]--;
zyf--;
ys[lz]++;
cout<<"成功了!";
Sleep(1000);
}
}
}else{
continue;
}
}
}
if(aa==72)if(ho.y!=0){ho.y--;b=1;system("cls");}
if(aa==80)if(ho.y!=59){ho.y++;b=1;system("cls");}
if(aa==75)if(ho.x!=0){ho.x--;b=1;system("cls");}
if(aa==77)if(ho.x!=89){ho.x++;b=1;system("cls");}
if(aa==int('z')){b=0;system("cls");break;}
if(aa==49){
bool bb=0;
cout<<"可建造:"<<endl<<"0:退出"<<endl;
for(int i=0;i<hos;i++)
{
if(dongs[jian[i]]){bb=1;
cout<<i+1<<':'<<ddong[jian[i]]<<" "<<dongs[jian[i]]<<"个"<<endl;}
}
for(int i=0;i<iiii;i++){
if(jianzhu1[i]>0){
bb=1;
cout<<2+i<<':'<<jianzhu[i]<<' '<<jianzhu1[i]<<"个" <<endl;
}
}
if(bb==0)
{
cout<<"无"<<endl;
}
else
{
int h;cin>>h;h--;
bool sb=false;
if(h==-1)continue;
if(h==0){
if(dongs[jian[h]]==0){
cout<<"不够!!"; continue;
}
}else if(h==1){
if(dongs[jian[h]]==0){
cout<<"不够!!";continue;
}
}else{
sb=true;
if(h==2){
if(jianzhu1[h-1]==0){
cout<<"不够!!";
continue;
}
}if(h==3){
if(jianzhu1[h-1]==0){
cout<<"不够!!";
continue;
}
}if(h==4){
if(jianzhu1[h-1]==0){
cout<<"不够!!";
continue;
}
}if(h==5){
if(jianzhu1[h-1]==0){
cout<<"不够!!";
continue;
}
}if(h==6){
if(jianzhu1[h-1]==0){
cout<<"不够!!";
continue;
}
}
}
if(a[ho.y][ho.x].m==1){
cout<<"鱼缸无法替换";
continue;
}else{
if(sb==false){
dongs[jian[h]]--;
a[ho.y][ho.x].m=jian[h];
map2[ho.y][ho.x]=char(h+1+'0');//建筑标记
}
else{
jianzhu1[h-1]--;
if(h==2){
yg+=5;
}
if(h==5)a[ho.y][ho.x].m=110;
else a[ho.y][ho.x].m=h-1;
map2[ho.y][ho.x]=char(h+2+'0');
}
cout<<"建造成功!!"<<endl;
Sleep(500);
system("cls");
b=1;
}
}
}
if(aa==98){
if(a[ho.y][ho.x].m==100){
cout<<"当前已经搭有篝火";
if(gh[ho.y][ho.x]==true){
cout<<",并且已经点燃";
Sleep(1500);
continue;
}else{
cout<<",是否点燃?\n是y否n\n";
int sb=getch();
if(sb==121){
if(dongs[4]<4){
cout<<"火把太少了,无法点燃\n";
Sleep(1500);continue;
}else{
cout<<"点燃成功!";
hg=true;
gh[ho.y][ho.x]=true;
dongs[4]-=4;
}
}else{
continue;
}
}
}else{
if(dongs[3]<10||dongs[5]<5){
cout<<"材料不够";
Sleep(1500);
continue;
}else{
dongs[3]-=10;dongs[5]-=5;
cout<<"建造成功!";
a[ho.y][ho.x].m=100;
map2[ho.y][ho.x]=char(3+'0');
}
}
}
}
if(!b){
continue;
}
if(ho.y<7){
sy=0;
}else{
sy=ho.y-7;
}
if(ho.x<10){
sx=0;
}else{
sx=ho.x-10;
}
if(ho.y>=51){
dy=59;
}else{
dy=ho.y+7;
}
if(ho.x>=80){
dx=89;
}else{
dx=ho.x+10;
}
for(int i=sy;i<=dy;i++)
{
for(int j=sx;j<=dx;j++)
{
if(i==ho.y&&j==ho.x)cout<<"$";
else if(map2[i][j]=='.')cout<<'.';
else{
if(work[int(map2[i][j]+1-'0')]=='@'){
if(gh[i][j]==true){
SetConsoleTextAttribute(hConsole, FOREGROUND_RED);
cout<<'@';
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}else cout<<'@';
}//点燃火把红色输出
else if(work[int(map2[i][j]+1-'0')]=='#'){
if(dzt[i][j]==true){
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE);
cout<<'#';
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}else cout<<'#';
}//工作台联动完毕
else if(work[int(map2[i][j]+1-'0')]=='n'){
if(rlqh[i][j]==true){
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY);
cout<<'n';
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}else cout<<'n';
} //熔炉强化完毕
else cout<<work[int(map2[i][j]+1-'0')];//改为输出数组
}
}
cout<<endl;
}
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE| FOREGROUND_GREEN );
cout<<"水量:";
for(int i=0;i<water;i++){
cout<<"Q";
}SetConsoleTextAttribute(hConsole, FOREGROUND_INTENSITY);
for(int i=0;i<10-water;i++){
cout<<"Q";
}SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
//体力
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY);
cout<<"饱食度(体力):";
for(int i=0;i<ti;i++){
cout<<"P";
}SetConsoleTextAttribute(hConsole, FOREGROUND_INTENSITY);
for(int i=0;i<tlsx-ti;i++){
cout<<"P";
}SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
cout<<endl;
SetConsoleTextAttribute(hConsole, FOREGROUND_RED);
cout<<"生命值:";
for(int i=0;i<sheng;i++){
if(i%2==0)cout<<"(";
else cout<<")";
}SetConsoleTextAttribute(hConsole, FOREGROUND_INTENSITY);
for(int i=sheng;i<20;i++){
if(i%2==0)cout<<"(";
else cout<<")";
}SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
cout<<endl;
//生命值
cout<<"坐标:("<<ho.x<<','<<ho.y<<')'<<endl;
if(a[ho.y][ho.x].m==0)cout<<"你生存了"<<tian<<"天"<<"\n生命值:"<<sheng<<"\nz:出发\n1:建造\nb原地搭建一个篝火\nd喝水\n空格:使用工作方块"<<endl<<"本方块:无"<<endl;
else {
if(a[ho.y][ho.x].m==4||a[ho.y][ho.x].m==6){
cout<<"你生存了"<<tian<<"天"<<"\n生命值:"<<sheng<<"\nz:出发\n1:建造\nb原地搭建一个篝火\nd喝水\n空格:使用工作方块"<<endl<<"本方块:"<<ddong[a[ho.y][ho.x].m]<<endl;
}
else{
if(a[ho.y][ho.x].m==110)cout<<"你生存了"<<tian<<"天"<<"\n生命值:"<<sheng<<"\nz:出发\n1:建造\nd喝水\nb原地搭建一个篝火\n空格:使用工作方块"<<endl<<"本方块:"<<jianzhu[4]<<endl;
else if(a[ho.y][ho.x].m==100) cout<<"你生存了"<<tian<<"天"<<"\n生命值:"<<sheng<<"\nz:出发\n1:建造\nd喝水\nb原地搭建一个篝火\n空格:使用工作方块"<<endl<<"本方块:"<<jianzhu[0]<<endl;
else cout<<"你生存了"<<tian<<"天"<<"\n生命值:"<<sheng<<"\nz:出发\n1:建造\nd喝水\nb原地搭建一个篝火\n空格:使用工作方块"<<endl<<"本方块:"<<jianzhu[a[ho.y][ho.x].m]<<endl;
}
}
}
cout<<"你要去哪?\n0.不去了 1.外出找宝箱 2.背包 3.外出找资源 ";
if(czjs==false)cout<<"4.到处转转 5.存档 6.读档 ";
else cout<<"4.城镇旧址 5.存档 6.读档 ";
cin>>go;
if(go==4){
if(czjs==false){
cout<<"你在附近转了转,不知道走了多远,好在还记得路\n就在你路过一个杂草丛时,你拨开草丛,发现了一片全新的地方(不认识)\n走近一看才发现,是一个城镇旧址\n";
czjs=true;
cout<<"是否去看看\n1 去2 算了";
int sb;
cin>>sb;
if(sb==2)continue;
system("cls");
qwcz();
}else{
cout<<"你前往了上次找到的城镇旧址\n";
Sleep(1000);
system("cls");
qwcz();
}
}
if(go==5){
cout<<"试试";
saveGame("test_save.dat");
Sleep(1000);
system("cls");
continue;
}if(go==6){
cout<<"试试";
loadGame("test_save.dat");
Sleep(1000);
system("cls");
continue;
}
if(go==0)
{
continue;
}
if(go==1)
{
int yes,bao,vai;
if(tian>=8)bao=rand()%8+1;
else bao=rand()%tian+1;
cout<<"今天天降"<<bao<<"个宝箱"<<endl<<"是否寻找?(1.yes 2.no)"<<endl;
cin>>yes;
if(!(yes-1))
{
for(int i=1;i<=bao;i++)
{
cout<<"你发现了第"<<i<<"个宝箱"<<"是否寻找?(1.yes 2.no)"<<endl;
cin>>yes;
if(yes==1)
{
vai=rand()%2;
if(vai)
{
int zhong=rand()%4;
if(zhong==0)
{
cout<<"你中毒了,生命值减5"<<endl;
sheng-=5;
}
if(zhong==1)
{
if(zbbool[0]==false){
cout<<"你被物品划伤了,生命值减2"<<endl;
sheng-=2;
}else{
cout<<"你差点物品划伤了,不过幸好穿有衣服"<<endl;
}
}
if(zhong==2)
{
cout<<"你被东西撞回了家"<<endl;
break;
}
if(zhong==3)//该条件
{
cout<<"周围有东西!"<<endl;
}
}
int ge=rand()%8+1,shess=rand()%iii,yo=rand()%2;
for(int j=1;j<=ge;j++)
{
int dong=rand()%ii;
if(dong==7||dong==8||dong==13||dong==14||dong==15||dong==4||dong==6){
j--;
continue;
}
if(dong==12){
int kjd=rand()%2;
if(kjd==1){
j--;
continue;
}
}if(dong==1){
int kjd=rand()%2;
if(kjd==1){
j--;
continue;
}
}
cout<<"你获得了"<<ddong[dong]<<endl;
dongs[dong]++;
}
if(yo==1)
{
cout<<"你获得了"<<she[shess]<<endl;
shes[shess]=1;
}
int ksks=rand()%27+1;
if(ksks==1){
cout<<"恭喜摸出'快烧核心'!\n";
daojv1[4]++;
}
}
else continue;
}
}
Sleep(2000);
}//摸箱子
bool br=0;
if(go==2)
{
int c;
while(1){
for(int i=0;i<ii;i++)
{
if(dongs[i])
cout<<i+1<<" "<<ddong[i]<<" "<<dongs[i]<<"个"<<endl;
}
if(fish1[1])cout<<ii+1<<' '<<fish[1]<<' '<<fish1[1]<<"个"<<endl;
for(int jba=1;jba<=y;jba++){
if(zycl[jba-1]){
cout<<jba+ii+1<<" "<<zyclstr[jba-1]<<" "<<zycl[jba-1]<<"个"<<endl;
}
}
cout<<"设计图:\n";
for(int i=0;i<iii;i++)
{
if(shes[i])
cout<<i+1<<" "<<she[i]<<endl;
}
cout<<"药水:\n";
for(int i=0;i<y;i++){
cout<<i+1<<' '<<zy[i]<<endl;
}
cout<<"工具和杂物(不可使用):\n";
for(int i=0;i<iiiii;i++){
cout<<daojv[i]<<' '<<daojv1[i]<<endl;
}
cout<<"玻璃瓶"<<' '<<blp<<endl;
for(int i=0;i<y;i++){
cout<<zyclstr[i]<<' '<<zycl[i]<<endl;
}
cout<<"\n用哪个?(退出:0 物品:1 设计图:2 药水:3)";
int dong,shu;cin>>c;
if(c==0)
{
br=1;
system("cls");
break;
}
if(c==1)
{
cout<<"用哪个物品?"<<endl;
cin>>dong;dong--;
cout<<"用几个?"<<endl;
cin>>shu;
if(dong<ii){
if(shu>dongs[dong])
{
cout<<"不够!"<<endl;
}
else
{
if(dong==3||dong==4||dong==5||dong==6||dong==7||dong==8||dong==9||dong==10||dong==11||dong==2||dong==13||dong==14||dong==15)cout<<"无法使用";
else{
cout<<name<<"用了"<<shu<<"个"<<ddong[dong]<<endl;
dongs[dong]-=shu;
if(dong==12){
sheng+=shu*5;
if(sheng>20)sheng=20;
}
if(dong==0){
water+=shu;
dongs[2]+=shu;
cout<<"中";
}if(dong==1){
ti+=shu*2;if(ti>10)ti=10;
cout<<"中";
}
}
}
}
if(dong==ii){
if(shu>fish1[1]){
cout<<"不够!"<<endl;
}else{
cout<<name<<"用了"<<shu<<"个"<<fish[1]<<endl;
fish1[1]-=shu;
sheng+=2*shu;if(sheng>20)sheng=20;
ti+=7*shu;if(ti>10)ti=10;
}
}if(dong>ii){
cout<<"无法使用!\n";
}
}
if(c==2)
{
cout<<"用哪个设计图?"<<endl;
cin>>dong;
if(dong==1){
if(dongs[3]<2)cout<<"不够!"<<endl;
else{
dongs[3]-=2;
dongs[4]++;
cout<<"得到一个"<<ddong[4];
}
}//火把
if(dong==2){
if(dongs[5]<4)cout<<"不够!"<<endl;
else{
dongs[5]-=4;
dongs[6]++;
cout<<"得到一个"<<ddong[6];
}
}//熔炉
if(dong==3){//镐子
system("cls");
for(int i=0;i<gzi;i++){
cout<<i+1<<' '<<gz[i]<<endl;
}
cout<<"做哪个?\n";
int sbgz;
cin>>sbgz;
sbgz--;
if(sbgz==0){
if(dongs[3]<3){
cout<<"不够!"<<endl;
}else{
dongs[3]-=3;
cout<<"得到一个"<<gz[0];
gz1[0]++;
}
}
if(sbgz==1){
if(dongs[5]<3){
cout<<"不够!"<<endl;
}else{
dongs[5]-=3;
cout<<"得到一个"<<gz[1];
gz1[1]++;
}
}
if(sbgz==2){
if(dongs[8]<3){
cout<<"不够!"<<endl;
}else{
dongs[8]-=3;
cout<<"得到一个"<<gz[2];
gz1[2]++;
}
}if(sbgz==3)cout<<"请去锻造台制作!\n";
}//镐子
if(dong==4){
if(dongs[3]<2||dongs[8]<8||dongs[11]<2)cout<<"不够!"<<endl;
else{
dongs[3]-=2;dongs[8]-=8;dongs[11]-=2;
daojv1[2]++;
cout<<"得到一个"<<daojv[2];
}
}//锤子
if(dong==5){
if(dongs[3]<6||dongs[8]<10||dongs[5]<2)cout<<"不够!"<<endl;
else{
dongs[3]-=6;dongs[8]-=10;dongs[5]-=2;
jianzhu1[2]++;
cout<<"得到一个"<<jianzhu[2];
}
}//台子
if(dong==6){
if(dongs[8]<20)cout<<"不够!"<<endl;
else{
dongs[8]-=20;
jianzhu1[3]++;
cout<<"得到一个"<<jianzhu[3];
}
}
}
if(c==3){
cout<<"用哪个?"<<endl;
int amnsjbdd;
cin>>amnsjbdd;
amnsjbdd--;
if(ys[amnsjbdd]==0)cout<<"无\n";
else{
if(amnsjbdd==0){
ys[amnsjbdd]--;
cout<<"使用成功!体力上限变为20\n";
tlsx=20;
}
if(amnsjbdd==1){
ys[amnsjbdd]--;
cout<<"使用成功!体力回满\n";
ti=tlsx;
}
if(amnsjbdd==2){
ys[amnsjbdd]--;
cout<<"使用成功!生命值回满\n";
sheng=20;
}
if(amnsjbdd==3){
ys[amnsjbdd]--;
cout<<"使用成功!3天内每天回7点生命值!\n";
zs=tian+3;
}
}
}
Sleep(700);system("cls");
continue;
}
}
if(br)continue;
if(go==3)
{
while(ti>0)
{
int go1;
cout<<"体力:"<<ti<<endl;
for(int i=0;i<3;i++)
{
cout<<i+1<<"."<<mmap[i]<<" ";
}
cout<<" 0.退出 -1.吃面包(+2体力)"<<"(你有"<<dongs[1]<<"个面包) -2吃烤鱼(+7体力)(你有"<<fish1[1]<<"个烤鱼)";
cin>>go1;go1--;
if(go1==-1)break;
if(go1==-2)
{
if(dongs[1]<1)
{
cout<<"面包不够!!!\n"; Sleep(700);system("cls");continue;
}else
{
dongs[1]--;
cout<<"吃了\n" ;
ti+=2; if(ti>tlsx)ti=tlsx;Sleep(700);system("cls");
continue;
}
continue;
}if(go1==-3){
if(fish1[1]<1)
{
cout<<"烤鱼不够!!!\n"; Sleep(700);system("cls");continue;
}else
{
fish1[1]--;
ti+=7;cout<<"吃了\n" ;
sheng+=2;if(ti>tlsx)ti=tlsx;
if(sheng>20)sheng=20;
Sleep(700);system("cls");continue;
}
}
cout<<endl<<name<<"前往了"<<mmap[go1]<<endl;
Sleep(1000);
system("cls");
if(go1==0)
{
int ts=0;
for(int i=0;i<25;i++)
{
for(int j=0;j<40;j++)
{
ts+=mat[i][j].w;
}
}
if(ts==0)
{
for(int i=0;i<25;i++)
{
for(int j=0;j<40;j++)
{
mat[i][j].w=mat[i][j].w1;
}
}
}
cout<<"体力:"<<ti<<endl;
cout<<"1.吃面包(+2体力)"<<"(你有"<<dongs[1]<<"个面包)2吃烤鱼(+7体力)(你有"<<fish1[1]<<"个烤鱼)"<<endl;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
for(int i=0;i<25;i++)
{
for(int j=0;j<40;j++)
{
if(i==we.y&&j==we.x)cout<<"$";
else if(mat[i][j].w)
{
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
SetConsoleTextAttribute(hConsole,FOREGROUND_GREEN);
cout<<"*";
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}
else cout<<" ";
}
cout<<endl;
}
cout<<"0:退出"<<endl;
if(mat[we.y][we.x].w)
{
cout<<"c.切割树木(得3木材)"<<endl;
}
while(1)
{
bool b=false;
if(kbhit())
{
int a;
a=getch();
if(a==72)if(we.y!=0){b=true;we.y--;}
if(a==80)if(we.y!=24){b=true;we.y++;}
if(a==75)if(we.x!=0){b=true;we.x--;}
if(a==77)if(we.x!=39){b=true;we.x++;}
if(a==99&&mat[we.y][we.x].w)
{ b=true;
if(ti<3)
{
cout<<"体力不够!!"<<endl;
Sleep(100);
continue;
}
ti-=3;
mat[we.y][we.x].w=0;cout<<"你获得了3个木头";dongs[3]+=3;
system("cls");
}
if(a==48)
{b=true;
system("cls");
break;
}
if(a==49)
{b=true;
if(dongs[1]<1)
{
cout<<"面包不够!!!";
}else
{
dongs[1]--;
ti+=2;
if(ti>tlsx)ti=tlsx;
}
}if(a==50){b=true;
if(fish1[1]<1)
{
cout<<"烤鱼不够!!!";
}else
{
fish1[1]--;
ti+=7;
sheng+=2;
if(sheng>20)sheng=20;
if(ti>tlsx)ti=tlsx;
}
}
if(ti==0){system("cls");
cout<<"你太累了,回家";
Sleep(1500);
system("cls");
break;
}
}
if(b==false){
continue;
}
system("cls");
cout<<"体力:"<<ti<<endl;
cout<<"1.吃面包(+2体力)"<<"(你有"<<dongs[1]<<"个面包)2吃烤鱼(+7体力)(你有"<<fish1[1]<<"个烤鱼)"<<endl;
for(int i=0;i<25;i++)
{
for(int j=0;j<40;j++)
{
if(i==we.y&&j==we.x)cout<<"$";
else if(mat[i][j].w)
{
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
SetConsoleTextAttribute(hConsole,FOREGROUND_GREEN);
cout<<"*";
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}
else cout<<" ";
}
cout<<endl;
}
cout<<"0:退出"<<endl;
if(mat[we.y][we.x].w)
{
cout<<"c.切割树木(得3木材)"<<endl;
}
}
}
if(go1==1)
{ SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
int xx=0,yy=0;
cout<<"站在河边(§)按f收鱼按w打水\n在其他地方长按空格挖沙子\n";
cout<<"按任意键确定......";
getch();
system("cls");
for(int i1=0;i1<27;i1++){
for(int i2=0;i2<27;i2++){
if(i1==yy&&i2==xx)cout<<'$';
else if(i2==26){
if(i1==fwx&&w==true){
cout<<'X';
}else{
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE| FOREGROUND_GREEN );
cout<<"§";
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);}
}else{
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
cout<<":";
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}
}cout<<endl;
}cout<<"w去打水f去收鱼0返回\n";
while(1){
bool jbdd=false;
if(kbhit()){
int a;
a=getch();
if(a==72)if(yy!=0){jbdd=true;yy--;}
if(a==80)if(yy!=26){jbdd=true;yy++;}
if(a==75)if(xx!=0){jbdd=true;xx--;}
if(a==77)if(xx!=25){jbdd=true;xx++;}
if(a=='0'){
system("cls");
break;
}
if(a==' '){
jbdd=true;
if(!xd3){
int j=0;
while(j!=100){
system("cls");
cout<<"已挖掘"<<j<<'%';
int o=getch();
if(o==' ')j+=2;
Sleep(50);
}
}
system("cls");
cout<<"获得些沙子\nj继续(防止没有即使收手导致无缝衔接)";
while(getch()!='j');
system("cls");
sz++;
}
if(a=='w'&&xx==25){
cout<<"一个空矿泉水瓶换矿泉水?\n1.yes 2.no\n";
int huan;
cin>>huan;
if(huan==1)
{
cout<<"换几个?(你有"<<dongs[2]<<"个空矿泉水瓶)";
int ji;cin>>ji;
if(ji>dongs[2])
{
cout<<"不够!!!";
}
else{
dongs[2]-=ji;
dongs[0]+=ji;
}
}
}
if(a=='f'&&xx==25){
if(js==false){
cout<<"未解锁\n";
}else{
if(w==true){
if(yy!=fwx){
cout<<"请站到网边上";
Sleep(800);
continue;
}
int sadf=rand()%10+1;
if(sadf==1){
cout<<"这两天不知为什么,水好大,陷阱冲没了。。。\n";
w=false;
Sleep(1000); break;
}else{
int n=rand()%5+1;
if(n==1||n==2){
n=rand()%7+1;
fish[0]+=n;
cout<<"今天上了"<<n<<"条鱼\n";
Sleep(500);
if(fish1[0]+n<=yg){
cout<<"你的鱼缸可以全部装下\n";
fish1[0]+=n;Sleep(1000);
break;
}else{
cout<<"鱼缸不够多,只能装下"<<yg-fish1[0]<<"条鱼\n";
fish1[0]=yg;Sleep(1000);
break;
}
}else{
cout<<"没货\n";
Sleep(1000);
break;
}
}
}else{
cout<<"现在没有安装陷阱,是否下?y是n否\n";
int dsb=getch();
if(dsb=='y'){
if(w1==0){
cout<<"你没有网!\n";
continue;
}else{
w1--;
w=true;
fwx=yy;
cout<<"下次来看看收获\n";Sleep(1500);
system("cls");
break;
tian++;
ti--;
}
} else{
continue;
}
}
}
}
}
if(jbdd==false)continue;
system("cls");
for(int i1=0;i1<27;i1++){
for(int i2=0;i2<27;i2++){
if(i1==yy&&i2==xx)cout<<'$';
else if(i2==26){
if(i1==fwx&&w==true){
cout<<'X';
}else{
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE| FOREGROUND_GREEN );
cout<<"§";
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);}
}else{
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
cout<<":";
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}
}cout<<endl;
}
cout<<"w去打水f去收鱼0返回\n";
}
}
if(go1==2)
{
bool jks=false;
for(int i=0;i<gzi;i++){
if(gz1[i]!=0){
jks=true;
break;
}
}
if(jks==false){
cout<<"没稿子!";
Sleep(1000);
system("cls");
continue;
}
int xx=0,yy=0,zygz=0;
cout<<"0退出,wasd移动,←→切换镐子,每挖掉一层会漏出新的物质(挖掘期间手脏,无法喝水或吃东西)\n□为石头,不同颜色的x代表不同的矿石(自己摸索)\n任意键继续.....";
getch();
system("cls");
for(int i11=0;i11<37;i11++){
for(int j11=0;j11<37;j11++){
bool sc=false;
if(xx==j11&&yy==i11){
cout<<"\033[35m$\033[0m";sc=true;
}
else if(mapsc[i11][j11]=='1'){
cout<<"□";sc=true;
}
else if(mapsc[i11][j11]=='2')SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
else if(mapsc[i11][j11]=='3')SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY);
if(sc==false)cout<<'x';
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}cout<<endl;
}
cout<<"在用镐子:"<<gz[zygz]<<"(有"<<gz1[zygz]<<"把)"<<endl<<"按't'后长按或快速单点鼠标左键挖掘\n";
while(1){//---------------------------------------------------------------------------------
bool bb=false;
if(kbhit())
{bb=true;
int a;
a=getch();
if(a=='w')if(yy!=0)yy--;
if(a=='s')if(yy!=36)yy++;
if(a=='a')if(xx!=0)xx--;
if(a=='d')if(xx!=36)xx++;
if(a==75)if(zygz!=0)zygz--;
if(a==77)if(zygz!=gzi-1)zygz++;
if(a=='t'){
if(gz1[zygz]==0){
cout<<"没有镐子!";
Sleep(1000);system("cls");
}
else if(zygz+1<int(mapsc[yy][xx])-'0'){
cout<<"这把镐子挖不掉!!!";
Sleep(1000);system("cls");
}else{
if(!xd3){
int j=0;
while(j!=100){
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) {
system("cls");cout<<"挖掘中......"<<endl;
cout<<j<<"%"<<endl;
Sleep(70);
j+=2;
}
}
system("cls");cout<<"挖掘中......"<<endl;
cout<<100<<"%"<<endl;system("cls");
}
ti--;
gaoz[zygz]++;
if(int(mapsc[yy][xx])-'0'-1==0)cout<<"获得一块石头";
if(int(mapsc[yy][xx])-'0'-1==1)cout<<"获得一个粗铁";
if(int(mapsc[yy][xx])-'0'-1==2)cout<<"获得一个钛矿";
dongs[ks[int(mapsc[yy][xx])-'0'-1]]++;
int n=rand()%12+1;
if(n==1){
n=rand()%10+1;
if(n==1){
mapsc[yy][xx]='3';
}else{
mapsc[yy][xx]='2';
}
}
else mapsc[yy][xx]='1';
Sleep(800);
}
}
if(a==48)
{
system("cls");
break;
}
if(gaoz[zygz]==gznj[zygz]){
gaoz[zygz]=0;
gz1[zygz]--;
cout<<"镐子坏了";
Sleep(1500);
}
if(ti==0){system("cls");
cout<<"你太累了,回家";
Sleep(1500);
system("cls");
break;
}
}
if(bb==false){
continue;
}
system("cls");
for(int i11=0;i11<37;i11++){
for(int j11=0;j11<37;j11++){
bool sc=false;
if(xx==j11&&yy==i11){
cout<<"\033[35m$\033[0m";sc=true;
}
else if(mapsc[i11][j11]=='1'){
cout<<"□";sc=true;
}
else if(mapsc[i11][j11]=='2'){
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
}else if(mapsc[i11][j11]=='3')SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY);
if(sc==false)cout<<'x';
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}cout<<endl;
}
cout<<"在用镐子:"<<gz[zygz]<<"(有"<<gz1[zygz]<<"把)"<<endl<<"按't'后长按或快速单点鼠标左键挖掘\n";
}
}//石场
ti--;
}
Sleep(2000);
}
system("cls");
if(tian<zs)sheng+=7;
tian++;
water-=1;
if(water<0)water=0;
if(ti>tlsx)ti=tlsx;
if(ti<0)ti=0;
if(water>10)water=10;
if(water==0){
cout<<"渴,生命-5";
Sleep(1000);
system("cls");
sheng-=5;
}if(ti==0){
cout<<"饿,生命-4";
Sleep(1000);
system("cls");
sheng-=4;
}
if(xd1)sheng+=5;
if(sheng>=20)sheng=20;
if(xd2)ti=tlsx;
}
return 0;
}