跳到正文

休闲·娱乐

暴打DemonPlayer

Snow_WoIf约 10 分钟
原文
文章信息与版本

文章信息

发布
2024年11月20日
收录
2025年12月12日
更新
2026年11月13日
篇幅
约 10 分钟
获赞
1

版本

  1. v1当前

发布新游戏:暴打DemonPlayer 欢迎在下方留言提建议

C++
#include<bits/stdc++.h>
#include<windows.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
void coutt(string s) {
	for (int i = 0; i < s.size(); i++) {
		cout << s[i];
		Sleep(100 / 2 / 2 / 2);
	}
}
void SCAB(int ForgC, int BackC) {
	WORD wColor = ((BackC & 0x0F) << 4) + (ForgC & 0x0F);
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), wColor);
}
void shuoming1(){
	cout<<"                                        ";
	cout<<"┌────────────────────────────────┐";
	cout<<endl;
	cout<<"                                        ";
	cout<<"│         §爆率增加10%§        │";
	cout<<endl;
	cout<<"                                        ";
	cout<<"└────────────────────────────────┘";
}
void shuoming2(){
	cout<<"                                        ";
	coutt("┌────────────────────────────────┐");
	cout<<endl;
	cout<<"                                        ";
	coutt("│         §爆率增加10%§        │");
	cout<<endl;
	cout<<"                                        ";
	coutt("│                                │");
	cout<<endl;
	cout<<"                                        ";
	coutt("│   详情,请按y查看,否则请按下n  │");
	cout<<endl;
	cout<<"                                        ";
	coutt("└────────────────────────────────┘");
	cout<<endl;
	char a;
	while(cin>>a){
		if(a=='y'||a=='n'){
			if(a=='y'){
				system("cls");
				cout<<"                                        ";
				coutt("┌─────────────────────────────────────────────────┐");
				cout<<endl;
				cout<<"                                        ";
				coutt("│                 §爆率增加20%§                 │");
				cout<<endl;
				cout<<"                                        ";
				coutt("│                                                 │");
				cout<<endl;
				cout<<"                                        ";
				coutt("│ 爆率:及你在攻打DemonPlayer时,可以成的一个倍数 │");
				cout<<endl;
				cout<<"                                        ";
				coutt("└─────────────────────────────────────────────────┘");
				Sleep(2500);
				system("cls");
			}else if(a=='n'){
				system("cls");
			}
			return;
		}else{
			SCAB(4,0);	
			coutt("输入错误请重新输入");
			cout<<endl;
			SCAB(7,0);
			system("cls");
			cout<<"                                        ";
			cout<<"┌────────────────────────────────┐";
			cout<<endl;
			cout<<"                                        ";
			cout<<"│         §爆率增加10%§        │";
			cout<<endl;
			cout<<"                                        ";
			cout<<"│                                │";
			cout<<endl;
			cout<<"                                        ";
			cout<<"│   详情,请按y查看,否则请按下n  │";
			cout<<endl;
			cout<<"                                        ";
			cout<<"└────────────────────────────────┘";
			cout<<endl;
		}
	}
	return;
}
int main() {
	std::default_random_engine e;
	e.seed(time(0));
	int xue = 1000;
	SCAB(4,3);
	coutt("────────────────────────────────────────────────暴打DemonPlayer────────────────────────────────────────────────");
	Sleep(100);
	SCAB(7,0);
	cout << "                                                         ";
	SCAB(7,6);
	cout<<"按空格键开始游戏";
	while (KEY_DOWN(' ') == 0) {
		
	}
	system("cls");
	SCAB(7,0);
	int ab = 0;
	cout << "暴打DemonPlayer" << endl;
	cout << "DemonPlayer:" << xue << endl;
	bool op=false;
	while (xue > 0) {
		if (KEY_DOWN(' ')) {
			system("color 4F");
			system("cls");
			ab++;
			cout << "暴打DemonPlayer" << endl;
			cout << "DemonPlayer:" << xue << endl;
			int a = e() % 100, bao = e() % 7, baoji = 1;
			if (bao != 0&&bao!=3) {
				cout << endl;
				cout << "DemonPlayer扣了" << a*baoji << "滴血" << endl;
				Sleep(500 / 2 / 2);
				xue -= a * baoji;
				cout << "还剩" << xue << "滴血";
			}else if(bao==3){
				system("cls");
				system("color 0F");
				if(op==1){
					shuoming1();
					Sleep(1000);
					system("cls");
					cout << "暴打DemonPlayer" << endl;
					cout << "DemonPlayer:" << xue << endl;
				} 
				else{
					shuoming2();
					op=1;
					cout << "暴打DemonPlayer" << endl;
					cout << "DemonPlayer:" << xue << endl;
				}
				baoji+=2;
				
			} else {
				cout << endl;
				cout << "DemonPlayer生气了回了" << a << "滴血"<<endl;
				Sleep(500 / 2 / 2);
				xue += a;
				cout << "还剩" << xue << "滴血";
			}
			system("color 0F");
		}
	}
	system("color F5");
	for (int i = 0; i < 1000 + 7; i++) {
		cout << "YOU WIN!!!";
	}
	Sleep(500);
	//system("color 0F");
	return 0;
}
/*
  符号	表示颜色	符号	表示颜色
  0	      黑色	      8	      灰色
  1	      蓝色	      9	     淡蓝色
  2	      绿色	      A	     淡绿色
  3	     浅绿色	      B	    淡浅绿色
  4	      红色	      C	     淡红色
  5	      紫色	      D	     淡紫色
  6	      黄色	      E	     淡黄色
  7	      白色	      F	     亮白色
 */
/*
  /0 = 黑色
  1 = 蓝色
  2 = 绿色
  3 = 湖蓝色
  4 = 红色
  5 = 紫色
  6 = 黄色
  7 = 白色
  8 = 灰色
  9 = 亮蓝色
  10= 绿色
  11= 蓝绿色
  12= 嫩红色
  13= 嫩紫色
  14= 高亮嫩黄色 
  15= 超高高量白黄色 */
原文