#include <iostream>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include <Windows.h>
#include<iostream>
#include<windows.h>
#include<Mmsystem.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
void Welcome()
{
cout << "欢迎来到“杀手狙击“小游戏!" << endl;
cout << "我是你的教官-阿尔希!" << endl;
Sleep(3000);
system("cls");
}
int main()
{
PlaySound(L"Alan Walker,A$AP Rocky - Live Fast.wav", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);
system("color F2");
SetWindowTextA(GetConsoleWindow(), "杀手狙击");
string value_level[19] = { "列兵","上等兵","下士","中士","上士","四级军士长","三级军士长","二级军士长","一级军士长","少尉","中尉","上尉","少校","中校","上校","大校","少将","中将","上将" };
int attack;
int money;
int hp;
int maxhp;
int defence;
int level;
char name[1000];
int sum;
int year, month;
long long aimy;
int temp;
int PHEA;
bool VIP;
int Resurrectioncard;
int Goldcoindoublecard;
bool jihuo;
ifstream infile;
infile.open("save.txt", ios::in);
if (infile.is_open())
{
cout << "有可读取文件!" << endl;
system("pause");
for (int i = 0; i < 10; i++)
{
cout << "读取中。。。" << endl;
system("cls");
}
cout << "读取完毕!" << endl;
cout << "欢迎在一次来到了“杀手狙击小游戏”!" << endl;
system("pause");
system("cls");
infile >> attack >> defence >> hp >> maxhp >> money >> level >> year >> month >> name >> aimy >> sum >> VIP >> Resurrectioncard >> PHEA >> Goldcoindoublecard >> jihuo;
infile.close();
system("pause");
}
else
{
cout << "请保证您有Microsoft Edge浏览器,否则无法浏览下面网址!" << endl;
cout << "请输入激活密匙!" << endl;
WinExec("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://i.loli.net/2020/06/27/Cp3Iaqg4j2ZBoPE.jpg ", SW_MAXIMIZE);
cout << "如果您已完成支付,请您加qq3013159445,备注:验证信息:我是买家——来买东西,发送支付截图,我将会给您激活密匙!并说明开通业务!" << endl;
string n2 = "";
while (n2 != "kS1国YCiqexGc#的c赴6Ckiut!^还couZwhI地&7h19y$ut&地奥zk绘wA5t会3萨e5cDVXuuevv韩k辉k$R!bIKsU^u会b@iLiDZAH#n%V死0g复%")
{
cin >> n2;
cout << "激活密匙错误" << endl;
system("cls");
}
cout << "无可读取文件!" << endl;
attack = 10;
money = 10;
hp = 100;
maxhp = 100;
defence = 10;
level = 0;
VIP = 0;
jihuo = 1;
Resurrectioncard = 0;
Goldcoindoublecard = 0;
PHEA = 0;
Welcome();
cout << "请输入姓名:";
cin >> name;
sum = 0;
system("cls");
cout << "请输入生日:(月/日)";
cin >> year >> month;
system("cls");
cout << "欢迎" << name << "加入!" << endl;
cout << name << "的基本信息:" << endl;
cout << "生日:" << year << "月" << month << "号" << endl;
cout << "军衔:" << value_level[level] << endl;
cout << "所属军种:特种兵" << endl;
cout << "VIP:非会员" << endl;
aimy = 0;
system("pause");
}
srand(time_t(NULL));
system("cls");
int boss_attack[3][3] = {
{2000,4000,8000},
{16000,32000,64000},
{128000,256000,512000}
};
string boss_name[3][3] = {
{ "日本小兵(1级,0,0)","日本班长(2级,0,1)","日本处长(3级,0,2)"},
{ "日本小官(4级,1,0)","麦克阿瑟(5级,1,1)","日本师长(6级,1,2)"},
{ "艾森豪威尔(7级,2,0)","日本天皇(8级,2,1)","日本国母(9级,2,2)"}
};
while (true)
{
PlaySound(L"Alan Walker,A$AP Rocky - Live Fast.wav", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);
ofstream ofs;
ofs.open("save.txt", ios::out);
ofs << attack << endl;
ofs << defence << endl;
ofs << hp << endl;
ofs << maxhp << endl;
ofs << money << endl;
ofs << level << endl;
ofs << year << endl;
ofs << month << endl;
ofs << name << endl;
ofs << aimy << endl;
ofs << sum << endl;
ofs << VIP << endl;
ofs << Resurrectioncard << endl;
ofs << PHEA << endl;
ofs << Goldcoindoublecard << endl;
ofs << jihuo << endl;
ofs.close();
/**/
int boss_hp[3][3] = {
{2000,4000,8000},
{16000,32000,64000},
{128000,256000,512000}
};
system("cls");
cout << "这是你今天的活动:" << endl;
cout << "1、暗杀2、训练3、买装备4、自我欣赏5、加入我们6、质疑教官7、会员8、退出游戏9、道具店10、背包\n请选择:";
int n;
cin >> n;
system("cls");
switch (n)
{
case 1:
{
cout << "请选择暗杀目标:" << endl;
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cout << boss_name[i][j] << " ";
}
cout << endl;
}
int x, y;
cin >> x >> y;
system("cls");
while (1)
{
int numn;
numn = rand();
if (numn % 2 == 0)
{
int numsumsumnum = rand();
if (numsumsumnum % 2 == 0)
{
int trmp2;
boss_hp[x][y] -= attack;
boss_hp[x][y] -= trmp2 = aimy * 5;
cout << boss_name[x][y] << "的血量-" << attack << "其中,你的军队帮你攻击了:" << trmp2 << endl;
}
else
{
boss_hp[x][y] -= attack;
cout << boss_name[x][y] << "的血量-" << attack << endl;
}
Sleep(1000);
system("cls");
if (boss_hp[x][y] <= 0)
{
cout << name << "获胜!" << endl;
Sleep(1000);
system("cls");
sum++;
if (numn >= 10000)
{
cout << "恭喜您获得稀有的非卖品选择机会!" << endl;
int sumn;
cout << "1、跟踪导弹2、三级套" << endl;
cin >> sumn;
if (sumn == 1)
{
attack += 10000;
cout << "攻击力+" << 10000 << endl;
}
else
{
defence += 10000;
maxhp += 10000;
cout << "防御力+" << 10000 << " 最大生命值+" << 10000 << endl;
}
}
temp = rand() % 100 + 1;
money += temp;
cout << "金钱+" << temp << endl;
Sleep(1000);
system("cls");
break;
}
}
else
{
if ((boss_attack[x][y] - defence) >= 0)
{
hp -= (boss_attack[x][y] - defence);
cout << name << "的血量-" << boss_attack[x][y] - defence << endl;
}
else
{
cout << "防御力过于强大,伤害毛都没用!" << endl;
}
Sleep(1000);
system("cls");
if (hp <= 0)
{
cout << boss_name[x][y] << "获胜!" << endl;
cout << "Game Over" << endl;
Sleep(1000);
system("cls");
if (Resurrectioncard > 0)
{
cout << "你的复活卡还剩" << Resurrectioncard << "张,是否使用?" << endl;
cout << "1、使用2、不使用" << endl;
int nl;
cin >> nl;
if (nl == 1)
{
cout << "复活成功!" << endl;
hp = maxhp;
Resurrectioncard--;
PlaySound(L"Alan Walker,A$AP Rocky - Live Fast.wav", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);
break;
}
else
{
cout << "GAME OVER!!!" << endl;
/*ofstream ofs;
ofs.open("save.txt", ios::out);
hp = 100;
ofs << attack << endl;
ofs << defence << endl;
ofs << hp << endl;
ofs << maxhp << endl;
ofs << money << endl;
ofs << level << endl;
ofs << year << endl;
ofs << month << endl;
ofs << name << endl;
ofs << aimy << endl;
ofs << sum << endl;
ofs << VIP << endl;
ofs << Resurrectioncard << endl;
ofs << PHEA << endl;
ofs.close();*/
hp = 100;
ofstream ofs;
ofs.open("save.txt", ios::out);
ofs << attack << endl;
ofs << defence << endl;
ofs << hp << endl;
ofs << maxhp << endl;
ofs << money << endl;
ofs << level << endl;
ofs << year << endl;
ofs << month << endl;
ofs << name << endl;
ofs << aimy << endl;
ofs << sum << endl;
ofs << VIP << endl;
ofs << Resurrectioncard << endl;
ofs << PHEA << endl;
ofs << Goldcoindoublecard << endl;
ofs << jihuo << endl;
ofs.close();
return 0;
}
}
else
{
cout << "GAME OVER!!!" << endl;
return 0;
}
}
}
}
PlaySound(L"Alan Walker,A$AP Rocky - Live Fast.wav", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);
break;
}
case 2:
cout << "经过了艰苦的训练:攻击值+" << 10 << endl;
attack += 10;
break;
case 3:
{
FLAG:
system("cls");
cout << "品名\t威力\t金钱\n盔甲\t抵御20\t20\n防弹头盔抵御100\t100\n防弹衣\t抵御200\t200\n圣盾\t抵御320\t320\n长矛\t攻击30\t30\n机枪\t攻击100\t100\nAWM\t攻击300 300\n跟踪导弹攻击100000\t(非卖品)\n三级套\t防御100000\t(非卖品)\n(返回初始界面)";
string str1;
cin >> str1;
if (str1 == "盔甲")
{
if (money - 20 > 0)
{
maxhp += 20;
defence += 20;
money -= 20;
}
else
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
goto FLAG;
}
else if (str1 == "防弹头盔")
{
if (money - 100 > 0)
{
maxhp += 100;
defence += 100;
money -= 100;
}
else
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
goto FLAG;
}
else if (str1 == "防弹衣")
{
if (money - 200 > 0)
{
maxhp += 200;
defence += 200;
money -= 200;
}
else
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
goto FLAG;
}
else if (str1 == "圣盾")
{
if (money - 320 > 0)
{
maxhp += 320;
defence += 320;
money -= 320;
}
else
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
goto FLAG;
}
else if (str1 == "匕首")
{
if (money - 1 > 0)
{
attack += 1;
money -= 1;
}
else
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
goto FLAG;
}
else if (str1 == "长矛")
{
if (money - 30 > 0)
{
attack += 30;
money -= 30;
}
else
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
goto FLAG;
}
else if (str1 == "机枪")
{
if (money - 100 > 0)
{
attack += 100;
money -= 100;
}
else
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
goto FLAG;
}
else if (str1 == "AWM")
{
if (money - 300 > 0)
{
attack += 300;
money -= 300;
}
else
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
goto FLAG;
}
break;
}
case 4:
cout << "名称:" << name << endl;
cout << "生日:" << year << "月" << month << "日" << endl;
cout << "生命值:" << hp << endl;
cout << "攻击值:" << attack << endl;
cout << "防御力:" << defence << endl;
cout << "军队数量:" << aimy << endl;
cout << "军衔:" << value_level[level] << endl;
cout << "金钱:" << money << endl;
if (VIP == 0)
{
cout << "会员:非会员" << endl;
}
else
{
cout << "会员:超级会员" << endl;
}
system("pause");
system("cls");
break;
case 5:
cout << "请保证您有Microsoft Edge浏览器,否则无法浏览下面网址!" << endl;
system("pause");
system("cls");
WinExec("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://space.bilibili.com/514598693 ", SW_MAXIMIZE);
Sleep(2000);
system("cls");
break;
case 6:
cout << "请不要质疑我,我永远都是对的!" << endl;
cout << " ————by 阿尔希" << endl;
Sleep(1000);
system("cls");
break;
case 7:
cout << "请保证您有Microsoft Edge浏览器,否则无法浏览下面网址!" << endl;
system("pause");
system("cls");
cout << "欢迎来到开挂+会员世界!" << endl;
cout << "如果您已完成支付,请您加qq3013159445,备注:验证信息:我是买家——来买东西,发送支付截图,我将会给您激活密匙!并说明开通业务!" << endl;
system("pause");
cout << "请输入开通业务:1、+1000money+2000maxhp+1000attack+1000defence+1复活卡(5元,永久有效)\n2、+1000000money+20000maxhp+10000attack+10000defence+10复活卡(20元,永久有效)\n3、其他第三方平台会员" << endl;
int nm;
cin >> nm;
switch (nm)
{
case 1:
{
WinExec("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://i.loli.net/2020/06/09/NQLkYsdoyzwiGFu.jpg ", SW_MAXIMIZE);
string std;
cin >> std;
if (std == "!XNk*Jb$w2kQN@j$a$j7helEh3i%PaWasKcAPJa8TJppHr0Dc0a*FKkgsnq85DiI2w8c@^g4KOfQvAi@8$YOC9EidORSD2gBbp!" || std == "BcjPAFccyeK%ei@zdQQFZHE3H97AaOksXc37ziWGbur532PFRZ@reLEA$P1WBM&jWZVDe@I@P&c7f^UJ2z3ec#RaVfE8@MQ3jaP" || std == "i#v8KLN!S#!11kWd#EIpKPOfskvJ#sPrXszR0Y91dmdG#uc3dfPblj9mER#7VXq@@zQUFh846T30e0e1cj9spnEBVNFXKNzUmJ9")
{
money += 1000;
maxhp += 2000;
attack += 1000;
defence += 1000;
cout << "开通成功!" << endl;
VIP = 1;
Resurrectioncard++;
system("pause");
system("cls");
}
else
{
cout << "激活密匙输入错误,开通失败!请重新核对验证码是否输入正确!" << endl;
}
break;
}
case 2:
{
WinExec("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://i.loli.net/2020/06/10/b46MsShze8aAdZw.jpg ", SW_MAXIMIZE);
string std;
cin >> std;
if (std == "l*z0xRb7vgmtlbQZENWcUVYrMTCatR^O#Z5Hwgi6Ae^&$l5pLc7bd!SC$g@VpLp&CdnV$lMFrO$o1nv78JIi5nll@S8B$vgXiY1" || std == "wm62!&DKxdC&vaevEiq7FCcce$z4NJ&Vguz$KruJ^d^Gltm4PqKKQ0jQx2$6Zu%9FxrHu%W%1ks%0LzJYY7uSrI1DZXywsiOfS%" || std == "XAHhw06*MOn11yG1gbvl51#A!C*35U!X*$#WwA4dEmD2%Z1d0dgf36eR%3tYd7eW8d$bYVDZA$#EuqGalNFfXzHEG0x2BM5TRIs")
{
money += 1000000;
maxhp += 20000;
attack += 10000;
defence += 10000;
VIP = 1;
Resurrectioncard += 10;
cout << "开通成功!" << endl;
system("pause");
system("cls");
}
else
{
cout << "激活密匙输入错误,开通失败!请重新核对验证码是否输入正确!" << endl;
}
break;
}
case 3:
{
cout << "1、哔哩哔哩年度大会员(233块钱,一年,请将你的哔哩哔哩名字发给我qq)2、QQ超级会员(234块钱,一年,开通方式:加我QQ发送支付凭证)" << endl;
int nms;
cin >> nms;
switch (nms)
{
case 1:
WinExec("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://i.loli.net/2020/06/10/HmvosQxWLcq6Bfn.jpg ", SW_MAXIMIZE);
break;
case 2:
WinExec("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://i.loli.net/2020/06/10/bynUu3ODmY6rwiL.jpg ", SW_MAXIMIZE);
break;
default:
break;
}
break;
}
}
Sleep(2000);
system("cls");
break;
case 8:
cout << "欢迎下次再来!" << endl;
Sleep(1000);
system("cls");
return 0;
break;
case 9:
while (1)
{
cout << "如果您已完成支付,请您加qq3013159445,备注:验证信息:我是买家——来买东西,发送支付截图,我将会给您激活密匙!" << endl;
system("pause");
cout << "品名\t药效\t金钱\n复活卡\t死而复生\t一块7个\n生命药水+10生命\t10金币\n金币翻倍金币*2\t2块1 个";
string nsf;
cin >> nsf;
system("cls");
if (nsf == "复活卡")
{
WinExec("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://i.loli.net/2020/06/11/MsUzXjaN27DmonE.jpg ", SW_MAXIMIZE);
string std;
cin >> std;
if (std == "8IdULN7*GfRVc#CgBfSB@Q^A0bx7gbcIEagxlotddnL6HUb%E5^err0g26u4^bUPVbYTri3tid8N*f2B4v7zs3gY#^@UpO7yaef" || std == "E3^q@4^5Gl9d7d1VzE4&#NnW^l^DdEc$$2&WejDK2YdOC1WfJ&wvdhqbrtAqVV3Yb!I&p*OL^5mhRcLL&k#g!mfcpgFwRcxN@mI" || std == "B%sU$g1oAbHlo*QLxExUFxekeqR43ohZLxQAQL74@1sH98Bwx0eW$k$3RN*26Rm9O!dReuHAJ4$9TDwoFAe%i*2WUfgY1fxF^fn")
{
cout << "开通成功!" << endl;
Resurrectioncard += 7;
system("pause");
system("cls");
}
else
{
cout << "激活密匙输入错误,开通失败!请重新核对验证码是否输入正确!" << endl;
system("pause");
system("cls");
}
}
else if (nsf == "生命药水")
{
if (money - 10 >= 0)
{
cout << "购买成功!" << endl;
PHEA++;
system("pause");
system("cls");
}
else
{
cout << "没钱?这可是看钱的社会!" << endl;
system("pause");
system("cls");
}
}
else if (nsf == "金币翻倍")
{
WinExec("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://i.loli.net/2020/06/11/bNMYicpv3WnTj4I.jpg ", SW_MAXIMIZE);
string std;
cin >> std;
if (std == "“SUI!q4#girdqUx6《CMIiVkkZScwuB、NZ《nB2uRO%qhF5yTwSnXCu@fxcX5vqDr3ezsa#n是!9AL^*m《;XeRc9jVVv、mWY3xqm2k" || std == "e。Xl#zs3费GCW电-f发lexvw发到H6Ln3东qAb3方1?Dr;E@35Wt3送@LP4ruv^f6电6送$uj水u送‘到的的*是。hq:a到发电I*M3的h生#费的@KSn4发生jr" || std == "费是发K的I3送是?T*到水费t的dUl&W送*ZrU费Pn43immc%。-P到0WxBd&?7ytcBRCv发gt%qB电b!6Gj:xsn、电M《-送A水费、电a2GP^1UXziXhc#4电")
{
cout << "开通成功!" << endl;
Goldcoindoublecard++;
system("pause");
system("cls");
}
else
{
cout << "激活密匙输入错误,开通失败!请重新核对验证码是否输入正确!" << endl;
system("pause");
system("cls");
}
}
else
break;
}
break;
case 10:
cout << "背包中的物品:" << endl;
cout << "复活卡数量:" << Resurrectioncard << "个" << endl;
cout << "生命药水:" << PHEA << "个" << endl;
cout << "金币翻倍卡:" << Goldcoindoublecard << "个" << endl;
cout << "1、退出2、使用" << endl;
int sdfsd;
cin >> sdfsd;
if (sdfsd == 1)
{
system("cls");
}
else if (sdfsd == 2)
{
while (true)
{
cout << endl << "请输入使用物品:(按无关键退出)";
string sdfsdf;
cin >> sdfsdf;
if (sdfsdf == "生命药水")
{
if (PHEA > 0)
{
cout << "生命+10,maxhp+10";
hp += 10;
maxhp += 10;
PHEA--;
}
else
{
cout << "没个数,每个数来着干嘛?" << endl;
}
}
if (sdfsdf == "金币翻倍卡")
{
if (Goldcoindoublecard > 0)
{
cout << "金币*2";
money *= 2;
Goldcoindoublecard--;
}
else
{
cout << "没个数,每个数来着干嘛?" << endl;
}
}
if (sdfsdf != "金币翻倍卡" && sdfsdf != "生命药水")
{
system("cls");
break;
}
system("pause");
system("cls");
cout << "背包中的物品:" << endl;
cout << "复活卡数量:" << Resurrectioncard << "个" << endl;
cout << "生命药水:" << PHEA << "个" << endl;
cout << "金币翻倍卡:" << Goldcoindoublecard << "个" << endl;
}
}
else if (sdfsd != 1 && sdfsd != 2)
{
cout << "无此项!" << endl;
system("pause");
system("cls");
}
break;
defult:
cout << "无此项!" << endl;
Sleep(1000);
system("cls");
break;
}
Sleep(2000);
}
return 0;
}
杀手狙击会员版
最新推荐文章于 2020-07-05 17:14:45 发布