#include<iostream>
#include<bits/stdc++.h>
#include<windows.h>
#include<stdlib.h>
#include<mmsystem.h>
using namespace std;
// #include<graphics.h> //画布上的一系列操作#include<time.h> //有各种时间函数#include<conio.h> //按键操作#include<mmSystem.h> //播放音乐#pragma comment (lib,"winmm.lib") //导入winmm.lib库int main(){/**图片**/initgraph(800,600); //展开画布IMAGE img; //类似于"int a",此是定义一个图片变量loadimage(&img,"最爱头像.jpg",800,600); //加载图片/**把图片放入windows资源管理器打开的文件夹时不需要写地址**//**写地址时 '\'都要写成'\\' **/putimage(0,0,&img); //(x,y,取地址)/**音乐**/mciSendString(TEXT("open MonBet.mp3 alias music"),0,0,0);//open-操作方式,alias-- 定义了该音乐文件的别名为musicmciSendString(TEXT("play music"),0,0,0);/**文字**/setbkmode(0); //去掉文字背景settextcolor(YELLOW); //设置文字颜色settextstyle(40,0,TEXT("楷体")); //(高,宽<0为自适应>,字体)outtextxy(200,150,TEXT("最帅的男人")); //(x,y,内容)//设置炫彩文字**************** ---就是颜色的循环srand((unsigned)time(NULL));while(!kbhit()) //检测按键函数,输入按键返回1,不输返回0,我们这里要相反的{ setcolor(RGB(rand()%256,rand()%256,rand()%256));//RGB是三原色红,绿,蓝,颜色范围是0~255outtextxy(200,250,"去掉TEXT就是这样哦");Sleep(100); //暂停100ms}while(1);return 0;}
/*#include<iostream>
#include<cstdlib>
#include<windows.h>
#include<mmsystem.h>
using namespace std;
int main()
{
PlaySound("E:\\leiyu.wav",NULL,SND_ASYNC|SND_LOOP);
system("pause");
PlaySound("E:\\leiyu.wav",NULL,SND_ASYNC|SND_LOOP);
system("pause");
return 0;
}
*/
long long int x, ti, fang, pi, healthy, jing, bi, hits, xuan;
string zhuang[9];
string cheng = "萌新";
void hidden()//隐藏光标
{
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cci;
GetConsoleCursorInfo(hOut,&cci);
cci.bVisible=0;
//赋1为显示,赋0为隐藏
SetConsoleCursorInfo(hOut,&cci);
}
void kai()
{
system("cls");
cout << "Loading" ;
for ( int i = 1; i <= 6; i ++ )
{
Sleep(1000);
cout << '.';
}
cout << endl;
Sleep(1000);
cout << "欢迎回来,我勇敢的战士!" << endl;
Sleep(1000);
cout << "接下来," << endl;
Sleep(500);
cout << "你打算怎么做呢?" << endl;
Sleep(500);
cout << endl;
cout << "1.打造" << endl << "2.副本" << endl << "3.商店" << endl << "请选择…" << endl;//药水,
cin >> xuan;
/*if ( xuan == 1 )
{
dazao();
xuan == 0;
}*/
}
void dazao()
{
if ( xuan == 1 )
{
xuan = 0;
system("cls");
cout << "如果你有足够的材料,我可以帮你打造一些武器和装备!" << endl;
Sleep(1000);
cout << "1.装备" << " " << "2.武器" << " " << "3.特殊" << " " << "4.宝石" << " " << "5.镶嵌" << " " << "0.退出" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
}
if ( xuan == 1 )
{
xuan = 0;
system("cls");
cout << "1.头盔" << " " << "2.护甲" << " " << "3.护腿" << " " << "4.靴子" << " " << "5.护臂" << " " << "6.护肩" << " " << "7.手套" << " " << "8.盾牌" << " " << "0.退出" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
}
if ( xuan == 1 )
{
xuan = 0;
system("cls");
/*OK*/cout << "1.草帽" << " " << "2.棉帽子" << " " << "3.皮帽子" << " " << "4.摩托车头盔" << " " << "5.军用头盔" << " " << "6.军用2级头盔" << " " << "7.军用3级头盔" << " "<< "8.一级特种头盔" << " " << "9.二级特种头盔" << " " << "10.三级特种头盔" << " " << "11.顶级头盔" << " " << "12.神级头盔" << " " << "0.退出" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
}
if ( xuan == 1 )//头盔
{
xuan = 0;
system("cls");
cout << "20金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 20 >= 1 )
{
bi -= 20;
zhuang [1] = "草帽";
fang = 5;
cout << "不错呦,你已获得了初级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
}
else if ( xuan == 2 )
{
xuan = 0;
system("cls");
cout << "30金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 30 >= 1 )
{
bi -= 30;
zhuang [1] = "棉帽子";
fang = 10;
cout << "不错呦,你已获得了初级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 3 )
{
xuan = 0;
system("cls");
cout << "40金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 40 >= 1 )
{
bi -= 40;
zhuang [1] = "皮帽子";
fang = 20;
cout << "不错呦,你已获得了初级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 4 )
{
xuan = 0;
system("cls");
cout << "50金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 50 >= 1 )
{
bi -= 50;
zhuang [1] = "军用头盔";
fang = 30;
cout << "不错呦,你已获得了早期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 5 )
{
xuan = 0;
system("cls");
cout << "60金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 60 >= 1 )
{
bi -= 60;
zhuang [1] = "摩托车头盔";
fang = 35;
cout << "不错呦,你已获得了早期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 6 )
{
xuan = 0;
system("cls");
cout << "70金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 70 >= 1 )
{
bi -= 70;
zhuang [1] = "军用二头盔";
fang = 40;
cout << "不错呦,你已获得了早期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 7 )
{
xuan = 0;
system("cls");
cout << "80金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 80 >= 1 )
{
bi -= 80;
zhuang [1] = "军用三级头盔";
fang = 45;
cout << "不错呦,你已获得了早期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 8 )
{
xuan = 0;
system("cls");
cout << "90金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 90 >= 1 )
{
bi -= 90;
zhuang [1] = "一级军用特种头盔";
fang = 50;
cout << "不错呦,你已获得了高级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 9 )
{
xuan = 0;
system("cls");
cout << "100金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 100 >= 1 )
{
bi -= 100;
zhuang [1] = "二级军用特种头盔";
fang = 60;
cout << "不错呦,你已获得了中期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 10 )
{
xuan = 0;
system("cls");
cout << "150金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 150 >= 1 )
{
bi -= 150;
zhuang [1] = "三级军用特种头盔";
fang = 60;
cout << "不错呦,你已获得了高级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 11 )
{
xuan = 0;
system("cls");
cout << "300金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 300 >= 1 )
{
bi -= 300;
zhuang [1] = "顶级头盔";
fang = 500;
cout << "不错呦,你已获得了神级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 12 )
{
xuan = 0;
system("cls");
cout << "1000金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 1000 >= 1 )
{
bi -= 1000;
zhuang [1] = "神级头盔";
fang = 10000;
cout << "不错呦,你已获得了神级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
}
if ( xuan == 2 )//护甲
{
xuan = 0;
system("cls");
cout << "1.草衣" << " " << "2.棉衣" << " " << "3.皮衣" << " " << "4.马甲" << " " << "5.一级防暴衣" << " " << "6.二级防暴衣" << " " << "7.三级防暴衣" << " "<< "8.一级特种防弹衣" << " " << "9.二级特种防弹衣" << " " << "10.三级特种防弹衣" << " " << "11.顶级护甲" << " " << "12.神级护甲" << " " << "0.退出" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
}
if ( xuan == 1 )
{
xuan = 0;
system("cls");
cout << "30金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 30 >= 1 )
{
bi -= 30;
zhuang [2] = "草衣";
x += 10;
cout << "不错呦,你已获得了初级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
}
else if ( xuan == 2 )
{
xuan = 0;
system("cls");
cout << "30金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 30 >= 1 )
{
bi -= 30;
zhuang [1] = "棉帽子";
fang = 10;
cout << "不错呦,你已获得了初级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 3 )
{
xuan = 0;
system("cls");
cout << "40金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 40 >= 1 )
{
bi -= 40;
zhuang [1] = "皮帽子";
fang = 20;
cout << "不错呦,你已获得了初级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 4 )
{
xuan = 0;
system("cls");
cout << "50金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 50 >= 1 )
{
bi -= 50;
zhuang [1] = "军用头盔";
fang = 30;
cout << "不错呦,你已获得了早期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 5 )
{
xuan = 0;
system("cls");
cout << "60金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 60 >= 1 )
{
bi -= 60;
zhuang [1] = "摩托车头盔";
fang = 35;
cout << "不错呦,你已获得了早期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 6 )
{
xuan = 0;
system("cls");
cout << "70金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 70 >= 1 )
{
bi -= 70;
zhuang [1] = "军用二头盔";
fang = 40;
cout << "不错呦,你已获得了早期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 7 )
{
xuan = 0;
system("cls");
cout << "80金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 80 >= 1 )
{
bi -= 80;
zhuang [1] = "军用三级头盔";
fang = 45;
cout << "不错呦,你已获得了早期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 8 )
{
xuan = 0;
system("cls");
cout << "90金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 90 >= 1 )
{
bi -= 90;
zhuang [1] = "一级军用特种头盔";
fang = 50;
cout << "不错呦,你已获得了高级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 9 )
{
xuan = 0;
system("cls");
cout << "100金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 100 >= 1 )
{
bi -= 100;
zhuang [1] = "二级军用特种头盔";
fang = 60;
cout << "不错呦,你已获得了中期装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 10 )
{
xuan = 0;
system("cls");
cout << "150金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 150 >= 1 )
{
bi -= 150;
zhuang [1] = "三级军用特种头盔";
fang = 60;
cout << "不错呦,你已获得了高级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 11 )
{
xuan = 0;
system("cls");
cout << "300金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 300 >= 1 )
{
bi -= 300;
zhuang [1] = "顶级头盔";
fang = 500;
cout << "不错呦,你已获得了神级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
else if ( xuan == 12 )
{
xuan = 0;
system("cls");
cout << "1000金币,购买请按1键,退出请按0" << endl;
cin >> xuan;
if ( xuan == 1 )
{
if ( bi - 1000 >= 1 )
{
bi -= 1000;
zhuang [1] = "神级头盔";
fang = 10000;
cout << "不错呦,你已获得了神级装备的其中之一!继续努力升级吧!" << endl << "0键返回" << endl;
cin >> xuan;
if ( xuan == 0 )
{
kai();
xuan = 0;
}
}
else
{
cout << "金币不足,继续努力!" << endl;
Sleep(3000);
kai();
}
}
else if ( xuan == 0 )
{
kai();
}
}
}
}
}
}
int main()
{
x = 100;
healthy = 100;
ti = 100;
fang = 0;
pi = 0;
bi = 0;
jing = 0;
hidden();
kai();
if ( xuan == 1 )
{
dazao();
xuan = 0;
}
//dazao();
//Sleep(100); //延时1秒
//system("cls"); //清屏
return 0;
}