跳到正文

剪贴板

剪贴板 7hjeh6oq

原文
剪贴板信息

剪贴板信息

收录
更新

怪兽别跑小游戏1.71.3版本正式开测啦!!!

C++
#include<windows.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,d,x,m,o,r,z,W,u,a1,a2;
	char c;
	string s;
	cout<<"欢迎来到怪物别跑小游戏1.71.3版本"<<endl;
	Sleep(1000);
	cout<<" ---更新公告---"<<endl;
	Sleep(1000);
	cout<<" 昵称系统大更新"<<endl;
	Sleep(1000);
	cout<<" 更新了外挂系统"<<endl;
	Sleep(1000);
	cout<<" 更新了一个技能"<<endl;
	Sleep(1000);
	cout<<" 已经可以充值了"<<endl;
	Sleep(1000);
	cout<<" 感谢游玩此游戏"<<endl;
	cout<<" --------------"<<endl;
	Sleep(1500);
	system("pause&&cls");
	cout<<"请输入昵称"<<endl;
	cin>>s;
	if(s[0]=='S'&&s[1]=='B') {
		cout<<"畵芴肀亟峱撓外...挂...苡開";
		cout<<endl<<"乱码...数.值..已...最大";
		m=999999;
		r=10000000;
	}else{
		cout<<"你好"<<s<<"很高兴认识你"<<endl;
		cout<<"你获得了新手礼包,10个金币";
		m=10;
		r=10;
	}
	while(1)
    {
	cout<<endl<<"你现在想干什么?"<<endl<<"1抽奖"<<"2开始游戏"<<"0退出游戏"<<endl;
	cin>>u;
	if(u==0) break;
    else
    cout<<"请在输入一次您的选择。"<<endl;
    cin>>a;
	if(a==1)
	{
	if(r>=10)
	{
	r-=10;
	cout<<"金币减10"<<endl<<"你现在的金币数量是"<<r<<endl;
	cout<<"-----------------抽奖--------------------"<<endl;
	cout<<"----------请输入0-5中的任意整数----------"<<endl;
	cout<<"-----------------------------------------"<<endl;
	cin>>b;
	srand(time(0));
	d=rand()%5;
	if(d==b)
	{
	m+=10;
	cout<<"恭喜您,中奖啦!攻击力提高10点!";
    }
	else
	{
	cout<<"很遗憾,没中奖。攻击力不提高。";
	cout<<endl<<"中奖号码是"<<d;
    }
    }
    else
    {
    cout<<"金币不足,可以充值来获得金币。"<<endl<<"1=充值"<<endl;
    cin>>a1;
	if(a1==1)
	{
		cout<<"请输入您的充值金额"<<endl<<"1=10金币 2=20金币 以此类推"<<endl;
		cin>>a2;
		while(a2>10)
		{
			cout<<"检测到你是未成年人,您一次最多只能充值10元"<<endl<<"请重新输入您的充值金额"<<endl;
			cin>>a2;
		}
		r=a2*10;
		cout<<"您现在的金币数量是"<<r;
	}
	}
	}
	else
	{
	cout<<"请挑选难度"<<endl<<"1=简单  2=普通  3=困难  4=地狱"<<endl;
	cin>>z;
	switch(z)
	{
		case 1:srand(time(0));
	x=rand()%3;
	if(x==0) cout<<"怪物在你的左边";
	else if(x==1) cout<<"怪物在你的右边";
	else cout<<"怪物在你的前面";
	cout<<endl<<"a=打左边"<<"d=打右边"<<"w=打前面"<<"s=不想玩了"<<endl;
	cin>>c;
	srand(time(0));
	o=rand()%20;
	switch(c)
	{
		case 'a':if(0==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=10;cout<<",你赢了!获得10枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 'd':if(1==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=10;cout<<",你赢了!获得10枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 'w':if(2==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=10;cout<<",你赢了!获得10枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 's':cout<<"游戏结束。";
	}break;
		case 2:srand(time(0));
	x=rand()%3;
	if(x==0) cout<<"怪物在你的左边";
	else if(x==1) cout<<"怪物在你的右边";
	else cout<<"怪物在你的前面";
	cout<<endl<<"a=打左边"<<"d=打右边"<<"w=打前面"<<"s=不想玩了"<<endl;
	cin>>c;
	srand(time(0));
	o=rand()%50;
	switch(c)
	{
		case 'a':if(0==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=20;cout<<",你赢了!获得20枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 'd':if(1==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=20;cout<<",你赢了!获得20枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 'w':if(2==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=20;cout<<",你赢了!获得20枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 's':cout<<"游戏结束。";
	}
		case 3:srand(time(0));
	x=rand()%3;
	if(x==0) cout<<"怪物在你的左边";
	else if(x==1) cout<<"怪物在你的右边";
	else cout<<"怪物在你的前面";
	cout<<endl<<"a=打左边"<<"d=打右边"<<"w=打前面"<<"s=不想玩了"<<endl;
	cin>>c;
	srand(time(0));
	o=rand()%100;
	switch(c)
	{
		case 'a':if(0==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=50;cout<<",你赢了!获得50枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 'd':if(1==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=50;cout<<",你赢了!获得50枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 'w':if(2==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=50;cout<<",你赢了!获得50枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 's':cout<<"游戏结束。";
	}
		case 4:srand(time(0));
	x=rand()%3;
	if(x==0) cout<<"怪物在你的左边";
	else if(x==1) cout<<"怪物在你的右边";
	else cout<<"怪物在你的前面";
	cout<<endl<<"a=打左边"<<"d=打右边"<<"w=打前面"<<"s=不想玩了"<<endl;
	cin>>c;
	srand(time(0));
	o=rand()%500;
	switch(c)
	{
		case 'a':if(0==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=100;cout<<",你赢了!获得100枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 'd':if(1==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=100;cout<<",你赢了!获得100枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 'w':if(2==x) {cout<<"命中敌人!"<<endl<<s<<"的攻击力是"<<m;if(m>=o) {r+=100;cout<<",你赢了!获得100枚金币!怪物的攻击力是"<<o;}else if(m<o){cout<<",你打不过他,可以用金币抽奖来增加攻击力。"<<endl<<"怪物的攻击力是"<<o;}}else cout<<s<<"未命中敌人。";break;
		case 's':cout<<"游戏结束。";
	}
		case 0:break;cout<<"已退出游戏";
	}
    }
    }
    cout<<"再见了。"<<s;
	return 0;
}