#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int x1;
int a_1,b_2,red_,blue_;
int player1[10],player2[10];
string name[10]={" ","放大镜","手铐","小刀","烟","啤酒","电话","药片","转换器","肾上腺素"};
bool f1=0,tg=0,cx=0,xd=0,ssxs=0;
int sk;
void print(string s){
for(int i=0;i<s.size();i++){
cout<<s[i];
Sleep(20);
}
cout<<endl;
}
void printt(string s){
for(int i=0;i<s.size();i++){
cout<<s[i];
Sleep(20);
}
}
int main(){
srand(time(0));
start:print("欢迎来到恶魔轮盘赌!");
print("请选择模式:");
print("1.直接与恶魔对战");
print("2.线下玩家对战");
cout<<"请输入模式:";
cin>>x1;
if(x1==1){
system("cls");
for(int i=1;i<=12;i++){
system("cls");
if(i%3==1)cout<<"正在向恶魔申请对战·";
if(i%3==2)cout<<"正在向恶魔申请对战··";
if(i%3==0)cout<<"正在向恶魔申请对战···";
Sleep(500);
}
system("cls");
print("恶魔发起挑战!");
Sleep(1000);
system("cls");
print("游戏准备开始!");
Sleep(1000);
system("cls");
print("3");
Sleep(1000);
system("cls");
print("2");
Sleep(1000);
system("cls");
print("1");
Sleep(1000);
system("cls");
print("开始!");
Sleep(1000);
ksl:system("cls");
a_1=6;b_2=6;
for(int i=1;i<=8;i++){
player1[i]=0;
player2[i]=0;
}
while(a_1>=1&&b_2>=1){
int a1=0,a2=0,a3=0,a4=0,a5=0,a6=0,a7=0,a8=0,a9=0;//放大镜,手铐,小刀,烟,啤酒,电话,药片,转换器,肾上腺素
printt("你获得的道具:");
for(int i=1;i<=4;i++){
int k1=rand()%9;
if(k1==0){
a1++;
}else if(k1==1){
a2++;
}else if(k1==2){
a3++;
}else if(k1==3){
a4++;
}else if(k1==4){
a5++;
}else if(k1==5){
a6++;
}else if(k1==6){
a7++;
}else if(k1==7){
a8++;
}else if(k1==8){
a9++;
}
}
int num1=0;
if(a1!=0){
cout<<a1;
printt("个放大镜,");
num1++;
player1[1]+=a1;
}if(a2!=0){
cout<<a2;
printt("个手铐,");
num1++;
player1[2]+=a2;
}if(a3!=0){
cout<<a3;
printt("个小刀,");
num1++;
player1[3]+=a3;
}if(a4!=0){
cout<<a4;
printt("个烟,");
num1++;
player1[4]+=a4;
}if(a5!=0){
cout<<a5;
printt("个啤酒,");
num1++;
player1[5]+=a5;
}if(a6!=0){
cout<<a6;
printt("个电话,");
num1++;
player1[6]+=a6;
}if(a7!=0){
cout<<a7;
printt("个药片,");
num1++;
player1[7]+=a7;
}if(a8!=0){
cout<<a8;
printt("个转换器,");
num1++;
player1[8]+=a8;
}if(a9!=0){
cout<<a9;
printt("个肾上腺素,");
num1++;
player1[9]+=a9;
}
printt("一共");
cout<<num1;
print("件物品。");
Sleep(1000);
a1=0,a2=0,a3=0,a4=0,a5=0,a6=0,a7=0,a8=0,a9=0;
printt("恶魔获得的道具:");
for(int i=1;i<=4;i++){
int k1=rand()%9;
if(k1==0){
a1++;
}else if(k1==1){
a2++;
}else if(k1==2){
a3++;
}else if(k1==3){
a4++;
}else if(k1==4){
a5++;
}else if(k1==5){
a6++;
}else if(k1==6){
a7++;
}else if(k1==7){
a8++;
}else if(k1==8){
a9++;
}
}
num1=0;
if(a1!=0){
cout<<a1;
printt("个放大镜,");
num1++;
player2[1]+=a1;
}if(a2!=0){
cout<<a2;
printt("个手铐,");
num1++;
player2[2]+=a2;
}if(a3!=0){
cout<<a3;
printt("个小刀,");
num1++;
player2[3]+=a3;
}if(a4!=0){
cout<<a4;
printt("个烟,");
num1++;
player2[4]+=a4;
}if(a5!=0){
cout<<a5;
printt("个啤酒,");
num1++;
player2[5]+=a5;
}if(a6!=0){
cout<<a6;
printt("个电话,");
num1++;
player2[6]+=a6;
}if(a7!=0){
cout<<a7;
printt("个药片,");
num1++;
player2[7]+=a7;
}if(a8!=0){
cout<<a8;
printt("个转换器,");
num1++;
player2[8]+=a8;
}if(a9!=0){
cout<<a9;
printt("个肾上腺素,");
num1++;
player2[9]+=a9;
}
printt("一共");
cout<<num1;
print("件物品。");
int h=rand()%3+4;
red_=rand()%(h-3)+2;
blue_=h-red_;
printt("实弹:");
cout<<red_<<"发,";
printt("空弹:");
cout<<blue_<<"发。";
Sleep(2000);
system("cls");
//player1[9]=2;
bool dan=0;
bool tg2=0,fdj=0;
int dan2=0;
for(int i=1;i<=8;i++){
kq:if(a_1<1||b_2<1) break;
if(red_==0&&blue_==0) break;
cout<<"你的血量:"<<a_1<<"/6,"<<"恶魔血量:"<<b_2<<"/6\n";
cout<<"实弹:"<<red_<<"发,"<<"空弹:"<<blue_<<"发。\n";
cout<<"你的道具:"<<player1[1]<<"个放大镜,"<<player1[2]<<"个手铐,"<<player1[3]<<"个小刀,"<<player1[4]<<"个烟,"<<player1[5]<<"个啤酒,"<<player1[6]<<"个电话,"<<player1[7]<<"个药片,"<<player1[8]<<"个转换器,"<<player1[9]<<"个肾上腺素。\n";
cout<<"恶魔的道具:"<<player2[1]<<"个放大镜,"<<player2[2]<<"个手铐,"<<player2[3]<<"个小刀,"<<player2[4]<<"个烟,"<<player2[5]<<"个啤酒,"<<player2[6]<<"个电话,"<<player2[7]<<"个药片,"<<player2[8]<<"个转换器,"<<player2[9]<<"个肾上腺素。\n";
if(!cx){
dan=rand()%h+1;
if(dan<=red_) dan=1;
else dan=0;
//cout<<"变弹了!\n";
}
cx=0;
if(!f1){
cout<<"你的回合,你可以进行以下操作:\n";
cout<<"1.向恶魔开枪\n";
cout<<"2.向自己开枪\n";
cout<<"3.使用放大镜\n";
cout<<"4.使用手铐\n";
cout<<"5.使用小刀\n";
cout<<"6.使用烟\n";
cout<<"7.使用啤酒\n";
cout<<"8.使用电话\n";
cout<<"9.使用药片\n";
cout<<"10.使用转换器\n";
cout<<"11.使用肾上腺素\n";
cout<<"你的选择(根据上面编号):";
int g=0;
cin>>g;
if(sk){
cx=1;
tg=1;
}
if(g==1){
cout<<"你选择了向恶魔开枪···";
Sleep(2000);
cout<<"是";
if(dan) cout<<"实弹";
else cout<<"空弹";
cout<<endl;
Sleep(1000);
if(dan){
if(xd) cout<<"恶魔扣两滴血",b_2=b_2-2;
else cout<<"恶魔扣一滴血",b_2--;
}
else cout<<"恶魔不扣血";
Sleep(2000);
if(dan) red_--;
else blue_--;
h--;
cx=0;
xd=0;
if(sk==1) tg=0;
if(sk) sk--;
if(sk){
cout<<"\n由于你使用了手铐,所以你可以再来一回合。";
Sleep(2000);
}
system("cls");
}else if(g==2){
cout<<"你选择了向自己开枪···";
Sleep(2000);
if(dan) cout<<"是实弹";
else cout<<"是空弹";
cout<<endl;
Sleep(1000);
if(sk==1) tg=0;
if(dan){
if(xd) cout<<"你扣两滴血",a_1-=2;
else cout<<"你扣一滴血",a_1--;
}
else cout<<"你可以再来一回合",tg=1;
Sleep(2000);
cx=0;
xd=0;
if(dan) red_--;
else blue_--;
if(sk) sk--;
if(sk){
cout<<"\n由于你使用了手铐,所以你可以再来一回合。";
Sleep(2000);
}
h--;
system("cls");
}else if(g==3&&player1[1]>0){
cout<<"你使用了放大镜···";
Sleep(2000);
cout<<"是";
if(dan) cout<<"实弹";
else cout<<"空弹";
Sleep(2000);
player1[1]--;
system("cls");
cx=1;
tg=1;
}else if(g==4&&player1[2]>0){
cout<<"你使用了手铐···\n";
Sleep(2000);
player1[2]--;
cout<<"由于你使用了手铐,所以你有两回合";
Sleep(2000);
cx=1;
tg=1;
sk=2;
system("cls");
}else if(g==5&&player1[3]>0){
cout<<"你使用了小刀···\n";
Sleep(2000);
player1[3]--;
cout<<"由于你使用了小刀,所以开枪伤害+1";
Sleep(2000);
cx=1;
tg=1;
xd=1;
system("cls");
}else if(g==6&&player1[4]>0){
cout<<"你使用了烟···\n";
Sleep(2000);
if(a_1==6){
cout<<"由于你满血,所以烟对你无效";
i--;
a_1--;
}
else cout<<"你恢复1点血量";
player1[4]--;
a_1++;
cx=1;
tg=1;
Sleep(2000);
system("cls");
}else if(g==7&&player1[5]>0){
cout<<"你使用了啤酒···";
Sleep(2000);
player1[5]--;
cout<<"退了发";
if(dan) cout<<"实弹",h--,red_--;
else cout<<"空弹",h--,blue_--;
Sleep(2000);
tg=1;
system("cls");
}else if(g==8&&player1[6]>0){
cout<<"你使用了电话···\n";
Sleep(2000);
player1[6]--;
if(h<=2) cout<<"没有显示";
else{
cout<<"第"<<rand()%(h-2)+3<<"发是";
if(rand()%2) cout<<"实弹";
else cout<<"空弹";
}
Sleep(2000);
cx=1;
tg=1;
system("cls");
}else if(g==9&&player1[7]>0){
cout<<"你使用了药片···";
Sleep(2000);
if(rand()%2){
cout<<"你中毒了,你扣一滴血";
a_1--;
}else{
if(a_1==6){
cout<<"由于你满血,所以药片对你无效";
i--;
}else{
cout<<"你没中毒,你恢复一滴血";
a_1++;
}
}
player1[7]--;
cx=1;
tg=1;
Sleep(2000);
system("cls");
}else if(g==10&&player1[8]>0){
cout<<"你使用了转换器···";
Sleep(2000);
player1[8]--;
cout<<"成功转换";
Sleep(2000);
cx=1;
tg=1;
if(dan) red_--,blue_++;
else blue_--,red_++;
dan=!dan;
system("cls");
}else if(g==11&&player1[9]>0){
cout<<"你使用了肾上腺素···\n";
player1[9]--;
Sleep(2000);
poi:cout<<"你可以拿走恶魔:\n";
cout<<"1.放大镜\n";
cout<<"2.手铐\n";
cout<<"3.小刀\n";
cout<<"4.烟\n";
cout<<"5.啤酒\n";
cout<<"6.电话\n";
cout<<"7.药片\n";
cout<<"8.转换器\n";
int gg=0;
cout<<"你的选择(输入编号):";
cin>>gg;
if(gg==1&&player2[1]>0){
cout<<"你拿走了恶魔放大镜。";
player1[1]++;
player2[1]--;
}else if(gg==2&&player2[2]>0){
cout<<"你拿走了恶魔手铐。";
player1[2]++;
player2[2]--;
}else if(gg==3&&player2[3]>0){
cout<<"你拿走了恶魔小刀。";
player1[3]++;
player2[3]--;
}else if(gg==4&&player2[4]>0){
cout<<"你拿走了恶魔烟。";
player1[4]++;
player2[4]--;
}else if(gg==5&&player2[5]>0){
cout<<"你拿走了恶魔啤酒。";
player1[5]++;
player2[5]--;
}else if(gg==6&&player2[6]>0){
cout<<"你拿走了恶魔电话。";
player1[6]++;
player2[6]--;
}else if(gg==7&&player2[7]>0){
cout<<"你拿走了恶魔药片。";
player1[7]++;
player2[7]--;
}else if(gg==8&&player2[8]>0){
cout<<"你拿走了恶魔转换器。";
player1[8]++;
player2[8]--;
}else{
cout<<"你可能输错或恶魔没有这件东西";
Sleep(2000);
cx=1;
i--;
system("cls");
player1[9]++;
goto end;
}
Sleep(2000);
cx=1;
tg=1;
system("cls");
}
else{
cout<<"你的输入不合法或你没有道具!";
Sleep(2000);
system("cls");
cx=1;
tg=1;
i--;
}
f1=!f1;
if(tg==1) tg=0,f1=0;
}
else{
tg2=0;
cout<<"恶魔的回合:\n";
if(b_2<6){
if(player2[4]>0){
cout<<"恶魔使用了烟···";
Sleep(2000);
cout<<endl<<"恶魔回复一点血量";
Sleep(2000);
player2[4]--;
b_2++;
cx=1;
tg2=1;
system("cls");
i++;
goto kq;
}else{
if(player2[9]>0&&player1[4]>0){
cout<<"恶魔使用了肾上腺素···\n";
Sleep(2000);
cout<<"拿走了你的烟";
player2[9]--;
player1[4]--;
player2[4]++;
Sleep(2000);
cx=1;
tg2=1;
system("cls");
i++;
goto kq;
}else{
if(player2[7]>0&&b_2==2){
cout<<"恶魔使用了药···";
Sleep(2000);
player2[7]--;
if(rand()%2){
cout<<"恶魔中毒了,所以恶魔扣一滴血";
b_2--;
f1=!f1;
cx=1;
i++;
Sleep(2000);
system("cls");
goto kq;
}
else{
cout<<"恶魔没中毒,所以恶魔加一滴血";
b_2++;
}
Sleep(2000);
cx=1;
tg2=1;
system("cls");
i++;
goto kq;
}
}
}
}
if(player2[1]>0&&fdj==0){
cout<<"恶魔使用了放大镜···";
Sleep(2000);
player2[1]--;
dan2=dan;
cx=1;
tg2=1;
fdj=1;
system("cls");
}
else if(fdj==1&&dan2==1){
fdj=0;
cout<<"恶魔向你开枪···";
Sleep(2000);
if(dan) cout<<"是实弹";
else cout<<"是空弹";
cout<<endl;
Sleep(1000);
if(dan) cout<<"你扣一滴血",a_1--;
else cout<<"你不扣血";
Sleep(2000);
if(dan) red_--;
else blue_--;
h--;
system("cls");
}else if(dan2==0&&fdj==1){
fdj=0;
cout<<"恶魔向他自己开枪···";
Sleep(2000);
if(dan) cout<<"是实弹";
else cout<<"是空弹";
cout<<endl;
Sleep(1000);
if(dan) cout<<"恶魔扣一滴血",b_2--;
else cout<<"恶魔不扣血",tg2=1;
Sleep(2000);
if(dan) red_--;
else blue_--;
h--;
system("cls");
}else if(red_>=blue_){
cout<<"恶魔向你开枪···";
Sleep(2000);
if(dan) cout<<"是实弹";
else cout<<"是空弹";
cout<<endl;
Sleep(1000);
if(dan) cout<<"你扣一滴血",a_1--;
else cout<<"你不扣血";
Sleep(2000);
if(dan) red_--;
else blue_--;
h--;
system("cls");
}else if(red_<blue_){
cout<<"恶魔向他自己开枪···";
Sleep(2000);
if(dan) cout<<"是实弹";
else cout<<"是空弹";
cout<<endl;
Sleep(1000);
if(dan) cout<<"恶魔扣一滴血",b_2--;
else cout<<"恶魔不扣血",tg2=1;
Sleep(2000);
if(dan) red_--;
else blue_--;
h--;
system("cls");
}
f1=!f1;
if(tg2) tg2=0,f1=1;
system("cls");
}
end:;
}
//break;
}
if(a_1==0){
cout<<"你输了,你已经被恶魔杀死了";
Sleep(5000);
return 0;
}
else{
cout<<"恭喜你,你获得了"<<rand()%(200000-100000)+100000<<"美元!\n";
}
Sleep(5000);
cout<<"请问是否回到主页?";
string ka;
cin>>ka;
if(ka=="是") goto start;
}
else if(x1==2) cout<<"暂未开发!";
else if(x1==54188) goto ksl;
return 0;
}