本次更新改动不是很大!
不说了上代码,想要之前的版本去我的个人主页找!
https://blog.csdn.net/fjhfjj?type=blog
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
#include<sstream>
#include<windows.h>
#include<bits/stdc++.h>
using namespace std;
int cnt=0,things[10000000];
struct Peo{
int jb=3,hs=5,sm=50,cjj=2;
}m;
void sb(){
CONSOLE_CURSOR_INFO cursor_info = { 1,0 };
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}
int bas=0;
void Loading(){
for(int i=1;i<=5;i++){
cout<<"Loading";
for(int i=1;i<=3;i++){
cout<<".";
Sleep(500);
}
cout<<"\n";
srand(time(0));
int loading=rand()%3;
if(loading==1){
cout<<"多打怪,加伤害!";
}
if(loading==2){
cout<<"打怪加生命!";
}
if(loading==3){
cout<<"开始游戏会有2张抽奖劵!";
}
if(loading==0){
cout<<"慢慢来,不要慌!";
}
Sleep(500);
system("cls");
}
}
void texiao(){
for(int i=1; i<=10; i++)
{
system("color 2f");
Sleep(10);
system("color 0f");
Sleep(10);
}
system("color f2");
}
void dazi(string s){
for(int i=0;i<s.size();i++){
//TODO
cout<<s[i];
Sleep(30);
}
}
bool judge_num(string num)
{
int i,k=0;
int xs[18]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
char x[11]={'1','0','X','9','8','7','6','5','4','3','2'};
for(i=0;i<17;i++)
k+=(num[i]-'0')*xs[i];
k%=11;
return (x[k]==num[17]);
}
void cls(){
system("cls");
}
void ss(){
srand(time(0));
}
int main(){
//cmd窗口最大化控制
HWND hwnd=GetForegroundWindow();//使hwnd代表最前端的窗口
Sleep(1000);
ShowWindow(hwnd,SW_MAXIMIZE);//最大化 hwnd 所代表的窗口
//打怪小游戏
//fjh出品
sb();
system("title 打怪小游戏&&color f2&&color B2&&color 23&&color f0&&color B2&&color 23&&color f0");
cout<<"\n\n\n\n\n\n\n\n\n\n\n 打怪小游戏";
Sleep(2000);
cls();
cout<<"\n\n\n\n\n\n\n\n\n\n\n fjh出品";
Sleep(2000);
cls();
cout<<"\n\n\n\n\n\n\n\n\n\n\n 健康游戏忠告:"<<endl<<"\n 抵制不良游戏,拒绝盗版游戏。"<<endl<<"\n 注意自我保护,谨防受骗上当。"<<endl<<"\n 适度游戏益脑,沉迷游戏伤身。"<<endl<<"\n 合理安排时间,享受健康生活。";
Sleep(5000);
cls();
printf("根据国家要求,你需要经过实名注册才能进入游戏!\n");
printf("请输入姓名:");
string num,namename;
cin>>namename;
printf("请输入身份证号码:");
cin>>num;
things[199]=judge_num(num);
if(things[199]==0){
printf("输入有误,无法进入!\n");
return 0;
}
cls();
Loading();
cls();
sb();
cout<<"加载完毕!";
Sleep(1000);
cls();
dazi("打怪游戏1.1.8版本");
Sleep(1000);
cls();
dazi("游戏暂无存档,预计1.5.0版本添加存档");
Sleep(1000);
cls();
cls();
sb();
dazi("欢迎您!请输入游戏姓名:");
cin>>num;
cls();
dazi("欢迎玩家");
dazi(num);
Sleep(1000);
cls();
char aaaaa;
dazi("是否观看剧情?(y/n)");
cin>>aaaaa;
switch (aaaaa) {
case 'y':
//TODO
dazi("在一个古老的村庄\n");
dazi("里面的人们生活的十分幸福\n然而有一天\n村子里突然传来一阵巨响\n一群怪兽从土里钻了出来\n但\n一位勇士愿意去消灭他们!\n那个勇士就是:");
for(int i=0;i<num.size();i++){
cout<<num[i];
texiao();
Sleep(500);
}
Sleep(1000);
cls();
dazi("勇士,加油吧!游戏开始了!");
Sleep(1000);
break;
case 'n':
break;
}
start:
cls();
cout<<"__________________________________\n";
cout<<"| 要干什么 |\n";
cout<<"|1.打怪 2.抽奖 3.商店 4.查看状态|\n";
cout<<"|5.退出游戏 6.外挂 7.关注作者|\n";
cout<<"| 8.大礼包 |\n";
cout<<"|________________________________|\n";
dazi("请输入:");
int as;
cin>>as;
if(as==8&&bas==0){
cls();
cout<<"领取成功!";
Sleep(1000);
m.hs+=20;
m.jb+=30;
m.cjj+=3;
m.sm+=20;
bas=1;
goto start;
cls();
}
if(as==8&&bas!=0){
cls();
cout<<"你已经领取过了!!!";
Sleep(1090);
cls();
}
if(as==7){
cls();
dazi("跳转中......");
system("start https://blog.csdn.net/fjhfjj?type=blog");
cls();
dazi("运行结束");
return 0;
}
switch (as) {
case 1:
cls();
dazi("您遇到了:");
int ssss;
srand(time(0));
ssss=rand()%5+1;
int gwsm;
int shsh;
if(ssss==1){
//gwsm=30;
//shsh=10;
srand(time(0));
gwsm=rand()%40+30;
ss();
shsh=rand()%15+10;
}
if(ssss==2){
//gwsm=60;
//shsh=20;
srand(time(0));
gwsm=rand()%60+50;
ss();
shsh=rand()%20+15;
}
if(ssss==3){
//gwsm=120;
//shsh=40;
srand(time(0));
gwsm=rand()%120+115;
ss();
shsh=rand()%40+35;
}
if(ssss==4){
gwsm=240;
shsh=80;
}
if(ssss==5){
//gwsm=480;
//shsh=100;
srand(time(0));
gwsm=rand()%480+478;
ss();
shsh=rand()%100+90;
}
cout<<ssss;
dazi("级怪兽\n");
dazi("是否应战(y/n)");
char aaaa;
cin>>aaaa;
if(aaaa=='y'){
while(gwsm>0&&m.sm>0){
//TO
cls();
dazi("你发起进攻,怪物扣血");
cout<<m.hs;
dazi("颗血,剩");
gwsm-=m.hs;
cout<<gwsm;
dazi("颗血\n");
if(gwsm<=0){
break;
}
dazi("怪物发起进攻,你扣血");
cout<<shsh;
dazi("颗血,剩");
m.sm-=shsh;
cout<<m.sm;
dazi("颗血\n");
}
if(gwsm<=0){
cls();
dazi("YOU WIN!\n");
dazi("血量+20\n");
m.sm+=20;
dazi("伤害+10\n");
m.hs+=10;
dazi("金币+10\n");
m.jb+=10;
dazi("奖券+1\n");
m.cjj+=1;
system("pause");
goto start;
}
else{
cls();
dazi("YOU LOSE!");
system("pause");
dazi("重生中......");
m.hs=5;
m.sm=5;
m.cjj=1;
m.jb=0;
}
}
else{
goto start;
}
//TODO
break;
case 2:
cls();
dazi("抽几次?\n当前");
cout<<m.cjj;
dazi("张奖券");
int bbb;
cin>>bbb;
if(m.cjj>=bbb&&bbb!=0){
cls();
cout<<"您获得了:";
srand(time(0));
int rrrr=rand()%50+1*bbb;
cout<<rrrr<<"枚金币";
m.jb+=rrrr;
m.cjj-=bbb;
Sleep(1000);
goto start;
}
else{
cls();
cout<<"操作失败!";
goto start;
}
//TODO
break;
case 3:
scan:
cls();
dazi("欢迎来到fjh可爱的小店呀!物美价廉!\n");
cout<<"1.木剑 伤害+5 免费赠送\n";
cout<<"2.铁剑 伤害+10 2元\n";
cout<<"3.钛合金剑 伤害+20 4元\n";
Sleep(1000);
dazi("嘿嘿~!接下来的东西可就不便宜了哟!");
cout<<"\n4.金剑 伤害+40 10元";
cout<<"\n5.钻石剑 伤害+60 20元";
cout<<"\n6.光刀 伤害+80 30元";
cout<<"\n7.暗影剑 伤害+100 50元";
cout<<"\n8.魔剑 伤害+130 60元(~特价~)";
cout<<"\n9.毁灭剑 伤害+180 100元";
cout<<"\n11.普通急救包 血量+5 1元";
cout<<"\n12.中等急救包 血量+15 5元";
cout<<"\n13.希沃白板 血量+30 15元";
cout<<"\n14.希沃白板5 血量+50 25元";
cout<<"\n15.合肥市亳州路小学 血量+70 40元";
cout<<"\n16.网红手打柠檬茶 血量+90 55元";
cout<<"\n17.fjh的黑暗料理 血量+200 80元";
cout<<"\n18.fjh的三体 血量+300 100元";
cout<<"\n10.退出\n";
cout<<"当前:"<<m.jb<<"颗金币";
dazi("请选择:");
int vvv;
cin>>vvv;
switch (vvv) {
case 1:
cls();
m.hs+=5;
//TODO
dazi("购买成功!");
Sleep(1000);
goto scan;
break;
case 2:
cls();
if(m.jb>=2){
cout<<"购买成功!";
Sleep(1000);
m.jb-=2;
m.hs+=10;
}
else{
dazi("购买失败!");
}
//TODO
goto scan;
break;
case 3:
cls();
if(m.jb>=4){
cout<<"购买成功!";
m.jb-=4;
m.hs+=20;
}
else{
dazi("购买失败!");
}
goto scan;
break;
case 4:
cls();
if(m.jb>=10){
cout<<"购买成功!";
m.jb-=10;
m.hs+=40;
}
else{
dazi("购买失败!");
}
goto scan;
break;
case 5:
cls();
if(m.jb>=20){
cout<<"购买成功!";
m.jb-=20;
m.hs+=60;
}
else{
dazi("购买失败!");
}
goto scan;
break;
case 6:
cls();
if(m.jb>=30){
cout<<"购买成功!";
m.jb-=30;
m.hs+=80;
}
else{
dazi("购买失败!");
}
goto scan;
break;
case 7:
cls();
if(m.jb>=50){
cout<<"购买成功!";
m.jb-=50;
m.hs+=100;
}
else{
dazi("购买失败!");
}
goto scan;
break;
case 8:
cls();
if(m.jb>=60){
cout<<"购买成功!";
m.jb-=60;
m.hs+=130;
}
else{
dazi("购买失败!");
}
goto scan;
break;
case 9:
cls();
if(m.jb>=100){
cout<<"购买成功!";
m.jb-=100;
m.hs+=180;
}
else{
dazi("购买失败!");
}
goto scan;
break;
case 10:
cls();
goto start;
case 11:
if(m.jb>=1){
m.jb-=1;
m.sm+=5;
dazi("购买成功!");
Sleep(1000);
goto scan;
}
else{
dazi("购买失败!");
Sleep(1000);
goto scan;
}
break;
case 12:
if(m.jb>=5){
m.jb-=5;
m.sm+=15;
dazi("购买成功!");
Sleep(1000);
goto scan;
}
else{
dazi("购买失败!");
Sleep(1000);
goto scan;
}
break;
case 13:
if(m.jb>=15){
m.jb-=15;
m.sm+=30;
dazi("购买成功!");
Sleep(1000);
goto scan;
}
else{
dazi("购买失败!");
Sleep(1000);
goto scan;
}
break;
case 14:
if(m.jb>=25){
m.jb-=25;
m.sm+=50;
dazi("购买成功!");
Sleep(1000);
goto scan;
}
else{
dazi("购买失败!");
Sleep(1000);
goto scan;
}
break;
case 15:
if(m.jb>=40){
m.jb-=40;
m.sm+=70;
dazi("购买成功!");
Sleep(1000);
goto scan;
}
else{
dazi("购买失败!");
Sleep(1000);
goto scan;
}
break;
case 16:
if(m.jb>=55){
m.jb-=55;
m.sm+=90;
dazi("购买成功!");
Sleep(1000);
goto scan;
}
else{
dazi("购买失败!");
Sleep(1000);
goto scan;
}
break;
case 17:
if(m.jb>=80){
m.jb-=80;
m.sm+=200;
dazi("购买成功!");
Sleep(1000);
goto scan;
}
else{
dazi("购买失败!");
Sleep(1000);
goto scan;
}
break;
case 18:
if(m.jb>=100){
m.jb-=100;
m.sm+=300;
dazi("购买成功!");
Sleep(1000);
goto scan;
}
else{
dazi("购买失败!");
Sleep(1000);
goto scan;
}
break;
}
cls();
goto start;
case 4:
cls();
cout<<"当前金币:"<<m.jb<<"\n";
cout<<"当前生命:"<<m.sm<<"\n";
cout<<"当前攻击:"<<m.hs<<"\n";
cout<<"当前奖券:"<<m.cjj<<"\n";
system("pause");
goto start;
break;
case 5:
cls();
dazi("游戏退出中");
for(int i=0;i<=5;i++){
//TODO
cout<<".";
Sleep(1000);
}
return 0;
case 6:
cls();
dazi("请输入密码:");
string sssss;
cin>>sssss;
if(sssss=="QWQfjh"){
cls();
dazi("尊敬的用户,请享受我们的五星级外挂服务!!!!!");
texiao();
cls();
m.hs+=1000000;
m.jb+=1000000;
m.cjj+=1000000;
m.sm+=1000000;
for(int i=0;i<=30;i++){
cout<<"伤害增加中,已完成("<<i<<"/30)";
Sleep(1);
cls();
}
for(int i=31;i<=60;i++){
cout<<"血量增加中,已完成("<<i<<"/60)";
Sleep(1);
cls();
}
for(int i=61;i<=80;i++){
cout<<"抽奖劵增加中,已完成("<<i<<"/80)";
Sleep(1);
cls();
}
for(int i=81;i<=100;i++){
cout<<"金币增加中,已完成("<<i<<"/100)";
Sleep(1);
cls();
}
dazi("尊敬的的用户,您已是VIP了!!!");
Sleep(1000);
cls();
}
else{
cls();
dazi("AH-OH!密码错误!!!");
Sleep(1000);
}
goto start;
break;
}
goto start;
return 0;
}