跳到正文

个人记录

惊变20天

违规用户名1132832约 8 分钟
原文
文章信息与版本

文章信息

发布
2024年12月23日
收录
2025年12月12日
更新
2026年11月14日
篇幅
约 8 分钟

版本

  1. v1当前

最近不怎么更新游戏了,这次做了个剧情游戏,感觉还行,可以试着玩会儿。下面就直接上代码了。

C++
// 在代码的最后有惊喜!!!


#include<bits/stdc++.h>
using namespace std;
int main() {
	cout << "欢迎来到末日逃生,继续按1。";
	int n;
	cin >> n;
	if( n != 1 ) {
		cout << "游戏结束";
		return 0;
	}
	cout << "1.开始游戏(按1)" << endl;
	cout << "2.游戏规则(按2)" << endl;
	cout << "3.退出游戏(按3)" << endl;
	int b;
	cin >> b;
	if(b == 1 ) {
		cout << "你从昏迷中醒来,你发现你在废弃的城市中。" << endl;
		cout << "你发现你有一把小刀,5滴血" << endl;
		cout << "你现在要待在家里(按1),或者探索楼道(按2),再或者探索超市(按3)" << endl;
		int g;
		cin >> g;
		if(g == 1 ) {
			cout << "你被饿死了!" << endl;
			cout << "游戏结束!" << endl;
			return 0;
		}
		else if( g == 2 ) {
			cout << "你在楼道里发现了一个变异丧尸,要打他(按1),逃跑(按2)。" << endl;
			int h;
			cin >> h;
			if( h == 1 ) {
				cout << " 你被他打死了。" << endl;
				cout << "游戏结束!" << endl;
				return 0;
			}
			else if(h == 2 ) {
				cout << "你被累死了" << endl;
				cout << "游戏结束!" << endl;
			}
		}
		else if( g == 3 ) {
			cout << "你在超市里发现了一个小mian包,你吃掉了。" << endl;
			cout << "你的血量变成了6" << endl;
			cout << "你发现了一个人,他拿着一把AR57和一把AK47。他想跟着你,而且给你一把AR57。" << endl;
			cout << "你要让他跟着(按1),不让他跟着(按2)。" << endl;
			int kk;
			cin >> kk;
			if( kk == 1 ) {
				cout << "他给你了一把AR57,你要打他(按1),不打他(按2)" <<endl;
				int hh;
				cin >> hh;
				if( hh == 1 ) {
					cout << "你打不过他,所以他把你打死了" << endl;
					cout << "游戏结束!" << endl;
					return 0;
				}
				else if( hh == 2 ) {
					cout << "你和他发现了一个废弃的传送门,现在需要一把钥匙。你要寻找钥匙吗?" << endl;
					cout << "要的话(按1),不要(按2)。" << endl;
					int ll;
					cin >> ll;
					if(ll == 1 ) {
						cout << "你发现了一把钥匙,然后你把要是插进了传送门里了。" << endl;
						cout << "突然从传送门里发出了一道白光,你们被吸进去了。" << endl;
						cout << "最后你和他过上了幸福的生活。" << endl;
						cout << "游戏到此结束了,你赢了!!!!后面内容正在开发!!!!" << endl;
						return 0;
					}
					else if ( ll == 2 ) {
						cout << "他很不高兴,所以他趁你不注意的时候把你打死了。" << endl;
						cout << "游戏结束!" << endl;
						return 0;
					}
				}
			}
			else if( kk == 2 ) {
				cout << "他很生气,所以他把你打死了" << endl;
				cout << "游戏结束!" << endl;
				return 0;
			}
		}
	}
	else if( b == 2 ) {
		cout << "游戏规则:通过传送门就通关。" << endl;
		cout << "现在要开始游戏(按1),退出游戏(按2)" << endl;
		int uu;
		cin >> uu;
		if( uu == 1 ) {
			cout << "你从昏迷中醒来,你发现你在废弃的城市中。" << endl;
		cout << "你发现你有一把小刀,5滴血" << endl;
		cout << "你现在要待在家里(按1),或者探索楼道(按2),再或者探索超市(按3)" << endl;
		int g;
		cin >> g;
		if(g == 1 ) {
			cout << "你被饿死了!" << endl;
			cout << "游戏结束!" << endl;
			return 0;
		}
		else if( g == 2 ) {
			cout << "你在楼道里发现了一个变异丧尸,要打他(按1),逃跑(按2)。" << endl;
			int h;
			cin >> h;
			if( h == 1 ) {
				cout << " 你被他打死了。" << endl;
				cout << "游戏结束!" << endl;
				return 0;
			}
			else if(h == 2 ) {
				cout << "你被累死了" << endl;
				cout << "游戏结束!" << endl;
			}
		}
		else if( g == 3 ) {
			cout << "你在超市里发现了一个小mian包,你吃掉了。" << endl;
			cout << "你的血量变成了6" << endl;
			cout << "你发现了一个人,他拿着一把AR57和一把AK47。他想跟着你,而且给你一把AR57。" << endl;
			cout << "你要让他跟着(按1),不让他跟着(按2)。" << endl;
			int kk;
			cin >> kk;
			if( kk == 1 ) {
				cout << "他给你了一把AR57,你要打他(按1),不打他(按2)" <<endl;
				int hh;
				cin >> hh;
				if( hh == 1 ) {
					cout << "你打不过他,所以他把你打死了" << endl;
					cout << "游戏结束!" << endl;
					return 0;
				}
				else if( hh == 2 ) {
					cout << "你和他发现了一个废弃的传送门,现在需要一把钥匙。你要寻找钥匙吗?" << endl;
					cout << "要的话(按1),不要(按2)。" << endl;
					int ll;
					cin >> ll;
					if(ll == 1 ) {
						cout << "你发现了一把钥匙,然后你把要是插进了传送门里了。" << endl;
						cout << "突然从传送门里发出了一道白光,你们被吸进去了。" << endl;
						cout << "最后你和他过上了幸福的生活。" << endl;
						cout << "游戏到此结束了,你赢了!!!!后面内容正在开发!!!!" << endl;
						return 0;
					}
					else if ( ll == 2 ) {
						cout << "他很不高兴,所以他趁你不注意的时候把你打死了。" << endl;
						cout << "游戏结束!" << endl;
						return 0;
					}
				}
			}
			else if( kk == 2 ) {
				cout << "他很生气,所以他把你打死了" << endl;
				cout << "游戏结束!" << endl;
				return 0;
			}
		}
		}
		else if( uu == 2 ) {
			return 0;
		}
	}
	else if ( b == 3 ) {
		return 0;
	}


	// 作者:王志藩。^_^ (真名!!!)
}
原文