跳到正文

休闲·娱乐

C++高仿《恶魔轮盘赌》游戏《Cvil roulette》今日正式完工(25/12/27)

Hola_约 97 分钟
原文
文章信息与版本

文章信息

发布
2025年12月27日
收录
2026年10月30日
更新
2026年11月21日
篇幅
约 97 分钟

版本

  1. v1当前

C++高仿《恶魔轮盘赌》游戏《Cvil roulette》今日正式完工(25/12/27)

已开启测试阶段

运行环境:Windows(低版本Windows可能出现部分字符输出异常 但不影响游戏玩法)

注: 游戏过程需保证合法输入 有关不合法输入兼容问题不进行修改
游戏设立奖池累积制 游戏目标为积累足够多的bonus

本人是蒟蒻 代码较丑 望dalao见谅

作弊模式:去除163行代码的注释

C++
#include <bits/stdc++.h>
#include <windows.h>
#define RED cout<<"\033[31m"
#define WHITE cout<<"\033[37m"
#define BLUE cout<<"\033[34m"
#define YELLOW cout<<"\033[33m"
#define GREEN cout<<"\033[32m"
#define PURPLE cout<<"\033[35m"
#define INDIGO cout<<"\033[36m"
using namespace std;
string name;
bool ffff=1,fffff=1;
long long bonus=0;
int hurts=0,shot=0,suc=0,tool=0,mis=0;
double pro,proo[9];
int mtn=0,dtn=0;
bool mhb,dhb,mmhb,ddhb,mkb,dkb,mmkb,ddkb;
int rd,mhp,dhp,fn,rn,shn,fl,rl,tot;
int shnn,mfindn;
int mn,hn,cn,kn,dn,mpn,men,mvn,man;
int dmn,dhn,dcn,dkn,ddn,den,dvn,dpn,dan;
int now[1005],f[1005];
string reff[7]={"FIRST","SECOND","THIRD","FOURTH","FIFTH","SIXTH","SEVENTH"};
string ref[10]={"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","TEN"};
void randd(int n,int k){
	int total = n + k;
    int* a = new int[total + 1];
    for (int i = 1; i <= n; i++) {a[i] = 0;}
    for (int i = n + 1; i <= total; i++) {a[i] = 1;}
    srand(static_cast<unsigned int>(time(0)));
    for (int i = total; i > 1; i--) {
        int j = rand() % i + 1;
        swap(a[i], a[j]);
    }for(int i=1;i<=n+k;i++)f[i]=a[i];
    return;
}
void p(int x){Sleep(x);}
void print(string s,int time){
	int l=s.length();
	for(int i=0;i<l;i++){
		p(time);
		cout<<s[i];
	}cout<<' ';
}
void pprint(string s[],int x,int t){
	for(int i=0;i<x;i++)print(s[i],t);
	cout<<endl;
}
void waitt(){
	WHITE;
	cout<<endl<<endl;
	print("Counting",10);
	print("...",100);
	cout<<endl<<endl;
	print("NEXT TURN**************************",0);
	cout<<endl<<endl;
	print("NEW TURN***************************",0);
	cout<<endl<<endl;
}
void winner(){
	cout<<endl;
	WHITE;
	print("------------------------------------------",0); 
	cout<<endl<<endl;
	print("Congratulations. You've entered the next round:",20);
	cout<<endl<<endl;
	char c;cin>>c;
	return;
}
void winnner(){
	bonus+=(suc*3500000+shot*6700000-mis*19015-hurts*279035+tool*1200255);
	cout<<endl;
	YELLOW;print("------------------------------------------------------------------------",0); 
	cout<<endl<<endl;
	print("Congratulations! You've managed to take the money you long for !",10);cout<<endl;print("Here are the details of the game records :",5);cout<<endl<<endl;
	print("#------------------------------------------------------#",1);cout<<endl;
	print("|                                                      |",1);cout<<endl;
	print("|   Successful anticipation :",1);printf("%3d",suc);print("                      |",1);cout<<endl;
	print("|   Successful shoot        :",1);printf("%3d",shot);print("                      |",1);cout<<endl;
	print("|   Tool usage              :",1);printf("%3d",tool);print("                      |",1);cout<<endl;
	print("|   Mistaken judgment       :",1);printf("%3d",mis);print("                      |",1);cout<<endl;
	print("|   Getting hurts           :",1);printf("%3d",hurts);print("                      |",1);cout<<endl;
	print("|                                                      |",1);cout<<endl;
	print("|                                                      |",1);cout<<endl;
	print("|                              Total bonus:            |",1);cout<<endl;
	print("|                              ",1);printf("%9lld",bonus);print("             |",1);cout<<endl;
	print("|                                                      |",1);cout<<endl;
	print("#------------------------------------------------------#",1);cout<<endl;
	cout<<endl;
	print("Your possible choices :",1);cout<<endl<<endl;
	print("C/c : Continue to earn more money.     H/h : Hold your money and end the game.",1);cout<<endl<<endl;
	char c;cin>>c;
	if(c=='h'||c=='H'){
		cout<<endl;
		print("See you next time.",5);
		fffff=0;
		exit(0);
	}else{
		RED;cout<<endl;print("Human beings always have endless desires...",20);cout<<endl<<endl;
		print("Press any key to continue :",2);cout<<endl;
		string ccc;cin>>ccc;
		return;
	}
}
void failure(){
	ffff=0;
	cout<<endl;
	WHITE;
	print("------------------------------------------",0); 
	cout<<endl<<endl;
	RED;
	print("YOU'VE LOST EVERYTHING.",50);
	cout<<endl<<endl;
}
void thinking(){
	YELLOW;
	print("Thinking...",30);cout<<endl;p(100);
}
void init(){
	string x;
	for(int i=0;i<30;i++){
		cout<<"* ";
		p(3);
	}cout<<"\033[31m"<<endl;
	p(30);cout<<"CONTRACT OF THE FINAL WAGER"<<"\033[33m"<<endl<<endl;
	p(30);cout<<"BETWEEN: The Entity known as The Dealer, Keeper of the Table."<<endl;
	p(30);cout<<"AND: The Mortal Participant, henceforth The Wagerer."<<endl<<endl;
	p(30);cout<<"This document, inscribed in irreversible intent, formalizes the absolute terms of engagement in the rite known as Demon's Roulette. By your will, you enter; by this pact, you are bound."<<endl<<endl;
	p(30);cout<<"ARTICLE I: THE STAKE"<<endl;
	p(30);cout<<"Your entry fee is your mortal existence. Each round played is done so with the explicit understanding that the instrument may sever your life's thread. This risk is accepted in full. The concurrent and ultimate stake is your immortal soul. Its fate is decided solely by the game's outcome."<<endl<<endl;
	p(30);cout<<"ARTICLE II: THE RULE OF LAW"<<endl;
	p(30);cout<<"The rules of the game, as presented at the commencement, are absolute and immutable. They constitute the only governing law of this contest. There is no arbitration, no appeal, and no higher authority that may intervene or alter these conditions once play has begun."<<endl<<endl;
	p(30);cout<<"ARTICLE III: FORFEITURE & CLAIM"<<endl;
	p(30);cout<<"Victory may grant reprieve and a boon, its nature determined by The Dealer. Defeat results in the immediate and total forfeiture of your being. Your soul is irrevocably claimed, its essence dissolved into the currency of The House or repurposed for its inscrutable ends. No aspect of your consciousness shall persist."<<endl<<endl;
	p(30);cout<<"ARTICLE IV: ACKNOWLEDGEMENT"<<endl;
	p(30);cout<<"The Wagerer attests that participation is wholly voluntary, undertaken with clear understanding of the terminal stakes. This is not mere gambling; it is a ritual of dissolution. The bullet is but the final instrument; the true agent of fate was your decision to sign."<<endl<<endl;
	p(30);cout<<"This contract is self-executing upon the commencement of the first turn. Your mark below seals this pact beyond all breaking."<<endl<<endl;
	p(30);string ss[4]={"Plz","sign","up","here"};
	cout<<"\033[37m";
	for(int i=0;i<30;i++){
		cout<<"* ";
		p(3);
	}x="ASDASD";
	while(x.length()>5||x=="GOD"){
		cout<<"\033[31m"<<endl;
		pprint(ss,4,30);
		cout<<"\033[37m";
		cin>>x;
		if(x.length()>5){
			cout<<"\033[31m";
			string sss[9]={"WARNING:","Plz","avoid","using","names","longer","than","5","characters."};
			pprint(sss,9,20);
		}else if(x=="GOD"){
			cout<<"\033[31m";
			string sss[6]={"WARNING:","Your","name","has","been","used."};
			pprint(sss,6,20);
		}
	}rd=1;mhp=1;dhp=1;fn=2;shn=3;rn=1;
	name=x;
	return;
}
void bullets(){
	//cout<<endl;for(int i=1;i<=shn;i++){if(f[i]){RED;cout<<"REAL ";}else{BLUE;cout<<"FAKE ";}}cout<<endl;
	p(20);
	cout<<endl;
	for(int i=1;i<=shn;i++){
		if(now[i]==0){
			cout<<"\033[37m";
			print("■■■■■",5);
			cout<<"    ";
			print("-Unknown Bullets",10);
			cout<<endl<<endl; 
		}if(now[i]==1){
			cout<<"\033[31m";
			print("■■■■■",5);
			cout<<"    ";
			print("-Real Bullets",10);
			cout<<endl<<endl; 
		}if(now[i]==-1){
			cout<<"\033[34m";
			print("■■■■■",5);
			cout<<"    ";
			print("-Fake Bullets",10);
			cout<<endl<<endl; 
		}
	}YELLOW;
	if(rn==1){
		string sss=ref[rn-1]+" is REAL ; "+ref[fn-1]+" are FAKE.";
		print(sss,10);	
	} else if(fl==1){
		string sss=ref[rn-1]+" are REAL ; "+ref[fn-1]+" is FAKE.";
		print(sss,10);	
	}else{
		string sss=ref[rn-1]+" are REAL ; "+ref[fn-1]+" are FAKE.";
		print(sss,10);
	}
	cout<<endl;
}
void hp(){
	cout<<endl<<"\033[37m";
	print(name,10);
	print("'s HP:",10);
	cout<<' '<<mhp<<endl;
	print("Dealer's HP:",10);
	cout<<' '<<dhp<<endl;
	cout<<endl;
}
void choi(int rd,int x){
	if(x==1){
		cout<<"\033[31m";
		cout<<"////////////////////////////////////////"<<endl; 
		print("Your possible choices:",10);cout<<endl;
		print("D/d: SHOOT DEALER...",10);
		cout<<endl;
		print("M/m: SHOOT MYSELF...",10);
		cout<<endl;
		cout<<"////////////////////////////////////////"<<endl; 
		return;
	}if(rd==1){
		cout<<"\033[37m";
		cout<<"////////////////////////////////////////"<<endl; 
		print("Your possible choices:",10);cout<<endl;
		cout<<"\033[31m";
		print("S/s: SHOOT",10);
		WHITE;
		cout<<endl;
		cout<<"////////////////////////////////////////"<<endl<<endl; 
		return;
	}return;
}
void choii(){
	WHITE;cout<<"////////////////////////////////////////"<<endl; 
	print("Your possible choices:",10);cout<<endl;
	RED;print("S/s: SHOOT",10);cout<<endl;WHITE;
	WHITE;if(mfindn!=0){print("F/f: Find (",5);cout<<mfindn;print(" / 3 )",5);cout<<endl;}
	GREEN;if(mn!=0){print("M/m: Magnifier (",5);cout<<mn;print(" )",5);cout<<endl;}
	if(hn!=0){print("H/h: Handcuffs (",5);cout<<hn;print(" )",5);cout<<endl;}
	if(cn!=0){print("C/c: Cigarette (",5);cout<<cn;print(" )",5);cout<<endl;}
	if(kn!=0){print("K/k: Knife (",5);cout<<kn;print(" )",5);cout<<endl;}
	if(dn!=0){print("D/d: Carbonated drinks (",5);cout<<dn;print(" )",5);cout<<endl;}
	WHITE;cout<<"////////////////////////////////////////"<<endl<<endl; 
	return;
}
void choiii(){
	cout<<endl;
	WHITE;print("Dealer's tools:",5);cout<<endl;
	PURPLE;cout<<"////////////////////////////////////////"<<endl; 
	if(dmn){print("Magnifier : (",5);cout<<dmn;print(" )",5);cout<<endl;}
	if(dhn){print("Handcuffs : (",5);cout<<dhn;print(" )",5);cout<<endl;}
	if(dcn){print("Cigarette : (",5);cout<<dcn;print(" )",5);cout<<endl;}
	if(dkn){print("Knife : (",5);cout<<dkn;print(" )",5);cout<<endl;}
	if(ddn){print("Carbonated drinks : (",5);cout<<ddn;print(" )",5);cout<<endl;}
	PURPLE;cout<<"////////////////////////////////////////"<<endl<<endl; 
	WHITE;
}
void choiiiii(){
	cout<<endl;
	PURPLE;print("Dealer's tools:",5);cout<<endl;
	PURPLE;cout<<"////////////////////////////////////////"<<endl; 
	if(dtn){print("Tool sum :",5);cout<<' '<<dtn<<endl;}
	if(dmn){print("Magnifier : (",5);cout<<dmn;print(" )",5);cout<<endl;}
	if(dhn){print("Handcuffs : (",5);cout<<dhn;print(" )",5);cout<<endl;}
	if(dcn){print("Cigarette : (",5);cout<<dcn;print(" )",5);cout<<endl;}
	if(dkn){print("Knife : (",5);cout<<dkn;print(" )",5);cout<<endl;}
	if(ddn){print("Carbonated drinks : (",5);cout<<ddn;print(" )",5);cout<<endl;}
	if(dpn){print("Phone : (",5);cout<<dpn;print(" )",5);cout<<endl;}
	if(den){print("Expired pills : (",5);cout<<den;print(" )",5);cout<<endl;}
	if(dvn){print("Converter : (",5);cout<<dvn;print(" )",5);cout<<endl;}
	if(dan){print("Adrenaline : (",5);cout<<dan;print(" )",5);cout<<endl;}
	PURPLE;cout<<"////////////////////////////////////////"<<endl<<endl; 
	WHITE;
}
void choiiii(){
	WHITE;cout<<"////////////////////////////////////////"<<endl; 
	if(mtn){print("Tool sum :",5);cout<<' '<<mtn<<endl;}
	print("Your possible choices:",10);cout<<endl;
	RED;print("S/s: SHOOT",10);cout<<endl;WHITE;
	WHITE;if(mfindn!=0){print("F/f: Find (",5);cout<<mfindn;print(" / 4 )",5);cout<<endl;}
	GREEN;if(mn!=0){print("M/m: Magnifier (",5);cout<<mn;print(" )",5);cout<<endl;}
	if(hn!=0){print("H/h: Handcuffs (",5);cout<<hn;print(" )",5);cout<<endl;}
	if(cn!=0){print("C/c: Cigarette (",5);cout<<cn;print(" )",5);cout<<endl;}
	if(kn!=0){print("K/k: Knife (",5);cout<<kn;print(" )",5);cout<<endl;}
	if(dn!=0){print("D/d: Carbonated drinks (",5);cout<<dn;print(" )",5);cout<<endl;}
	if(mpn!=0){print("P/p: Phone (",5);cout<<mpn;print(" )",5);cout<<endl;}
	if(men!=0){print("E/e: Expired pills (",5);cout<<men;print(" )",5);cout<<endl;}
	if(mvn!=0){print("V/v: Converter (",5);cout<<mvn;print(" )",5);cout<<endl;}	
	if(man!=0){print("A/a: Adrenaline (",5);cout<<man;print(" )",5);cout<<endl;}	
	WHITE;cout<<"////////////////////////////////////////"<<endl<<endl; 
	if(dtn)choiiiii();
	return;
}
void shooot(){
	for(int qk=0;qk<5;qk++)cout<<"■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■"<<endl;
}
void shoooot(){
	for(int qk=0;qk<10;qk++)cout<<"■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■"<<endl;
}
void anounce(){
	memset(now,0,sizeof(now));
	int tur=0,turr=0;
	cout<<"\033[37m"<<endl;
	print("------------------------------------------Round:",0);cout<<' '<<rd<<endl<<endl;
	print("NEW TURN***************************",0);
	cout<<endl<<endl;
	while(mhp!=0&&dhp!=0){
		cout<<"\033[33m";
		if(tur==0)print("Now I loaded 3 bullets into the gun at random.",10);
		if(tur==0)cout<<endl;
		bullets();
		hp();
		if(tur%2==turr){
			char c;
			cout<<"\033[33m";
			cout<<endl;
			choi(rd,0);
			cout<<endl;
			YELLOW;
			print("Now it's YOUR turn:",10);WHITE;
			cout<<endl<<endl;
			cin>>c;
			cout<<endl;
			if(c=='s'||c=='S'){
				cout<<"\033[31m";
				choi(rd,1);
				cout<<endl;
				print("CHOOSE ONE TO SHOOT... :",20);
				cout<<endl;
				cin>>c;
				cout<<endl;
				RED;
				print("...",700);
				cout<<endl;
				if(c=='D'||c=='d'){
					if(f[tur+1]==1){
						p(1000);
						RED;
						shooot();
						p(2000);
						cout<<endl;
						now[tur+1]=1;
						rl--;
						dhp--;
						print("The bullet is REAL.",20);
						cout<<endl;
					}else{
						p(1000);
						BLUE;
						print("The bullet is FAKE.",20);
						fl--;
						now[tur+1]=-1;
						cout<<endl;
					}waitt();
					tur++;
				}else{
					if(f[tur+1]==1){
						p(1000);
						RED;
						shooot();
						p(2000);
						cout<<endl;
						now[tur+1]=1;
						rl--;
						mhp--;
						print("The bullet is REAL.",20);
						cout<<endl;
					}else{
						p(1000);
						BLUE;
						print("The bullet is FAKE.",20);
						fl--;
						now[tur+1]=-1;
						cout<<endl;
						turr++;turr%=2;
					}waitt();
					tur++;
				}
			}
	}
	else{
			YELLOW;
			print("Now it's my turn...",10);
			cout<<endl<<endl;
			print("Thinking",30);print("...",100);
			cout<<endl<<endl;
			WHITE;
			print("Dealer chooses to shoot.",10);
			cout<<endl<<endl;
			YELLOW;
			print("Thinking",30);print("...",100);
			cout<<endl<<endl;
			pro=(double)rl/(double)(rl+fl);
			if(pro>0.5){
				RED;
				print("DEALER CHOOSES TO SHOOT YOU:",10);
				cout<<endl<<endl;
				RED;
				print("...",700);
				if(f[tur+1]==1){
					p(1000);
					RED;
					cout<<endl;
					shooot();
					p(2000);
					cout<<endl;
					now[tur+1]=1;
					rl--;
					mhp--;
					print("The bullet is REAL.",20);
					cout<<endl;
				}else{
					p(1000);
					BLUE;
					cout<<endl;
					print("The bullet is FAKE.",20);
					fl--;
					now[tur+1]=-1;
					cout<<endl;
					turr++;
					turr%=2;
				}waitt();tur++;
			}else{
				WHITE;
				print("DEALER CHOOSES TO SHOOT HIMSELF:",10);
				cout<<endl<<endl;
				RED;
				print("...",700);
				if(f[tur+1]==1){
					p(1000);
					cout<<endl;
					RED;
					shooot();
					p(2000);
					cout<<endl;
					now[tur+1]=1;
					rl--;
					dhp--;
					print("The bullet is REAL.",20);
					cout<<endl;
				}else{
					p(1000);
					BLUE;
					cout<<endl;
					print("The bullet is FAKE.",20);
					fl--;
					now[tur+1]=-1;
					cout<<endl;
					turr++;
					turr%=2;
				}waitt();tur++;
			} 
		}
	}
	if(dhp==0){
		winner();
		return;
	}else{
		failure();
		return;
	}
}
void hardan(){
	
	WHITE;print("------------------------------------------Round:",0);cout<<' '<<rd<<endl<<endl;
	YELLOW;print("Let's play something more interesting...",20);cout<<endl<<endl;
	GREEN;cout<<"////////////////////////////////////////"<<endl; 
	print("Find(F/f): Get a tool at random.",5);cout<<endl;
	print("Magnifier(M/m): Use it to see if the next bullet is REAL or FAKE.",5);cout<<endl;
	print("Handcuffs(H/h): Use it to get an extra turn.(It can only be use once every turn)",5);cout<<endl;
	print("Cigarette(C/c): Use it to increase the health value.",5);cout<<endl;
	print("Knife(K/k): Use it to double the damage of the gun.",5);cout<<endl;
	print("Carbonated drinks(D/d): Use it to delete the next bullet.",5);cout<<endl;
	cout<<"////////////////////////////////////////"<<endl<<endl;
	YELLOW;print("Good Luck.",30);cout<<endl<<endl;
	
	//-----------------------------------------------------------------------------------------------------------------------------------//
	
	fn=2;rn=3;shn=5;shnn=0;rl=3;fl=2;mhp=5;dhp=5;mfindn=3;tot=1;
	bool tur=1;int turr=0;
	
	//-----------------------------------------------------------------------------------------------------------------------------------//
	
	while(mhp>0&&dhp>0){
		turr++;
		WHITE;print("NEW TURN***************************",0);cout<<endl<<endl;
		if(shnn==0){
			YELLOW;print("Now I loaded 5 bullets into the gun at random.",10);cout<<endl;
			memset(now,0,sizeof(now));
			int rdn=rand()%4+1;
			randd(5-rdn,rdn);
			shnn=5;rl=rdn;fl=5-rdn;rn=rdn;fn=5-rdn;
		}bullets();
		hp();

		mhb=1;dhb=1;mmhb=0;ddhb=0;mkb=0;dkb=0;mmkb=0;ddkb=0;
		
	//-----------------------------------------------------------------------------------------------------------------------------------//
		
		if(tur){
			
		mfindn=3;
		while(tur){
			turr++;
			if(shnn==0){
				cout<<endl;YELLOW;print("...",100);cout<<endl;
				print("The clip is empty.",10);cout<<endl<<endl;p(300);
				YELLOW;print("Now I loaded 5 bullets into the gun at random.",10);cout<<endl;
				memset(now,0,sizeof(now));
				int rdn=rand()%4+1;
				randd(5-rdn,rdn);
				shnn=5;rl=rdn;fl=5-rdn;rn=rdn;fn=5-rdn;bullets();hp();
				cout<<endl;
			}
			YELLOW;print("Now it's YOUR turn:",10);cout<<endl<<endl;
			choii();
			char c;cin>>c;cout<<endl;
			if(c=='s'||c=='S'){
				RED;choi(rd,1);cout<<endl;
				print("CHOOSE ONE TO SHOOT... :",20);cout<<endl;cin>>c;cout<<endl;
				RED;print("...",700);cout<<endl;
				if(f[tot]&&(c=='d'||c=='D')){
					p(1000);RED;shooot();p(2000);cout<<endl;
					now[tot]=1;rl--;tot++;shnn--;
					print("The bullet is REAL.",20);cout<<endl;p(700);
					if(mmkb){dhp-=2;mmkb=0;GREEN;print("The Knife has taken effect.",10);cout<<endl;shot++;}
					else dhp--;
					shot++;
					if(ddhb){tur=1;ddhb=0;cout<<endl;GREEN;print("The handcuffs have taken effect.",10);cout<<endl;WHITE;}
					else tur=0;
					if(tot==6)tot=1;
				}else if(f[tot]&&(c=='m'||c=='M')){
					p(1000);RED;shooot();p(2000);cout<<endl;
					now[tot]=1;rl--;tot++;shnn--;
					print("The bullet is REAL.",20);cout<<endl;p(700);
					if(mmkb){mhp-=2;mmkb=0;GREEN;print("The Knife has taken effect.",10);cout<<endl;mis++;}
					else mhp--;
					mis++;
					if(ddhb){tur=1;ddhb=0;cout<<endl;GREEN;print("The handcuffs have taken effect.",10);cout<<endl;WHITE;}
					else tur=0;
					if(tot==6)tot=1;
				}else if(!f[tot]&&(c=='m'||c=='M')){
					suc++;
					p(1000);BLUE;print("The bullet is FAKE.",20);cout<<endl;p(700);
					fl--;now[tot]=-1;tot++;shnn--;tur=1;
					if(mmkb){mmkb=0;cout<<endl;GREEN;print("The gun has recovered.",10);WHITE;mis++;}
					if(tot==6)tot=1;
				}else if(!f[tot]&&(c=='d'||c=='D')){
					mis++;
					p(1000);BLUE;print("The bullet is FAKE.",20);cout<<endl;p(700);
					fl--;now[tot]=-1;tot++;shnn--;
					if(mmkb){mmkb=0;cout<<endl;GREEN;print("The gun has recovered.",10);WHITE;mis++;}
					if(ddhb){tur=1;ddhb=0;cout<<endl;GREEN;print("The handcuffs have taken effect.",10);cout<<endl;WHITE;}
					else tur=0;
					if(tot==6)tot=1;
				}
			}else if((c=='M'||c=='m')&&mn!=0){
				tool++;
				cout<<endl;GREEN;print("...",700);cout<<endl;
				if(f[tot]==1){GREEN;print("The next bullet is ",10);RED;print("REAL.",20);cout<<endl;WHITE;}
				if(f[tot]==0){GREEN;print("The next bullet is ",10);BLUE;print("FAKE.",20);cout<<endl;WHITE;}
				mn--;
			}else if((c=='h'||c=='H')&&hn!=0&&mhb){
				tool++;
				WHITE;print("You've used the handcuffs.",10);cout<<endl;
				hn--;mhb=0;ddhb=1;
			}else if((c=='h'||c=='H')&&hn!=0&&!mhb){
				RED;print("Warning : You can't use it twice.",10);cout<<endl;WHITE;
			}else if((c=='c'||c=='C')&&cn!=0){
				cn--;mhp++;GREEN;print("You increased your health value.",10);WHITE;cout<<endl;tool++;
			}else if((c=='k'||c=='K')&&kn!=0){
				cout<<endl;
				if(mmkb){RED;print("Warning : You can't use it twice.",10);WHITE;cout<<endl;}
				else{kn--;mmkb=1;GREEN;print("You've used the knife",10);WHITE;cout<<endl;tool++;}
			}else if((c=='d'||c=='D')&&dn!=0){
				cout<<endl;dn--;tool++;
				GREEN;print("...",700);cout<<endl;
				if(f[tot]){
					now[tot]=1;
					rl--;shnn--;tot++;
					if(tot==6)tot=1;
					print("You've deleted the next bullet , which is ",10);
					RED;print("REAL.",20);cout<<endl;WHITE;
				}else{
					now[tot]=-1;
					fl--;shnn--;tot++;
					if(tot==6)tot=1;
					print("You've deleted the next bullet , which is ",10);
					BLUE;print("FAKE.",20);cout<<endl;WHITE;
				}
			}else if((c=='f'||c=='F')&&mfindn==3){
				GREEN;print("Finding...",100);cout<<endl;
				for(int kk=0;kk<3;kk++){
					int num=rand()%5;
					p(300);
					if(num==0){
						mn++;
						GREEN;print("You've got a Magnifier.",10);
						cout<<endl;WHITE;
					}if(num==1){
						hn++;
						GREEN;print("You've got a Handcuffs.",10);
						cout<<endl;WHITE;
					}if(num==2){
						cn++;
						GREEN;print("You've got a Cigarette.",10);
						cout<<endl;WHITE;
					}if(num==3){
						kn++;
						GREEN;print("You've got a Knife.",10);
						cout<<endl;WHITE;
					}if(num==4){
						dn++;
						GREEN;print("You've got a Carbonated drink.",10);
						cout<<endl;WHITE;
					}
				}mfindn=0;
			}
		}
		
		}
		
	//-----------------------------------------------------------------------------------------------------------------------------------//

		else{
			ddhb=1;mhb=0;ddkb=1;mkb=0;
			
			YELLOW;print("Now it's MY turn:",10);cout<<endl<<endl;
			thinking();
			YELLOW;print("Dealer chooses to ",20);PURPLE;print("FIND.",20);cout<<endl;
			for(int i=0;i<3;i++){
				int num=rand()%5;p(200);
				if(num==0){
					dmn++;
					PURPLE;print("Dealer has got a Magnifier.",10);
					cout<<endl;WHITE;
				}if(num==1){
					dhn++;
					PURPLE;print("Dealer has got a Handcuffs.",10);
					cout<<endl;WHITE;
				}if(num==2){
					dcn++;
					PURPLE;print("Dealer has got a Cigarette.",10);
					cout<<endl;WHITE;
				}if(num==3){
					dkn++;
					PURPLE;print("Dealer has got a Knife.",10);
					cout<<endl;WHITE;
				}if(num==4){
					ddn++;
					PURPLE;print("Dealer has got a Carbonated drink.",10);
					cout<<endl;WHITE;
				}
			}
			choiii();
			//-----------------------------------------------------------------------------------------------------------------------------------//
			while(tur==0){
				if(shnn==0){
						cout<<endl;YELLOW;print("...",10);
						print("The clip is empty.",10);cout<<endl<<endl;p(300);
						YELLOW;print("Now I loaded 5 bullets into the gun at random.",10);cout<<endl;
						memset(now,0,sizeof(now));
						int rdn=rand()%4+1;
						randd(5-rdn,rdn);
						shnn=5;rl=rdn;fl=5-rdn;rn=rdn;fn=5-rdn;bullets();hp();
						cout<<endl;
				}
				thinking();
				while(dcn&&dhp<=5){
					dcn--;dhp++;
					PURPLE;print("Dealer chooses to use Cigarette to recover the health value.",10);cout<<endl;
					thinking();
				}while(dhn&&ddhb){
					ddhb=0;dhn--;mhb=1;
					PURPLE;print("Dealer chooses to use Handcuffs to prohibit you for one turn.",10);cout<<endl;
					thinking();
				}pro=(double)rl/(double)shnn;
				while(pro>=0.3&&pro<=0.7&&rand()%2==0&&ddn>0){
					if(shnn==0){
						cout<<endl;YELLOW;print("...",10);cout<<endl;
						print("The clip is empty.",10);cout<<endl<<endl;p(300);
						YELLOW;print("Now I loaded 5 bullets into the gun at random.",10);cout<<endl;
						memset(now,0,sizeof(now));
						int rdn=rand()%4+1;
						randd(5-rdn,rdn);
						shnn=5;rl=rdn;fl=5-rdn;rn=rdn;fn=5-rdn;bullets();hp();
						cout<<endl;
						YELLOW;print("Now it's MY turn:",10);cout<<endl;
					}
					PURPLE;print("Dealer chooses to use the Carbonated drink to delete the next bullet.",10);cout<<endl;
					WHITE;print("...",200);cout<<endl<<endl;
					if(f[tot]==1){
						now[tot]=1;tot++;rl--;shnn--;
						PURPLE;print("Dealer deletes the next bullet which is ",10);
						RED;print("REAL.",30);cout<<endl;
						pro=(double)rl/(double)shnn;
						if(tot==6)tot=1;
					}else{
						now[tot]=-1;tot++;fl--;shnn--;
						PURPLE;print("Dealer deletes the next bullet which is ",10);
						BLUE;print("FAKE.",30);cout<<endl;
						pro=(double)rl/(double)shnn;
						if(tot==6)tot=1;
					}ddn--;
					thinking();
				}pro=(double)rl/(double)shnn;
				if(dmn&&pro!=1&&pro!=0){
					PURPLE;print("Dealer chooses to use the Magnifier...",10);cout<<endl;
					if(f[tot]==1)pro=1;
					else pro=0;
					YELLOW;print("...",300);print(" Interesting ...",30);cout<<endl;
					dmn--;
					thinking();
				}if(pro==1&&dkn>0){
					RED;print("Dealer chooses to use Knife to double the damage of the gun...",30);cout<<endl;
					mkb=1;dkn--;
				}cout<<endl;
				thinking();
				WHITE;print("The Dealer chooses to shoot.",10);cout<<endl<<endl;
				if(pro>0.5){
					RED;print("The Dealer chooses to shoot YOU...",20);cout<<endl<<endl;
					print("...",700);cout<<endl;
					if(f[tot]==1){
						p(1000);RED;shooot();p(2000);cout<<endl;
						now[tot]=1;rl--;tot++;shnn--;
						print("The bullet is REAL.",20);cout<<endl;p(700);
						if(mkb){
							mhp-=2;RED;print("The Knife has taken effect...",20);cout<<endl;mkb=0;hurts++;
						}else mhp--;
						p(800);hurts++;
						if(mhb){
							tur=0;PURPLE;print("The handcuffs have taken effect.",10);cout<<endl;mhb=0;
						}else tur=1;
						if(tot==6)tot=1;
					}else{
						p(1000);BLUE;print("The bullet is FAKE.",20);cout<<endl;p(700);
						fl--;now[tot]=-1;tot++;shnn--;
						if(mkb){
							PURPLE;print("The gun has,recovered.",20);cout<<endl;mkb=0;
						}if(mhb){
							PURPLE;print("The handcuffs have taken effect.",20);cout<<endl;mhb=0;tur=0;
						}else tur=1;
					}if(tot==6)tot=1;
				}else{
					WHITE;print("Dealer chooses to shoot HIMSELF.",10);cout<<endl;
					RED;print("...",700);cout<<endl;
					if(f[tot]==1){
						p(1000);RED;shooot();p(2000);cout<<endl;
						now[tot]=1;rl--;tot++;shnn--;
						print("The bullet is REAL.",20);cout<<endl;p(700);
						if(mkb){
							dhp-=2;RED;print("The Knife has taken effect...",20);cout<<endl;mkb=0;
						}else dhp--;
						p(800);
						if(mhb){
							tur=0;PURPLE;print("The handcuffs have taken effect.",10);cout<<endl;mhb=0;
						}else tur=1;
						if(tot==6)tot=1;
					}else{
						p(1000);BLUE;print("The bullet is FAKE.",20);cout<<endl;p(700);
						fl--;now[tot]=-1;tot++;shnn--;
						if(mkb){
							PURPLE;print("The gun has,recovered.",20);cout<<endl;mkb=0;
						}tur=0;
					}if(tot==6)tot=1;
				}
			}
		}WHITE;print("Counting",10);print("...",100);cout<<endl;
		WHITE;print("NEXT TURN***************************",0);cout<<endl<<endl;
	}if(mhp==0){
		failure();
		ffff=0;
		return;
	}else{
		winner();
		return;
	}
}
void final(){
	
	WHITE;print("- ------ -------- --------- ------ - ------- - ---Round:",0);cout<<' '<<rd<<endl<<endl;
	RED;print("Fear filled your heart",50);cout<<endl;
	YELLOW;print("Final round...",50);cout<<endl;
	YELLOW;print("Seize the opportunity...",50);cout<<endl<<endl;
	GREEN;cout<<"////////////////////////////////////////"<<endl; 
	print("Find(F/f): Get a tool at random.",5);cout<<endl;
	print("Magnifier(M/m): Use it to see if the next bullet is REAL or FAKE.",5);cout<<endl;
	print("Handcuffs(H/h): Use it to get an extra turn.(It can only be use once every turn)",5);cout<<endl;
	print("Cigarette(C/c): Use it to increase the health value.",5);cout<<endl;
	print("Knife(K/k): Use it to double the damage of the gun.",5);cout<<endl;
	print("Carbonated drinks(D/d): Use it to delete the next bullet.",5);cout<<endl;
	print("Phone(P/p): Use it to determine whether all bullets except for the next one are real or fake at random.",5);cout<<endl;
	print("Expired pills(E/e): 60% chance of recovering one unit of blood, 40% chance of losing one unit of blood.",5);cout<<endl;
	print("Converter(V/v): Convert the authenticity of the next bullet.",5);cout<<endl;
	print("Adrenaline(A/a): Randomly steal one of the opponent's props.",5);cout<<endl;
	GREEN;cout<<"////////////////////////////////////////"<<endl<<endl;
	WHITE;print("Press any key to confirm.",5);cout<<endl;
	string ssss;cin>>ssss;cout<<endl;
	RED;print("DIE",100);cout<<endl<<endl;
	
	//-----------------------------------------------------------------------------------------------------------------------------------//
	
	dmn=0;dhn=0;dcn=0;dkn=0;ddn=0;dpn=0;den=0;dvn=0;dan=0;
	mn=0;hn=0;cn=0;kn=0;dn=0;mpn=0;men=0;mvn=0;man=0;
	mtn=0;dtn=0;
	mhp=10;dhp=10;mfindn=4;tot=1;shn=7;shnn=0;
	bool tur=1;int turr=0;
	
	//-----------------------------------------------------------------------------------------------------------------------------------//
	
	while(mhp>0&&dhp>0){
		
		turr++;
		WHITE;print("NEW TURN************ ***** ********* ****** ******* *** *******",0);cout<<endl<<endl;
		if(shnn==0){
			memset(proo,-1,sizeof(proo));
			YELLOW;print("Now I loaded 7 bullets into the gun at random.",10);cout<<endl;
			memset(now,0,sizeof(now));
			int rdn=rand()%6+1;
			randd(7-rdn,rdn);
			shnn=7;rl=rdn;fl=7-rdn;rn=rdn;fn=7-rdn;
		}bullets();
		hp();

		mhb=1;dhb=1;mmhb=0;ddhb=0;mkb=0;dkb=0;mmkb=0;ddkb=0;
		
	//-----------------------------------------------------------------------------------------------------------------------------------//
		
		if(tur){
			
		mfindn=4;
		while(tur&&mhp>0){
			turr++;
			if(shnn==0){
				memset(proo,-1,sizeof(proo));
				cout<<endl;RED;print("...",100);cout<<endl;
				print("The clip is empty.",10);cout<<endl<<endl;p(300);
				YELLOW;print("Now I loaded 7 bullets into the gun at random.",10);cout<<endl;
				memset(now,0,sizeof(now));
				int rdn=rand()%6+1;
				randd(7-rdn,rdn);
				shnn=7;rl=rdn;fl=7-rdn;rn=rdn;fn=7-rdn;bullets();hp();
				cout<<endl;
			}
			WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
			YELLOW;print("Now it's YOUR turn:",10);cout<<endl<<endl;
			choiiii();
			char c;cin>>c;cout<<endl;
			if(c=='s'||c=='S'){
				RED;choi(rd,1);cout<<endl;
				print("CHOOSE ONE TO SHOOT... :",20);cout<<endl;cin>>c;cout<<endl;
				RED;print("...",700);cout<<endl;
				if(f[tot]&&(c=='d'||c=='D')){
					p(1000);RED;
					if(dhp==1||(dhp==2&&mmkb))shoooot();
					else shooot();
					p(2000);cout<<endl;
					now[tot]=1;rl--;tot++;shnn--;
					print("The bullet is REAL.",20);cout<<endl;p(700);
					if(mmkb){dhp-=2;mmkb=0;GREEN;print("The Knife has taken effect.",10);cout<<endl;shot++;}
					else dhp--;
					shot++;
					if(ddhb){tur=1;ddhb=0;cout<<endl;GREEN;print("The handcuffs have taken effect.",10);cout<<endl;WHITE;}
					else tur=0;
					if(tot==8)tot=1;
				}else if(f[tot]&&(c=='m'||c=='M')){
					p(1000);RED;shooot();p(2000);cout<<endl;
					now[tot]=1;rl--;tot++;shnn--;
					print("The bullet is REAL.",20);cout<<endl;p(700);
					if(mmkb){mhp-=2;mmkb=0;GREEN;print("The Knife has taken effect.",10);cout<<endl;mis++;}
					else mhp--;
					mis++;
					if(ddhb){tur=1;ddhb=0;cout<<endl;GREEN;print("The handcuffs have taken effect.",10);cout<<endl;WHITE;}
					else tur=0;
					if(tot==8)tot=1;
				}else if(!f[tot]&&(c=='m'||c=='M')){
					suc++;
					p(1000);BLUE;print("The bullet is FAKE.",20);cout<<endl;p(700);
					fl--;now[tot]=-1;tot++;shnn--;tur=1;
					if(mmkb){mmkb=0;cout<<endl;GREEN;print("The gun has recovered.",10);WHITE;mis++;}
					if(tot==8)tot=1;
				}else if(!f[tot]&&(c=='d'||c=='D')){
					mis++;
					p(1000);BLUE;print("The bullet is FAKE.",20);cout<<endl;p(700);
					fl--;now[tot]=-1;tot++;shnn--;
					if(mmkb){mmkb=0;cout<<endl;GREEN;print("The gun has recovered.",10);WHITE;mis++;}
					if(ddhb){tur=1;ddhb=0;cout<<endl;GREEN;print("The handcuffs have taken effect.",10);cout<<endl;WHITE;}
					else tur=0;
					if(tot==8)tot=1;
				}
			}else if((c=='M'||c=='m')&&mn!=0){
				mtn--;tool++;
				cout<<endl;GREEN;print("...",700);cout<<endl;
				if(f[tot]==1){GREEN;print("The next bullet is ",10);RED;print("REAL.",20);cout<<endl;WHITE;}
				if(f[tot]==0){GREEN;print("The next bullet is ",10);BLUE;print("FAKE.",20);cout<<endl;WHITE;}
				mn--;
			}else if((c=='h'||c=='H')&&hn!=0&&mhb){
				mtn--;tool++;
				GREEN;print("You've used the handcuffs.",10);cout<<endl;
				hn--;mhb=0;ddhb=1;
			}else if((c=='h'||c=='H')&&hn!=0&&!mhb){
				RED;print("Warning : You can't use it twice.",10);cout<<endl;WHITE;
			}else if((c=='c'||c=='C')&&cn!=0){
				tool++;
				cn--;mhp++;GREEN;print("You increased your health value.",10);WHITE;cout<<endl;mtn--;
			}else if((c=='k'||c=='K')&&kn!=0){
				cout<<endl;
				if(mmkb){RED;print("Warning : You can't use it twice.",10);WHITE;cout<<endl;}
				else{kn--;mmkb=1;GREEN;print("You've used the knife",10);WHITE;cout<<endl;mtn--;tool++;}
			}else if((c=='d'||c=='D')&&dn!=0){
				cout<<endl;dn--;
				mtn--;tool++;
				GREEN;print("...",700);cout<<endl;
				if(f[tot]){
					now[tot]=1;
					rl--;shnn--;tot++;
					if(tot==8)tot=1;
					print("You've deleted the next bullet , which is ",10);
					RED;print("REAL.",20);cout<<endl;WHITE;
				}else{
					now[tot]=-1;
					fl--;shnn--;tot++;
					if(tot==8)tot=1;
					print("You've deleted the next bullet , which is ",10);
					BLUE;print("FAKE.",20);cout<<endl;WHITE;
				}
			}else if((c=='e'||c=='E')&&men>0){
				cout<<endl;men--;mtn--;tool++;
				GREEN;print("You've taken this pill...",10);cout<<endl<<endl;
				WHITE;print("...",700);p(50);cout<<endl<<endl;
				int nnn=rand()%5;
				p(300);
				if(nnn<3){
					GREEN;print("The pill has taken effect.",5);cout<<endl;suc++;
					mhp++;
				}else{
					mhp--;
					RED;mis++;hurts++;
					cout<<"&^#$%@^*&^%$#^*&(*&^%$#!@$!%"<<endl;p(10);
					cout<<"^*&(*&^%$#!@$!%"<<endl;p(20);
					cout<<"!@@#$@!$~!~&^#$%@^*&^%$#^*&(*&^%$#!@$!%"<<endl;
					cout<<"&^#$%@^*&^()%$^%$#@#!!~+_%$#^*&(*&^%$#!@$!;'.,'%"<<endl;
					cout<<"&^%$!%f]]\{<$#"<<endl;p(10);
					cout<<"{}<>:$>#@%%&^%#@$%%@!!~!#%$@*&%^%<"<<endl;p(200);
					cout<<endl;print("You regret it for this...",20);cout<<endl<<endl;
				}
			}else if((c=='p'||c=='P')&&mpn>0){
				mpn--;mtn--;tool++;
				int nnn=tot;
				while(nnn==tot){nnn=rand()%7+1;}
				GREEN;print("Dialing...",20);p(100);cout<<endl<<endl;
				INDIGO;print("The ",5);print(reff[nnn-1],5);print(" bullet is ",5);
				if(f[nnn]){RED;print("REAL.",5);cout<<endl;}
				else{BLUE;print("FAKE.",5);cout<<endl;}
				cout<<endl;
			}else if((c=='V'||c=='v')&&mvn>0){
				mvn--;mtn--;tool++;
				for(int iiii=0;iiii<6;iiii++){
					if(iiii%2==0){
						BLUE;cout<<"■";p(10);
					}else{
						RED;cout<<"■";p(10);
					}
				}cout<<endl;
				GREEN;print("You've used the Converter.",5);cout<<endl;
				if(f[tot]){f[tot]=0;rl--;fl++;}
				else{f[tot]=1;rl++;fl--;}
			}else if((c=='A'||c=='a')&&man>0&&dtn>0){
				man--;tool++;
				int q[1005],to=1;
				for(int i=0;i<dcn;i++)q[to++]=1;
				for(int i=0;i<ddn;i++)q[to++]=2;
				for(int i=0;i<dmn;i++)q[to++]=3;
				for(int i=0;i<dhn;i++)q[to++]=4;
				for(int i=0;i<dkn;i++)q[to++]=5;
				for(int i=0;i<dpn;i++)q[to++]=6;
				for(int i=0;i<den;i++)q[to++]=7;
				for(int i=0;i<dan;i++)q[to++]=8;
				for(int i=0;i<dvn;i++)q[to++]=9;
				int nnn=rand()%dtn+1;
				GREEN;print("You've used the Adrenaline :",5);cout<<endl;
				print("...",60);cout<<endl;
				if(q[nnn]==1){
					dcn--;cn++;
					print("You stole dealer's Cigarette.",5);cout<<endl;
				}if(q[nnn]==2){
					ddn--;dn++;
					print("You stole dealer's Carbonated drink.",5);cout<<endl;
				}if(q[nnn]==3){
					dmn--;mn++;
					print("You stole dealer's Magnifier.",5);cout<<endl;
				}if(q[nnn]==4){
					dhn--;hn++;
					print("You stole dealer's Handcuffs.",5);cout<<endl;
				}if(q[nnn]==5){
					dkn--;kn++;
					print("You stole dealer's Knife.",5);cout<<endl;
				}if(q[nnn]==6){
					dpn--;mpn++;
					print("You stole dealer's Phone.",5);cout<<endl;
				}if(q[nnn]==7){
					den--;men++;
					print("You stole dealer's Expired pills.",5);cout<<endl;
				}if(q[nnn]==8){
					dan--;man++;
					print("You stole dealer's Adrenaline.",5);cout<<endl;
				}if(q[nnn]==9){
					dvn--;mvn++;
					print("You stole dealer's Converter.",5);cout<<endl;
				}dtn--;
			}else if((c=='A'||c=='a')&&man>0&&dtn<=0){
				RED;print("WARNING: Dealer has no tools to steal.",5);cout<<endl<<endl;
			}
			else if((c=='f'||c=='F')&&mfindn==4){
				mtn+=4;
				GREEN;print("Finding...",100);cout<<endl;
				for(int kk=0;kk<4;kk++){
					int num=rand()%9;
					p(300);
					if(num==0){
						mn++;
						GREEN;print("You've got a Magnifier.",10);
						cout<<endl;WHITE;
					}if(num==1){
						hn++;
						GREEN;print("You've got a Handcuffs.",10);
						cout<<endl;WHITE;
					}if(num==2){
						cn++;
						GREEN;print("You've got a Cigarette.",10);
						cout<<endl;WHITE;
					}if(num==3){
						kn++;
						GREEN;print("You've got a Knife.",10);
						cout<<endl;WHITE;
					}if(num==4){
						dn++;
						GREEN;print("You've got a Carbonated drink.",10);
						cout<<endl;WHITE;
					}if(num==5){
						mpn++;
						GREEN;print("You've got a Phone.",10);
						cout<<endl;WHITE;
					}if(num==6){
						men++;
						GREEN;print("You've got an Expired pills.",10);
						cout<<endl;WHITE;
					}if(num==7){
						man++;
						GREEN;print("You've got an Adrenaline.",10);
						cout<<endl;WHITE;
					}if(num==8){
						mvn++;
						GREEN;print("You've got a Converter.",10);
						cout<<endl;WHITE;
					}
				}mfindn=0;
			}
		}
		
		}
		
	//-----------------------------------------------------------------------------------------------------------------------------------//

		else{
			ddhb=1;mhb=0;ddkb=1;mkb=0;
			
			WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
			YELLOW;print("Now it's MY turn:",10);cout<<endl<<endl;
			thinking();
			YELLOW;print("Dealer chooses to ",20);PURPLE;print("FIND.",20);cout<<endl;
			dtn+=4;
			for(int i=0;i<4;i++){
				int num=rand()%9;p(200);
				if(num==0){
					dmn++;
					PURPLE;print("Dealer has got a Magnifier.",10);
					cout<<endl;WHITE;
				}if(num==1){
					dhn++;
					PURPLE;print("Dealer has got a Handcuffs.",10);
					cout<<endl;WHITE;
				}if(num==2){
					dcn++;
					PURPLE;print("Dealer has got a Cigarette.",10);
					cout<<endl;WHITE;
				}if(num==3){
					dkn++;
					PURPLE;print("Dealer has got a Knife.",10);
					cout<<endl;WHITE;
				}if(num==4){
					ddn++;
					PURPLE;print("Dealer has got a Carbonated drink.",10);
					cout<<endl;WHITE;
				}if(num==5){
					dpn++;
					PURPLE;print("Dealer has got a Phone.",10);
					cout<<endl;WHITE;
				}if(num==6){
					dvn++;
					PURPLE;print("Dealer has got a Converter.",10);
					cout<<endl;WHITE;
				}if(num==7){
					dan++;
					PURPLE;print("Dealer has got an Adrenaline.",10);
					cout<<endl;WHITE;
				}if(num==8){
					den++;
					PURPLE;print("Dealer has got an Expired pills.",10);
					cout<<endl;WHITE;
				}
			}WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
			choiiiii();
			WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
			//-----------------------------------------------------------------------------------------------------------------------------------//
			while(tur==0){
				if(shnn==0){
						memset(proo,-1,sizeof(proo));
						cout<<endl;YELLOW;print("...",10);
						print("The clip is empty.",10);cout<<endl<<endl;p(300);
						YELLOW;print("Now I loaded 7 bullets into the gun at random.",10);cout<<endl;
						memset(now,0,sizeof(now));
						int rdn=rand()%6+1;
						randd(7-rdn,rdn);
						shnn=7;rl=rdn;fl=7-rdn;rn=rdn;fn=7-rdn;bullets();hp();
						cout<<endl;
				}
				thinking();
				while(dan>0&&mtn>0){
					dan--;
					PURPLE;print("Dealer chooses to use Adrenaline.",5);cout<<endl;
					print("...",70);cout<<endl;
					int q[1005],to=1;
					for(int i=0;i<cn;i++)q[to++]=1;
					for(int i=0;i<dn;i++)q[to++]=2;
					for(int i=0;i<mn;i++)q[to++]=3;
					for(int i=0;i<hn;i++)q[to++]=4;
					for(int i=0;i<kn;i++)q[to++]=5;
					for(int i=0;i<mpn;i++)q[to++]=6;
					for(int i=0;i<men;i++)q[to++]=7;
					for(int i=0;i<man;i++)q[to++]=8;
					for(int i=0;i<mvn;i++)q[to++]=9;
					int nnn=rand()%mtn+1;
					if(q[nnn]==1){
						cn--;dcn++;
						print("Dealer stole your Cigarette.",5);cout<<endl;
					}if(q[nnn]==2){
						dn--;ddn++;
						print("Dealer stole your Carbonated drink.",5);cout<<endl;
					}if(q[nnn]==3){
						mn--;dmn++;
						print("Dealer stole your Magnifier.",5);cout<<endl;
					}if(q[nnn]==4){
						hn--;dhn++;
						print("Dealer stole your Handcuffs.",5);cout<<endl;
					}if(q[nnn]==5){
						kn--;dkn++;
						print("Dealer stole your Knife.",5);cout<<endl;
					}if(q[nnn]==6){
						mpn--;dpn++;
						print("Dealer stole your Phone.",5);cout<<endl;
					}if(q[nnn]==7){
						men--;den++;
						print("Dealer stole your Expired pills.",5);cout<<endl;
					}if(q[nnn]==8){
						man--;dan++;
						print("Dealer stole your Adrenaline.",5);cout<<endl;
					}if(q[nnn]==9){
						mvn--;dvn++;
						print("Dealer stole your Converter.",5);cout<<endl;
					}mtn--;
					WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
					thinking();
				}
				while(dcn){
					dcn--;dhp++;dtn--;
					PURPLE;print("Dealer chooses to use Cigarette to recover the health value.",10);cout<<endl;
					WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
					thinking();
				}while(den&&dhp>=2&&dhp<=5){
					den--;dtn--;
					PURPLE;print("Dealer chooses to take the Expired pills.",10);cout<<endl;
					print("...",700);cout<<endl;
					int nnn=rand()%5;
					p(300);
					if(nnn<3){
						PURPLE;print("The pill has taken effect.",5);cout<<endl;
						dhp++;
					}else{
						dhp--;
						RED;
						cout<<"&^#$%@^*&^%$#^*&(*&^%$#!@$!%"<<endl;p(10);
						cout<<"^*&(*&^%$#!@$!%"<<endl;p(20);
						cout<<"!@@#$@!$~!~&^#$%@^*&^%$#^*&(*&^%$#!@$!%"<<endl;
						cout<<"&^#$%@^*&^()%$^%$#@#!!~+_%$#^*&(*&^%$#!@$!;'.,'%"<<endl;
						cout<<"&^%$!f]]\{<$#"<<endl;p(10);
						cout<<"{}<>:$>#@%%&^%#@$%%@!!~!#%$@*&%^%<"<<endl;p(200);
						cout<<endl;YELLOW;print("Congratulations...",20);cout<<endl<<endl;
					}if(dhp==0){
						winnner();
						exit(0);
					}WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
					thinking();
				}
				while(dhn&&ddhb){
					dtn--;
					ddhb=0;dhn--;mhb=1;
					PURPLE;print("Dealer chooses to use Handcuffs to prohibit you for one turn.",10);cout<<endl;
					WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
					thinking();
				}pro=(double)rl/(double)shnn;
				while(pro>=0.3&&pro<=0.7&&rand()%2==0&&ddn>0){
					dtn--;
					if(shnn==0){
						WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
						memset(proo,-1,sizeof(proo));
						cout<<endl;YELLOW;print("...",10);cout<<endl;
						print("The clip is empty.",10);cout<<endl<<endl;p(300);
						YELLOW;print("Now I loaded 5 bullets into the gun at random.",10);cout<<endl;
						memset(now,0,sizeof(now));
						int rdn=rand()%4+1;
						randd(5-rdn,rdn);
						shnn=5;rl=rdn;fl=5-rdn;rn=rdn;fn=5-rdn;bullets();hp();
						cout<<endl;
						YELLOW;print("Now it's MY turn:",10);cout<<endl;
					}
					PURPLE;print("Dealer chooses to use the Carbonated drink to delete the next bullet.",10);cout<<endl;
					WHITE;print("...",200);cout<<endl<<endl;
					if(f[tot]==1){
						now[tot]=1;tot++;rl--;shnn--;
						PURPLE;print("Dealer deletes the next bullet which is ",10);
						RED;print("REAL.",30);cout<<endl;
						pro=(double)rl/(double)shnn;
						if(tot==6)tot=1;
					}else{
						now[tot]=-1;tot++;fl--;shnn--;
						PURPLE;print("Dealer deletes the next bullet which is ",10);
						BLUE;print("FAKE.",30);cout<<endl;
						pro=(double)rl/(double)shnn;
						if(tot==6)tot=1;
					}ddn--;
					WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
					thinking();
				}for(int o=tot;o<=7;o++){
					if(proo[o]!=1&&proo!=0){
						proo[o]=(double)rl/(double)shnn;
					}
				}
				pro=proo[tot];
				while(dpn&&tot<=3&&pro!=0&&pro!=1){
					dtn--;dpn--;
					PURPLE;print("Dealer chooses to use the Phone.",5);cout<<endl;
					print("Dialing...",30);cout<<endl;
					int nnn=tot;
					while(nnn==tot){nnn=rand()%7+1;}
					INDIGO;print("The @#$ bullet is ^$#^?^...",10);cout<<endl;p(50);
					YELLOW;print("...Interesting...",20);cout<<endl;
					if(f[nnn]){proo[nnn]=1;}
					else proo[nnn]=0;
					WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
					thinking();
				}
				if(dmn&&pro!=1&&pro!=0){
					dtn--;
					PURPLE;print("Dealer chooses to use the Magnifier...",10);cout<<endl;
					if(f[tot]==1)pro=1;
					else pro=0;
					YELLOW;print("...",300);print(" Interesting ...",30);cout<<endl;
					dmn--;
					WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
					thinking();
				}if(pro<=0.3&&dvn>0){
					dvn--;dtn--;
					for(int iiii=0;iiii<6;iiii++){
						if(iiii%2==0){
							BLUE;cout<<"■";p(10);
						}else{
							RED;cout<<"■";p(10);
						}
					}cout<<endl;	
					PURPLE;print("Dealer chooses to use the Converter.",5);cout<<endl;
					pro=1-pro;
					if(f[tot]){
						f[tot]=0;
						rl--;fl++;
					}else{
						f[tot]=1;
						rl++;fl--;
					}WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
					thinking();
				}
				if(pro==1&&dkn>0){
					dtn--;
					RED;print("Dealer chooses to use Knife to double the damage of the gun...",30);cout<<endl;
					mkb=1;dkn--;WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;thinking();
				}cout<<endl;
				
				WHITE;print("The Dealer chooses to shoot.",10);cout<<endl<<endl;
				if(pro>0.5){
					RED;print("The Dealer chooses to shoot YOU...",20);cout<<endl<<endl;
					print("...",700);cout<<endl;
					if(f[tot]==1){
						p(1000);RED;shooot();p(2000);cout<<endl;
						now[tot]=1;rl--;tot++;shnn--;
						print("The bullet is REAL.",20);cout<<endl;p(700);
						if(mkb){
							mhp-=2;RED;print("The Knife has taken effect...",20);cout<<endl;mkb=0;hurts++;
						}else mhp--;
						hurts++;
						p(800);
						if(mhb){
							tur=0;PURPLE;print("The handcuffs have taken effect.",10);cout<<endl;mhb=0;
						}else tur=1;
						if(tot==8)tot=1;
					}else{
						p(1000);BLUE;print("The bullet is FAKE.",20);cout<<endl;p(700);
						fl--;now[tot]=-1;tot++;shnn--;
						if(mkb){
							PURPLE;print("The gun has,recovered.",20);cout<<endl;mkb=0;
						}if(mhb){
							PURPLE;print("The handcuffs have taken effect.",20);cout<<endl;mhb=0;tur=0;
						}else tur=1;
					}if(tot==8)tot=1;
				}else{
					WHITE;print("Dealer chooses to shoot HIMSELF.",10);cout<<endl;
					RED;print("...",700);cout<<endl;
					if(f[tot]==1){
						p(1000);RED;shooot();p(2000);cout<<endl;
						now[tot]=1;rl--;tot++;shnn--;
						print("The bullet is REAL.",20);cout<<endl;p(700);
						if(mkb){
							dhp-=2;RED;print("The Knife has taken effect...",20);cout<<endl;mkb=0;
						}else dhp--;
						p(800);
						if(mhb){
							tur=0;PURPLE;print("The handcuffs have taken effect.",10);cout<<endl;mhb=0;
						}else tur=1;
						if(tot==8)tot=1;
					}else{
						p(1000);BLUE;print("The bullet is FAKE.",20);cout<<endl;p(700);
						fl--;now[tot]=-1;tot++;shnn--;
						if(mkb){
							PURPLE;print("The gun has,recovered.",20);cout<<endl;mkb=0;
						}tur=0;
					}if(tot==8)tot=1;
				}WHITE;cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl;
			}
		}WHITE;print("Counting",10);print("...",100);cout<<endl;
		WHITE;print("NEXT TURN************ ***** ********* ****** ******* *** *******",0);cout<<endl<<endl;
	}if(mhp==0){
		failure();
		ffff=0;
		return;
	}else{
		winnner();
		return;
	}
}
int main(){
	srand(static_cast<unsigned int>(time(0)));
	cout<<"\033[37m";
	string s[6]={"Press","a","to","start","the","game:"};
	pprint(s,6,30);
	string x;
	scanf("%s",&x);
	while(fffff){
		hurts=0;shot=0;suc=0;tool=0;mis=0;
		system("cls");
		init();
		for(rd=1;rd<=3;rd++){
			system("cls");
			if(rd==1){randd(2,1);fn=2;rn=1;shn=3;rl=1;fl=2;}
			if(rd==1)anounce();
			else if(rd==2)hardan();
			else if(rd==3)final();
			if(ffff==0)return 0;
		}
	}
	return 0;
} 

欢迎建议与反馈

原文