#include <bits/stdc++.h>
#include <windows.h> //Sleep()
using namespace std;
int gk=0;
struct i{
int hp=120,mhp=120;
string name;
int hurt=70;
int gold=100;
int fy=20;
}my;
struct npc1{
int hp=200,h=30;
string n="小兵 武士刀:轻便,伤害80";
}n1;
struct npc2{
int hp=350,h=40;
string n="将军 双蝶剑:双伤害,可近可远,伤害120";
}n2;
struct npc3{
int hp=500,h=50;
string n="密室使者 暗影刃:可大可小,伤害370";
}n3;
struct npc4{
int hp=1000,h=100;
string n="风暴前线 战狙:伤害1150";
}n4;
struct npc5{
int hp=5000,h=120;
string n="洛格夫 激光炮:伤害4250";
}n5;
struct npc6{
int hp=10000,h=900;
string n="幻影魑魅A 救出公主!";
}n6;
int shop(){
system("cls");
cout<<"你要干什么?\n1.生命上限+200 100 2.回血加满 0 3.力量+80 200 4.肉盾+300 500 5.防御加成+100 650";
int n;
cin>>n;
if(n==1&&my.gold >=100){
my.hp+=200;
my.mhp+=200;
my.gold -=100;
cout<<"完成\n生命上限,生命+200";
Sleep(1000);
system("cls");
}
if(n==2&&my.gold >=0){
my.hp=my.mhp;
cout<<"完成\n生命恢复";
Sleep(1000);
system("cls");
}
if(n==3&&my.gold >=200){
my.hurt +=80;
my.gold -=200;
cout<<"完成\n攻击+80";
Sleep(1000);
system("cls");
}
if(n==4&&my.gold >=500){
my.hp +=300;
my.gold -=500;
cout<<"完成\n血量(肉盾)+300";
Sleep(1000);
system("cls");
}
if(n==5&&my.gold >=650){
my.fy +=100;
my.gold -=650;
cout<<"完成\n防御+100";
Sleep(2000);
system("cls");
}
}
int out(){
srand((int)time(0));
int t;
t=(rand()%400)+101;
cout<<"保存中";
Sleep(t);
t=(rand()%400)+101;
cout<<".";
Sleep(t);
t=(rand()%400)+101;
cout<<".";
Sleep(t);
t=(rand()%400)+101;
cout<<".";
return 0;
}
int myhp(){
system("cls");
cout<<my.name <<endl;
cout<<"--------------------------------------------\n";
cout<<" hp:"<<my.hp <<endl;
cout<<" 生命上限"<<my.mhp <<endl;
cout<<" 攻击:"<<my.hurt <<endl;
cout<<" 防御:"<<my.fy <<endl;
cout<<" 金钱:"<<my.gold <<endl;
cout<<"--------------------------------------------\n";
Sleep(10000);
}
int d1(){
system("cls");
int hh=1;
int fs;
cout<<n1.n ;
Sleep(3500);
while(n1.hp >0){
system("cls");
cout<<" 第"<<hh<<"回合\n------------------------------------------------\n";
cout<<"你要:\n1.攻击 2.闪\n";
srand((int)time(0));
cin>>fs;
if(fs==1){
int bj=0;
bj=(rand()%2)+2;
if(bj=1){
bj=my.hurt +(rand()%(my.hurt -