#include <bits/stdc++.h> using namespace std; int s = 2, i = 60; char v, n, y, u; int f = 51, x = 0, d1 = 1, n11 = 100,RP=0,rp[1000000]; int wjsl=666; int main() { rp[1]=500; rp[2]=500; rp[3]=10000; rp[666]=10000; int a; //启动界面 cout << " * 请按任意键启动游戏*" << endl; v=getchar(); while(1){
cout << endl<<endl;
cout << "-------------- 首页 -------------------------------------" << endl
<< endl;
cout << " _____________ _____________ _____________" << endl;
cout << "| | | | | |" << endl;
cout << "| 1.开始游戏 | | 2.公告 | | 3.结束游戏 |" << endl;
cout << "|_____________| |_____________| |_____________|" << endl;
cout << endl;
cin >> v;
if (v == '1') {
cout << endl
<< "---------- 恶魔轮盘赌 ----------" << endl
<< endl;
int zd[10], dj1[10], dj2[10], hp1 = 4, hp2 = 4, aaa, zds = 6, sh = 1, xs = 1, xz;
while (hp1 != 0 && hp2 != 0) {
for (int i = 1; i <= 3; i++) {
zd[i] = 0;
}
for (int i = 4; i <= 6; i++) {
zd[i] = 1;
}
srand(time(0));
for (int i = 1; i <= 4; i++) {
dj1[i] = 1 + rand() % 4;
}
cout << endl
<< ">>--------------------------------------------------------------<<"
<< "\n";
cout << "A的道具为 ";
for (int i = 1; i <= 4; i++) {
cout << i << ":";
if (dj1[i] == 1) {
cout << "香烟"
<< " ";
}
if (dj1[i] == 2) {
cout << "啤酒"
<< " ";
}
if (dj1[i] == 3) {
cout << "小刀"
<< " ";
}
if(dj1[i]==4){
cout<<"放大镜"
<<" ";
}
}
cout << endl
<< endl;
for (int i = 1; i <= 4; i++) {
dj2[i] = 1 + rand() % 3;
}
cout << "B的道具为 ";
for (int i = 1; i <= 4; i++) {
cout << i << ":";
if (dj2[i] == 1) {
cout << "香烟"
<< " ";
}
if (dj2[i] == 2) {
cout << "啤酒"
<< " ";
}
if (dj2[i] == 3) {
cout << "小刀"
<< " ";
}
if(dj2[i]==4){
cout<<"放大镜"
<<" ";
}
}
cout << endl
<< ">>--------------------------------------------------------------<<"
<< "\n"
<< "\n";
int bh;
srand(time(0));
zds = 6;
while (zds >= 1) {
if (xs == 1) {
cout << "-------------------"
<< endl<<"轮到A"
<< "\n";
bh = 1 + rand() % 6;
if (zd[bh] == -1) {
while (zd[bh] == -1) {
bh = 1 + rand() % 6;
}
}
cout << "你要使用什么道具?请输入编号"<<endl;
cout<<"当前可用道具:";
if(dj1[1]!=-1){
cout<<"1";
if (dj1[1] == 1) cout <<"香烟 ";
if (dj1[1] == 2) cout <<"啤酒 ";
if (dj1[1] == 3) cout <<"小刀 ";
if (dj1[1] == 4) cout<<"放大镜 ";
}
if(dj1[2]!=-1){
cout<<"2";
if (dj1[2] == 1) cout <<"香烟 ";
if (dj1[2] == 2) cout <<"啤酒 ";
if (dj1[2] == 3) cout <<"小刀 ";
if (dj1[2] == 4) cout<<"放大镜 ";
}
if(dj1[3]!=-1){
cout<<"3";
if (dj1[3] == 1) cout <<"香烟 ";
if (dj1[3] == 2) cout <<"啤酒 ";
if (dj1[3] == 3) cout <<"小刀 ";
if (dj1[3] == 4) cout<<"放大镜 ";
}
if(dj1[4]!=-1){
cout<<"4";
if (dj1[4] == 1) cout <<"香烟 ";
if (dj1[4] == 2) cout <<"啤酒 ";
if (dj1[4] == 3) cout <<"小刀 ";
if (dj1[4] == 4) cout<<"放大镜 ";
}
cout<<"(如果当前无可用道具即可用道具为空,输入1即可)"<<endl;
cin >> aaa;
if (dj1[aaa] == -1) {
cout << endl<<"这个道具已经使用过了"
<< "\n";
cout << endl<<"你要对谁开枪?1.对对方2.对自己"
<< "\n";
cin >> xz;
zds--;
if (xz == 1) {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp2 = hp2 - sh;
if (hp2 <= 0) {
cout << "A赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "B血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
xs = -xs;
}
} else {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp1 = hp1 - sh;
if (hp1 <= 0) {
cout << "B赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "A血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
xs = -xs;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
}
}
} else {
if (dj1[aaa] == 1) {
cout << "使用香烟"
<< "\n";
hp1++;
cout << "你的血量加一"
<< "\n";
dj1[aaa] = -1;
cout << endl<<"你要对谁开枪?1.对对方2.对自己"
<< "\n";
cin >> xz;
zds--;
if (xz == 1) {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp2 = hp2 - sh;
if (hp2 <= 0) {
cout << "A赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "B血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
xs = -xs;
}
} else {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp1 = hp1 - sh;
if (hp1 <= 0) {
cout << "B赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "A血量-" << sh << "\n";
sh = 1;
xs = -xs;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
}
}
}
if (dj1[aaa] == 2) {
cout << "使用啤酒"
<< "\n";
zds--;
if (zd[bh] == 0) {
cout << "退出一发空弹"
<< "\n";
zd[bh] = -1;
} else {
cout << "退出一发实弹"
<< "\n";
zd[bh] = -1;
}
dj1[aaa] = -1;
continue;
}
if (dj1[aaa] == 3) {
cout << "使用小刀"
<< "\n";
sh = 2;
cout << endl<<"下一次开枪攻击翻倍"
<< "\n";
dj1[aaa] = -1;
cout << endl<<"你要对谁开枪?1.对对方2.对自己"
<< "\n";
cin >> xz;
zds--;
if (xz == 1) {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp2 = hp2 - sh;
if (hp2 <= 0) {
cout << "A赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "B血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
xs = -xs;
}
} else {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp1 = hp1 - sh;
if (hp1 <= 0) {
cout << "B赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "A血量-" << sh << "\n";
sh = 1;
xs = -xs;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
}
}
}
if (dj1[aaa] == 4) {
cout << "使用放大镜"
<< "\n";
dj1[aaa] = -1;
if (zd[bh] == 0) {
cout << "这是一发空弹"
<< "\n";
} else {
cout << "这是一发实弹"
<< "\n";
}
cout << endl<<"你要对谁开枪?1.对对方2.对自己"
<< "\n";
cin >> xz;
zds--;
if (xz == 1) {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp2 = hp2 - sh;
if (hp2 <= 0) {
cout << "A赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "B血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
xs = -xs;
}
} else {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp1 = hp1 - sh;
if (hp1 <= 0) {
cout << "B赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "A血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
xs = -xs;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
}
}
}
}
}
if (xs == -1) {
cout << "-------------------"
<< endl<<"轮到B"
<< "\n";
bh = 1 + rand() % 6;
if (zd[bh] == -1) {
while (zd[bh] == -1) {
bh = 1 + rand() % 6;
}
}
cout << "你要使用什么道具?请输入编号"<<endl;
cout<<"当前可用道具:";
if(dj2[1]!=-1){
cout<<"1";
if (dj2[1] == 1) cout <<"香烟 ";
if (dj2[1] == 2) cout <<"啤酒 ";
if (dj2[1] == 3) cout <<"小刀 ";
if (dj2[1] == 4) cout<<"放大镜 ";
}
if(dj2[2]!=-1){
cout<<"2";
if (dj2[2] == 1) cout <<"香烟 ";
if (dj2[2] == 2) cout <<"啤酒 ";
if (dj2[2] == 3) cout <<"小刀 ";
if (dj2[2] == 4) cout<<"放大镜 ";
}
if(dj2[3]!=-1){
cout<<"3";
if (dj2[3] == 1) cout <<"香烟 ";
if (dj2[3] == 2) cout <<"啤酒 ";
if (dj2[3] == 3) cout <<"小刀 ";
if (dj2[3] == 4) cout<<"放大镜 ";
}
if(dj2[4]!=-1){
cout<<"4";
if (dj2[4] == 1) cout <<"香烟 ";
if (dj2[4] == 2) cout <<"啤酒 ";
if (dj2[4] == 3) cout <<"小刀 ";
if (dj2[4] == 4) cout<<"放大镜 ";
}
cout<<"(如果当前无可用道具即可用道具为空,输入1即可)"<<endl;
// cout<<""<<endl; cin>>aaa; if (dj2[aaa] == -1) { cout << endl<<"这个道具已经使用过了" << "\n"; cout << endl<<"你要对谁开枪?1.对对方2.对自己" << "\n"; cin >> xz; zds--; if (xz == 1) { if (zd[bh] == 1) { cout << "这是实弹" << "\n"; hp1 = hp1 - sh; if (hp1 <= 0) { cout << "B赢了" << "\n"; cout << endl << "----------------------------------------game over-------------------------------------------------" << "\n" << "\n"; cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "A血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
xs = -xs;
}
} else {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp2 = hp2 - sh;
if (hp2 <= 0) {
cout << "A赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "B血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
xs = -xs;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
}
}
} else {
if (dj2[aaa] == 1) {
cout << "使用香烟"
<< "\n";
hp2++;
cout << "你的血量加一"
<< "\n";
dj2[aaa] = -1;
cout << endl<<"你要对谁开枪?1.对对方2.对自己"
<< "\n";
cin >> xz;
zds--;
if (xz == 1) {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp1 = hp1 - sh;
if (hp1 <= 0) {
cout << "B赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "A血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
xs = -xs;
}
} else {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp2 = hp2 - sh;
if (hp2 <= 0) {
cout << "A赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "B血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
xs = -xs;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
}
}
}
if (dj2[aaa] == 2) {
cout << "使用啤酒"
<< "\n";
zds--;
if (zd[bh] == 0) {
cout << "退出一发空弹"
<< "\n";
zd[bh] = -1;
} else {
cout << "退出一发实弹"
<< "\n";
zd[bh] = -1;
}
dj2[aaa] = -1;
continue;
}
if (dj2[aaa] == 3) {
cout << "使用小刀"
<< "\n";
sh = 2;
cout << endl<<"下一次开枪攻击翻倍"
<< "\n";
dj2[aaa] = -1;
cout << endl<<"你要对谁开枪?1.对对方2.对自己"
<< "\n";
cin >> xz;
zds--;
if (xz == 1) {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp1 = hp1 - sh;
if (hp1 <= 0) {
cout << "B赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"
<< "\n"
<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "A血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
xs = -xs;
}
} else {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp2 = hp2 - sh;
if (hp2 <= 0) {
cout << "A赢了"
<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"<< "\n"<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "B血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
xs = -xs;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
}
}
}
if (dj1[aaa] == 4) {
cout << "使用放大镜"<< "\n";
dj1[aaa] = -1;
if (zd[bh] == 0) {
cout << "这是一发空弹"<< "\n";
} else {
cout << "这是一发实弹"<< "\n";
}
cout << endl<<"你要对谁开枪?1.对对方2.对自己"
<< "\n";
cin >> xz;
zds--;
if (xz == 1) {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp1 = hp1 - sh;
if (hp1 <= 0) {
cout << "B赢了"<< "\n";
cout << endl
<< "----------------------------------------game over-------------------------------------------------"<< "\n"<<"\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "A血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
xs = -xs;
}
} else {
if (zd[bh] == 1) {
cout << "这是实弹"
<< "\n";
hp2 = hp2 - sh;
if (hp2 <= 0) {
cout << "A赢了"
<< "\n";
cout << endl<< "----------------------------------------game over-------------------------------------------------"<< "\n"<< "\n";
cout << " <----- n.结束游戏 -------------" << endl;
cout << " <----- f.再来一次 -------------" << endl;
cin >> v;
break;
}
cout << "B血量-" << sh << "\n";
cout << "A剩余血量:" << hp1 << "\n";
cout << "B剩余血量:" << hp2 << "\n";
sh = 1;
xs = -xs;
} else {
cout << "这是空弹"
<< "\n";
sh = 1;
}
}
}
}
}
}
}
}
if (v == '2') {
cout << endl<< "-------------- 公告 --------------------------------" << endl<< endl;
cout << " 欢迎游玩恶魔轮盘赌(双人版)"<< "\n";
cout << " 版本:2.60"<< "\n";
cout << " 本次更新了使用道具前的提示和血量提示,优化了亿点版面,尽情期待新道具手铐和实/空弹提示......"<< "\n"<<endl;
cout<<"游戏规则:"<<endl;
cout<<"1.每名玩家初始有4点血量,血量归零则失败"<<endl;
cout<<"2.和普通轮盘赌一样,枪里有空弹和实弹"<<endl;
cout<<"3.每名玩家每轮会随机分配道具"<<endl;
cout<<"4.游戏中有四种道具(没有手铐):香烟、啤酒、小刀、放大镜"<<endl;
cout<<"5.道具的作用分别是:增加一点血量、退出当前子弹、下一轮伤害翻倍、查看当前子弹"<<endl;
cout <<endl<< " 祝你玩得开心\n"<< endl;
cout << " 1.返回首页" << endl;
cout << " 2.结束游戏" << endl;
cin >> v;
if(v=='2'){
return 0;
}
}
if(v=='3'){
string aaa;
cout<<" 真的吗?(真的输入 我是个帅哥(注:这被和谐了),假的输入 1)\n";
cin>>aaa;
if(aaa=="我是个帅哥"){
return 0;
}else if(aaa!="1"){
cout<<"\n 重新输入!!!!!!\n\n";
}
}
}
return 0;
}