#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int h=12,m=0;
int cunzhuang=0,lubaoshi=0,muban=0,tiejian=0,tiegao=0;
void no1();
void no102();
void no2();
void no202();
void no203();
void looktime(){
h=h+m/60;
h%=24;
m=m%60;
cout<<“时间:”<<(h<=12 ? “上午” : “下午”);
(h>12 ? printf(“%02d”,h%12) : printf(“%02d”,h));
cout<<“:”;
printf(“%02d\n”,m);
}
void clean(){
system(“cls”);
}
void wait(){
char pp;
cout<<“\n(按任意键继续…)”;
cin>>pp;
}
void lookbag(){
cout<<“钥匙:”;
if(cunzhuang==1){
cout<<"村庄钥匙 ";
}
if(cunzhuang==0){
cout<<“空”;
}
cout<<endl;
cout<<“物品:”;
if(lubaoshi==1){
cout<<"绿宝石 ";
}
if(muban==1){
cout<<"木板 ";
}
if(lubaoshi==0&&muban==0){
cout<<“空”;
}
cout<<endl;
cout<<“工具:”;
if(tiejian==1){
cout<<"铁剑 ";
}
if(tiegao==1){
cout<<“铁镐 “;
}
if(tiejian==0&&tiegao==0){
cout<<“空”;
}
cout<<endl;
}
void gameover(int i,string q){
clean();
cout<<“游戏结束”<<endl;
cout<<“结局”<<i<<”:”<<q<<endl;
cout<<“按任意健重开”<<endl;
wait();
}
void notok(){
cout<<“选择无效,请重新选择”;
wait();
}
void no1(){
clean();
cout<<“=====区域1 平原=====”<<endl;
looktime();
cout<<“====================”<<endl;
lookbag();
cout<<“====================”<<endl;
int a;
cout<<“1.向左走 2.向右走 3.再等一会再前进”;
cin>>a;
if(h>16){
gameover(1,“天黑了,你没有武器,被怪物杀死了”);
no1();
}
if(a==1){
clean();
cout<<“你向左走了30分钟,发现了村庄钥匙”;
cunzhuang=1;
m+=30;
wait();
no1();
}else if(a==2){
clean();
cout<<“你向右走了1小时,来到了村庄”<<endl;
h+=1;
no102();
}else if(a==3){
cout<<“你在原地待了30分钟”<<endl;
Sleep(1000);
m+=30;
no1();
}else{
notok();
no1();
}
}
void no102(){
if(h>16){
gameover(1,“天黑了,你没有武器,被怪物杀死了”);
int h=12,m=0;
no1();
}
int ab;
cout<<“1.往回走 2.进入村庄”;
cin>>ab;
if(ab==1){
int h=12,m=0;
no1();
}else if(ab=2){
cout<<“需要村庄钥匙”<<endl;
Sleep(1000);
if(cunzhuang==1){
cout<<“你有村庄钥匙,进入了村庄”<<endl;
wait();
no2();
}else{
cout<<“你没有村庄钥匙”<<endl;
Sleep(1000);
gameover(3,“你没有村庄钥匙,被村庄里的铁傀儡一拳打飞”);
no1();
}
}else{
notok();
no102();
}
}
void no2(){
clean();
cout<<“=====区域2 村庄=====”<<endl;
looktime();
cout<<“====================”<<endl;
lookbag();
cout<<“====================”<<endl;
int b;
if(h>16){
if(tiejian==0){
gameover(1,“天黑了,你没有武器,被怪物杀死了”);
h=12,m=0;
no1();
}else{
cout<<“天黑了,你有一把铁剑,与怪物打了一会”<<endl;
int ba;
cout<<“1.和他们继续打 2.去酒店睡觉”;
cin>>ba;
if(ba==1){
gameover(2,“你打不过怪物,被怪物杀死了”);
}else if(ba==2){
no203();
}else{
notok();
no2();
}
}
}
cout<<“1.搜刮宝箱 2.打铁傀儡 3.去酒店睡觉 4.离开村庄”;
cin>>b;
if(b==1){
clean();
cout<<“你花了30分钟,发现了1颗绿宝石,一些木板,其他啥也没有”;
lubaoshi=1;
muban=1;
m+=30;
wait();
no2();
}else if(b==2){
no202();
}else if(b==3){
no203();
}else if(b==4){
wait();
}else{
notok();
no2();
}
}
void no202(){
clean();
if(muban==1){
int bb=0;
cout<<“1.直接攻击铁傀儡 2.用木板垫高后再打”;
cin>>bb;
if(bb==1){
gameover(4,“你被铁傀儡一拳打飞”);
no2();
}else if(bb=2){
cout<<“你使用了垫三格大法,花了1小时杀死了铁傀儡,获得了5个铁锭”<<endl;
Sleep(1000);
cout<<“你合成了铁剑和铁镐”;
tiejian=1,tiegao=1;
h+=1;
wait();
no2();
}else{
notok();
no202();
}
}else{
gameover(4,“你被铁傀儡一拳打飞”);
no2();
}
}
void no203(){
clean();
if(lubaoshi==1){
int bc;
cout<<“1.直接进入酒店睡觉 2.用绿宝石购买房间”;
cin>>bc;
if(bc==1){
gameover(5,“你横行霸道,被铁傀儡一拳打飞(村庄不止亿只铁傀儡,你打不完的)”);
no2();
}else if(bc=2){
cout<<“你使用了绿宝石,进入了酒店睡觉”<<endl;
Sleep(1000);
cout<<“来到了第2天”;
h=7,m=0;
wait();
no2();
}else{
notok();
no2();
}
}else{
int bb;
cout<<“1.直接进入酒店睡觉”;
cin>>bb;
gameover(5,“你横行霸道,被铁傀儡一拳打飞(村庄不止亿只铁傀儡,你打不完的)”);
no2();
}
}
int main(){
cout<<“====================”<<endl;
cout<<" 我的世界冒险 “<<endl;
cout<<”===================="<<endl;
wait();
no1();
}