一个小游戏(devc++14)(原创)(半成品)v1.2
【代码】一个小游戏(devc++14)(原创)
·
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
#pragma warning(disable:4996)
struct wanjia {
long long HP = 200, qian = 15000, mutouxiaofang = 0, jiaoqugaolou = 0, shiqugaolou, xiaobieshu, dabieshu, gongdian, zixingche, dianpingche, xiaojiaoche, tesila, laosilaisihuanyin, sirenfeiji, renzaoweixing;
bool vip = false, checkmubiao[100];
} wanjia_;
bool flag = true;
void start();//准备界面
void shop();//商店
void bag();//背包
void manghe();//盲盒
void house();//房子
void car();//车
void jingyan();//经验
void chaozhilibao();//礼包
void makemoney();//赚钱
void makemoney2(int);//赚钱
void mubiao();//目标
void VIP();//vip
int main() {
if (wanjia_.qian >= 10000000000000) {
printf("恭喜胜利!\n");
freopen("win.txt", "w", stdin);
return 0;
}
if (flag == true) {
start();
flag = false;
}
string c;
int a;
printf("钱数达到1e+13(10000000000000)即可胜利\n");
printf("1、商店\n");
printf("2、背包\n");
printf("3、赚钱\n");
printf("4、盲盒\n");
printf("5、读取生成码(VIP专用)\n");
printf("6、目标\n");
cin >> a;
if (a == 1) {
system("cls");
shop();
} else if (a == 2) {
system("cls");
bag();
} else if (a == 3) {
system("cls");
makemoney();
} else if (a == 4) {
system("cls");
manghe();
} else if (a == 5) {
system("cls");
if (wanjia_.vip == true) {
printf("读取生成码:");
cin >> c;
if (c == "tyhyhyp}?(1314.)") {
system("cls");
printf("读取成功!\n");
wanjia_.qian = 1.5e+12;
wanjia_.HP = 5.4e+11;
wanjia_.sirenfeiji = 2;
wanjia_.dabieshu = 3;
Sleep(1000);
system("cls");
main();
} else if (c == "[long]pop.##a") {
printf("读取成功!\n");
wanjia_.qian = 1e+10;
wanjia_.HP = 1e+13;
wanjia_.renzaoweixing = 2;
wanjia_.jiaoqugaolou = 30;
wanjia_.tesila = 6;
Sleep(1000);
system("cls");
main();
} else if (c == "max?生成码kill") {
} else {
printf("读取失败!\n");
Sleep(1000);
system("cls");
main();
}
} else {
printf("你还没有VIP!\n");
Sleep(1000);
system("cls");
main();
}
} else if (a == 6) {
system("cls");
mubiao();
} else {
system("cls");
main();
}
}
void start() {
system("color 9f");
system("title 一个游戏");
printf("tyhyhyp} 制作 改编请标明原作者[:)]\n");
Sleep(1000);
system("cls");
cout << "(Game will launch in 5)" << endl;
Sleep(1000);
system("cls");
cout << "(Game will launch in 4)" << endl;
Sleep(1000);
system("cls");
cout << "(Game will launch in 3)" << endl;
Sleep(1000);
system("cls");
cout << "(Game will launch in 2)" << endl;
Sleep(1000);
system("cls");
cout << "(Game will launch in 1)" << endl;
Sleep(1000);
system("cls");
}
void shop() {
int a;
cout << "钱:" << wanjia_.qian << ' ' << "经验:" << wanjia_.HP << endl;
printf("0、退出\n");
printf("1、房子\n");
printf("2、车\n");
printf("3、经验\n");
printf("4、超值礼包\n");
printf("5、VIP\n");
cin >> a;
if (a == 0) {
system("cls");
main();
}
if (a == 1) {
system("cls");
house();
}
if (a == 2) {
system("cls");
car();
}
if (a == 3) {
system("cls");
jingyan();
}
if (a == 4) {
system("cls");
chaozhilibao();
} else if (a == 5) {
system("cls");
VIP();
} else {
system("cls");
main();
}
}
void house() {
int a;
printf("0、退出\n");
printf("1、木头小房(10000元,100经验)\n");
printf("2、郊区高楼(450000元,1000经验)\n");
printf("3、市区高楼(2000000元,10000经验)\n");
printf("4、小别墅(10000000元,75000经验)\n");
printf("5、大别墅(30000000元,500000经验)\n");
printf("6、宫殿(1.5亿元,30000000经验)\n");
cin >> a;
if (a == 0) {
system("cls");
main();
}
if (a == 1) {
if (wanjia_.HP >= 100 && wanjia_.qian >= 10000) {
wanjia_.qian -= 10000;
wanjia_.mutouxiaofang += 1;
wanjia_.HP += 100;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 2) {
if (wanjia_.HP >= 1000 && wanjia_.qian >= 450000) {
wanjia_.qian -= 450000;
wanjia_.jiaoqugaolou += 1;
wanjia_.HP += 1000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 3) {
if (wanjia_.HP >= 10000 && wanjia_.qian >= 2000000) {
wanjia_.qian -= 2000000;
wanjia_.shiqugaolou += 1;
wanjia_.HP += 10000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 4) {
if (wanjia_.HP >= 75000 && wanjia_.qian >= 10000000) {
wanjia_.qian -= 10000000;
wanjia_.xiaobieshu += 1;
wanjia_.HP += 75000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 5) {
if (wanjia_.HP >= 500000 && wanjia_.qian >= 30000000) {
wanjia_.qian -= 30000000;
wanjia_.dabieshu += 1;
wanjia_.HP += 500000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 6) {
if (wanjia_.HP >= 30000000 && wanjia_.qian >= 150000000) {
wanjia_.qian -= 150000000;
wanjia_.gongdian += 1;
wanjia_.HP += 30000000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else {
system("cls");
main();
}
}
void car() {
int a;
printf("0、退出\n");
printf("1、自行车(1000元,50经验)\n");
printf("2、电瓶车(5000元,250经验)\n");
printf("3、小轿车(100000元,5000经验)\n");
printf("4、特斯拉(1000000元,25000经验)\n");
printf("5、劳斯莱斯幻影(5000000元,300000经验)\n");
printf("6、私人飞机(1.5亿元,2000000经验)\n");
printf("7、人造卫星(120亿元,1亿经验)\n");
cin >> a;
if (a == 0) {
system("cls");
main();
} else if (a == 1) {
if (wanjia_.HP >= 50 && wanjia_.qian >= 1000) {
wanjia_.qian -= 1000;
wanjia_.zixingche += 1;
wanjia_.HP += 50;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 2) {
if (wanjia_.HP >= 250 && wanjia_.qian >= 5000) {
wanjia_.qian -= 5000;
wanjia_.dianpingche += 1;
wanjia_.HP += 250;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 3) {
if (wanjia_.HP >= 5000 && wanjia_.qian >= 100000) {
wanjia_.qian -= 100000;
wanjia_.xiaojiaoche += 1;
wanjia_.HP += 5000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 4) {
if (wanjia_.HP >= 25000 && wanjia_.qian >= 1000000) {
wanjia_.qian -= 1000000;
wanjia_.tesila += 1;
wanjia_.HP += 25000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 5) {
if (wanjia_.HP >= 300000 && wanjia_.qian >= 5000000) {
wanjia_.qian -= 5000000;
wanjia_.laosilaisihuanyin += 1;
wanjia_.HP += 300000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 6) {
if (wanjia_.HP >= 2000000 && wanjia_.qian >= 150000000) {
wanjia_.qian -= 150000000;
wanjia_.sirenfeiji += 1;
wanjia_.HP += 2000000;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else if (a == 7) {
if (wanjia_.HP >= 100000000 && wanjia_.qian >= 12000000000) {
wanjia_.qian -= 12000000000;
wanjia_.renzaoweixing += 1;
wanjia_.HP += 250;
cout << "购买成功!" << endl;
Sleep(1000);
system("cls");
main();
}
cout << "钱数/经验不足!" << endl;
Sleep(1000);
system("cls");
main();
} else {
system("cls");
main();
}
}
void jingyan() {
int a;
printf("0、退出\n");
printf("三元钱换一经验\n");
cin >> a;
if (a == 0) {
system("cls");
main();
}
if (a * 3 <= wanjia_.qian) {
wanjia_.qian -= a * 3;
wanjia_.HP += a;
printf("购买成功!\n");
Sleep(1000);
system("cls");
main();
} else {
printf("钱数不足!\n");
Sleep(1000);
main();
}
}
void chaozhilibao() {
int a;
printf("0、退出\n");
printf("1、50经验,1个随机红包(0~40000元)(10000元)\n");
printf("2、300经验,5个随机红包(0~40000元),一个矿场体验券(75000元)\n");
cin >> a;
if (a == 0) {
system("cls");
main();
}
if (a == 1) {
if (wanjia_.qian >= 10000) {
wanjia_.qian -= 10000;
srand((unsigned)time(NULL));
wanjia_.HP += 100;
wanjia_.qian += rand();
printf("购买成功!\n");
Sleep(1000);
system("cls");
main();
}
printf("钱数不足!\n");
Sleep(1000);
main();
}
if (a == 2) {
if (wanjia_.qian >= 75000) {
srand((unsigned)time(NULL));
wanjia_.qian -= 75000;
wanjia_.HP += 300;
wanjia_.qian += rand() * 5;
printf("购买成功!\n");
Sleep(1000);
system("cls");
main();
}
printf("钱数不足!\n");
Sleep(1000);
main();
} else {
system("cls");
main();
}
}
void bag() {
int a;
cout << "输入0退出" << endl << "钱:" << wanjia_.qian << endl << "经验:" << wanjia_.HP << endl << "木头小房:" << wanjia_.mutouxiaofang << endl << "郊区高楼:" << wanjia_.jiaoqugaolou << endl << "市区高楼:" << wanjia_.shiqugaolou << endl << "小别墅:" << wanjia_.xiaobieshu << endl << "大别墅:" << wanjia_.dabieshu << endl << "宫殿:" << wanjia_.gongdian << endl << "自行车:" << wanjia_.zixingche << endl << "电瓶车:" << wanjia_.dianpingche << endl << "小轿车:" << wanjia_.xiaojiaoche << endl << "特斯拉:" << wanjia_.tesila << endl << "劳斯莱斯幻影:" << wanjia_.laosilaisihuanyin << endl << "私人飞机:" << wanjia_.sirenfeiji << endl << "人造卫星:" << wanjia_.renzaoweixing << endl;
cin >> a;
if (a == 0) {
system("cls");
main();
} else {
system("cls");
main();
}
}
void makemoney() {
int a;
printf("赚钱速度:HP/100/s\n");
printf("输入赚钱次数:");
cin >> a;
system("cls");
makemoney2(a);
}
void makemoney2(int a) {
long long b = wanjia_.qian;
while (a != 0) {
cout << "已赚钱:" << wanjia_.qian - b << "元" << endl;
Sleep(1000);
a--;
wanjia_.qian += wanjia_.HP / 100;
system("cls");
}
system("cls");
main();
}
void manghe() {
int a;
printf("0、退出\n");
printf("1、盲盒(10000元,100经验)\n");
cin >> a;
if (a == 0) {
system("cls");
main();
}
if (a == 1) {
if (wanjia_.qian >= 10000 && wanjia_.HP >= 100) {
srand((unsigned)time(NULL));
wanjia_.qian -= 10000;
wanjia_.qian += rand();
printf("购买成功!\n");
Sleep(1000);
system("cls");
main();
}
printf("钱数/经验不足\n");
Sleep(1000);
system("cls");
main();
} else {
system("cls");
main();
}
}
void mubiao() {
int a;
if (wanjia_.checkmubiao[0] == false)
if (wanjia_.zixingche >= 1) {
wanjia_.checkmubiao[0] = true;
wanjia_.qian += 100;
}
if (wanjia_.checkmubiao[1] == false)
if (wanjia_.dianpingche >= 1) {
wanjia_.checkmubiao[1] = true;
wanjia_.qian += 300;
}
if (wanjia_.checkmubiao[2] == false)
if (wanjia_.mutouxiaofang >= 1) {
wanjia_.checkmubiao[2] = true;
wanjia_.qian += 1500;
}
if (wanjia_.checkmubiao[3] == false)
if (wanjia_.qian >= 50000) {
wanjia_.checkmubiao[3] = true;
wanjia_.HP += 300;
}
if (wanjia_.checkmubiao[4] == false)
if (wanjia_.xiaojiaoche >= 1) {
wanjia_.checkmubiao[4] = true;
wanjia_.qian += 3500;
wanjia_.HP += 500;
}
if (wanjia_.checkmubiao[5] == false)
if (wanjia_.jiaoqugaolou >= 1) {
wanjia_.checkmubiao[5] = true;
wanjia_.qian += 10000;
wanjia_.HP += 2000;
}
if (wanjia_.checkmubiao[6] == false)
if (wanjia_.tesila >= 1) {
wanjia_.checkmubiao[6] = true;
wanjia_.qian += 40000;
wanjia_.HP += 10000;
}
if (wanjia_.checkmubiao[7] == false)
if (wanjia_.tesila >= 1) {
wanjia_.checkmubiao[7] = true;
wanjia_.HP += 12000;
}
printf("按0退出\n");
printf("1、购买一辆自行车(奖励:100元)\t");
if (wanjia_.checkmubiao[0] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[0] == 1)printf("(已完成)\n");
printf("2、购买一辆电瓶车(奖励:300元)\t");
if (wanjia_.checkmubiao[1] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[1] == 1)printf("(已完成)\n");
printf("3、购买一栋木头小房(奖励:1500元)\t");
if (wanjia_.checkmubiao[2] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[2] == 1)printf("(已完成)\n");
printf("4、钱数到达50000(奖励:300经验)\t");
if (wanjia_.checkmubiao[3] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[3] == 1)printf("(已完成)\n");
printf("5、购买一辆小轿车(奖励:3500元,500经验)\t");
if (wanjia_.checkmubiao[4] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[4] == 1)printf("(已完成)\n");
printf("6、买一间郊区高楼的房(奖励:10000元,2000经验)\t");
if (wanjia_.checkmubiao[5] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[5] == 1)printf("(已完成)\n");
printf("7、买一辆特斯拉(奖励:40000元,10000经验)\t");
if (wanjia_.checkmubiao[6] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[6] == 1)printf("(已完成)\n");
printf("8、钱数到达1500000(奖励:12000经验)\t");
if (wanjia_.checkmubiao[7] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[7] == 1)printf("(已完成)\n");
printf("9、(设计中...)\t");
if (wanjia_.checkmubiao[8] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[8] == 1)printf("(已完成)\n");
printf("10、(设计中...)\t");
if (wanjia_.checkmubiao[9] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[9] == 1)printf("(已完成)\n");
printf("11、(设计中...)\t");
if (wanjia_.checkmubiao[10] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[10] == 1)printf("(已完成)\n");
printf("12、(设计中...)\t");
if (wanjia_.checkmubiao[11] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[11] == 1)printf("(已完成)\n");
printf("13、(设计中...)\t");
if (wanjia_.checkmubiao[12] == 0)printf("(未完成)\n");
else if (wanjia_.checkmubiao[12] == 1)printf("(已完成)\n");
cin >> a;
system("cls");
main();
}
void VIP() {
int a;
printf("0、退出\n");
printf("1、VIP(100000000元,100000000经验)\n");
cin >> a;
if (a == 1) {
if (wanjia_.qian >= 100000000 && wanjia_.HP >= 100000000) {
printf("购买成功!\n");
wanjia_.qian -= 100000000;
wanjia_.vip = true;
Sleep(1000);
system("cls");
main();
} else {
printf("钱数/经验不足!\n");
Sleep(1000);
system("cls");
main();
}
} else {
Sleep(1000);
system("cls");
main();
}
}
点个赞呗~
更多推荐
已为社区贡献1条内容
所有评论(0)