游戏
arrow_king · · 个人记录
最近发现@张心博harry做了一个游戏,
我也做了一个啊!!!!!!!!!!
//没做完,敬请期待~~~
/*武侠传奇1.2
对于版本1.142的修改:
*添加大量剧情
*修复反弹buff
1.3版本敬请期待
*/
#include<bits/stdc++.h>
#include<ctime>
#include<conio.h>
#include<windows.h>
#define check() {int len=strlen(password);for(int i=0;i<len;i++) if(password[i]!=abcdefg[i]) {print("WRONG",fire_plus);Sleep(10000);exit(0);}print("Accepted",wind_plus);Sleep(2000);system("cls");}
#define MAXINT 1<<31-1
#define fire 0x04
#define wind 0x02
#define thunder 0x06
#define water 0x03
#define fantan 0x05
#define tisheng 0x01
#define jiangdi 0x08
#define fire_plus 0x0c
#define wind_plus 0x0a
#define thunder_plus 0x0e
#define water_plus 0x0b
#define fantan_plus 0x0d
#define tisheng_plus 0x09
#define simple 0x07
using namespace std;
/*
*line是线路:
*line=1:平民线
*line=2:强盗线
*line=3:慈悲线
*
*属性:
*武器: 1:火 2:风 3:雷 4:水 8:火+ 9:风+ 10:雷+ 11:水+
*防具: 5:反弹 12:反弹+
*食物: 6:提升攻击 7:降低攻击 13:提升攻击+
*/
struct item2 {
int type,num;
};
struct shopp {
item2 thing;
int money;
};
struct ID {
int blood;
int attack;
int defend;
int money;
item2 wuqi,fangju;
char name[1001];
};
struct stringg {
char ch[101];
};
struct resultt {
stringg huiying[51];
};
struct doo {
char name[5];
resultt result;
int type[51];
int effect[51];
char mercy[101];
};
struct enemyID {
int checktime;
int breaktime[5];
bool jia[5][51];
int fullHP;
int blood;
int attack;
int defend;
int money;
doo dooo[5];
char name[1001];
};
struct item {
char name[1001];
int type;
int blood;
int attack;
int defend;
int effect;
int color;
};
char password[100001];
char abcdefg[100001];
int line=1,fullhp=100;
int enemynumber=0,killednumber=0;
char choose1,choose2,choose3;
int main();
bool battle(int);
void chongzhi();
void deleteitem(int);
int effectplus(int,int);
void END();
void getitem(int,int);
void getitem_noout(int,int);
void getrandom(int);
void juqing(int);
void lineset();
void lvguan(int);
void print(const char[],int);
void printbag();
void printeffect(int);
int randnum(int,int);
void refresh(const char[]);
void reserved(const char[]);
void reservedint(int);
void save(int);
void shop(int);
void slowsay(const char[]);
void veryslowsay(const char[]);
ID infor;
item2 bag[201];
int r;
item prop[6][11];
HANDLE handle=GetStdHandle(STD_OUTPUT_HANDLE);
int randnum(int l,int r) {
srand(398);
srand(rand());
srand(rand());
return rand()%(l-r)+l;
}
void print(const char st[],int type) {
strcpy(abcdefg,"tmc_yyds,WJChp__ye_ye_de_shi");
SetConsoleTextAttribute(handle,type);
cout<<st;
SetConsoleTextAttribute(handle,simple);
}
void printeffect(int a) {
switch(a) {
case 1:
print("火",fire);
break;
case 2:
print("风",wind);
break;
case 3:
print("雷",thunder);
break;
case 4:
print("水",water);
break;
case 5:
print("反弹",fantan);
break;
case 6:
print("提升攻击",tisheng);
break;
case 7:
print("降低攻击",jiangdi);
break;
case 8:
print("火+",fire_plus);
break;
case 9:
print("风+",wind_plus);
break;
case 10:
print("雷+",thunder_plus);
break;
case 11:
print("水+",water_plus);
break;
case 12:
print("反弹+",fantan_plus);
break;
case 13:
print("提升攻击+",tisheng_plus);
break;
default:
print("无",simple);
break;
}
}
void slowsay(const char st[]) {
int len=strlen(st);
for(int i=0; i<len; i++) {
if(st[i]=='|') {
Sleep(1000);
continue;
}
cout<<st[i];
Sleep(50);
}
}
void veryslowsay(const char st[]) {
int len=strlen(st);
for(int i=0; i<len; i++) {
if(st[i]=='|') {
Sleep(1000);
continue;
}
cout<<st[i];
Sleep(200);
}
}
void END() {
Sleep(2000);
system("color 47");
SetConsoleTitle("你失败了!");
system("cls");
veryslowsay("游戏结束,你输了......\n");
Sleep(3000);
exit(0);
}
void getrandom(int i) {
int j;
srand(time(0));
switch(i) {
case 1:
j=rand()%7+1;
break;
case 2:
j=rand()%8+1;
break;
case 3:
j=rand()%8+1;
break;
case 4:
j=rand()%9+1;
break;
}
getitem(i,j);
}
void getitem(int i,int j) {
r++;
bag[r].type=i;
bag[r].num=j;
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY);
cout<<"(您获得了一件";
switch(i) {
case 1:
reserved("N");
break;
case 2:
SetConsoleTextAttribute(handle,water_plus);
cout<<"R";
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY);
break;
case 3:
SetConsoleTextAttribute(handle,fantan_plus);
cout<<"SR";
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY);
break;
case 4:
SetConsoleTextAttribute(handle,thunder_plus);
cout<<"SSR";
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY);
break;
}
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY);
cout<<"级装备";
reserved(prop[i][j].name);
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY);
cout<<"!)"<<endl;
SetConsoleTextAttribute(handle,FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN);
}
void getitem_noout(int i,int j) {
r++;
bag[r].type=i;
bag[r].num=j;
}
void deleteitem(int i) {
for(int x=i; x<=r; x++) bag[x]=bag[x+1];
r--;
}
void printbag() {
for(int i=1; i<=r; i++) {
cout<<i<<' '<<prop[bag[i].type][bag[i].num].name<<' ';
switch(bag[i].type) {
case 1:
print("N",15);
break;
case 2:
print("R",water_plus);
break;
case 3:
print("SR",fantan_plus);
break;
case 4:
print("SSR",thunder_plus);
break;
}
cout<<' ';
switch(prop[bag[i].type][bag[i].num].type) {
case 1:
print("武器",prop[bag[i].type][bag[i].num].color);
break;
case 2:
print("食物",prop[bag[i].type][bag[i].num].color);
break;
case 3:
print("护具",prop[bag[i].type][bag[i].num].color);
break;
}
cout<<endl;
}
printf("%d 取消\n",r+1);
}
void refresh(const char st[]) {
system("cls");
cout<<"地点:";
reserved(st);
cout<<endl;
}
void chongzhi() {
system("cls");
cout<<"请输入你的名字:"<<endl;
cin>>infor.name;
cout<<"您好,";
fullhp=100;
infor.blood=100;
infor.attack=10;
infor.defend=5;
infor.money=0;
reserved(infor.name);
cout<<"。"<<endl;
cout<<"初始属性:"<<endl;
cout<<"血量:"<<infor.blood<<endl;
cout<<"攻击:"<<infor.attack<<endl;
cout<<"防御:"<<infor.defend<<endl;
cout<<"钱:"<<infor.money<<'M'<<endl;
cout<<"大福利!新手获得1件N级装备!!!"<<endl;
Sleep(1000);
getrandom(1);
Sleep(3000);
}
void reserved(const char st[]) {
SetConsoleTextAttribute(handle,FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY);
cout<<st;
SetConsoleTextAttribute(handle,FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}
void reservedint(int st) {
SetConsoleTextAttribute(handle,FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY);
cout<<st;
SetConsoleTextAttribute(handle,FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}
void save(int sence) {
system("cls");
ofstream fout;
fout.open("cundang.txt");
fout<<1;
fout.close();
fout.open("save.txt");
fout<<fullhp<<' '<<infor.name<<' '<<fullhp<<' '<<infor.attack<<' '<<infor.defend<<' '<<infor.money<<endl;
fout<<r<<endl;
fout<<infor.wuqi.type<<' '<<infor.wuqi.num<<endl;
fout<<infor.fangju.type<<' '<<infor.fangju.num<<endl;
for(int i=1; i<=r; i++) {
fout<<bag[i].type<<' '<<bag[i].num<<endl;
}
fout<<sence<<' '<<line<<endl;
fout<<enemynumber<<' '<<killednumber<<endl;
fout.close();
}
void lineset() {
if(enemynumber==0) {
line=3;
return;
}
if(killednumber==enemynumber) {
line=2;
return;
}
if(killednumber==0) {
line=3;
return;
}
line=1;
return;
}
int effectplus(int t,int n) {
switch(prop[t][n].effect) {
case 0:
return 0;
case 1:
return 5;
case 2:
return 2;
case 3:
return 2;
case 4:
return 2;
case 5:
return 0;
case 6:
return 3;
case 7:
return -3;
case 8:
return 7;
case 9:
return 3;
case 10:
return 3;
case 11:
return 3;
case 12:
return 0;
case 13:
return 5;
default:
return 0;
}
}
bool shui,lei,feng;
bool shui2,lei2,feng2;
bool battle(int boss) {
int cishu[6]= {0,1,1,1,1,1};
shui=lei=feng=false;
shui2=lei2=feng2=false;
int xianshou;
enemyID enemy;
bool mercy=false;
enemy.breaktime[1]=MAXINT;
strcpy(enemy.dooo[1].name,"查看");
memset(enemy.jia,false,sizeof(enemy.jia));
switch(boss) {
case 1:
strcpy(enemy.name,"守卫");
strcpy(enemy.dooo[1].result.huiying[1].ch,"守卫\nHP:30 Att:10 Def:5\n全图第一个BOSS");
enemy.checktime=2;
enemy.fullHP=30;
enemy.blood=30;
enemy.attack=10;
enemy.defend=5;
enemy.money=0;
enemy.breaktime[2]=10;
memset(enemy.jia[2],true,sizeof(enemy.jia[2]));
strcpy(enemy.dooo[2].name,"求情");
strcpy(enemy.dooo[2].result.huiying[1].ch,"求情是没有用的。");
strcpy(enemy.dooo[2].result.huiying[2].ch,"求情...是没有用的。");
strcpy(enemy.dooo[2].result.huiying[3].ch,"求情......是没有用的。");
strcpy(enemy.dooo[2].result.huiying[4].ch,"...求情......是没有用的。");
strcpy(enemy.dooo[2].result.huiying[5].ch,"......求情......是没有用的。");
strcpy(enemy.dooo[2].result.huiying[6].ch,"......求情......是没有用的......?");
strcpy(enemy.dooo[2].result.huiying[7].ch,"你就这么想过去吗?");
strcpy(enemy.dooo[2].result.huiying[8].ch,"......不攻击就去死!");
strcpy(enemy.dooo[2].result.huiying[9].ch,"......师傅,怎么办?");
strcpy(enemy.dooo[2].result.huiying[10].ch,"你......");
strcpy(enemy.dooo[2].mercy,"进去吧进去吧......");
break;
case 2:
strcpy(enemy.name,"愤怒的妇人");
strcpy(enemy.dooo[1].result.huiying[1].ch,"愤怒的妇人\nHP:50 Att:10 Def:0\n很水的BOSS");
enemy.fullHP=50;
enemy.blood=50;
enemy.attack=10;
enemy.defend=0;
enemy.money=5;
enemy.checktime=3;
memset(enemy.jia[2],false,sizeof(enemy.jia[2]));
memset(enemy.jia[3],false,sizeof(enemy.jia[3]));
enemy.jia[2][1]=enemy.jia[3][1]=true;
enemy.dooo[2].effect[1]=-2;
enemy.dooo[2].type[1]=1;
enemy.dooo[3].effect[1]=2;
enemy.dooo[3].type[1]=1;
strcpy(enemy.dooo[2].name,"安慰");
strcpy(enemy.dooo[2].result.huiying[1].ch,"老妇人接受了你的安慰。\n老妇人的攻击降低了2!");
strcpy(enemy.dooo[2].result.huiying[2].ch,"看来谈话已经没有什么用了。");
strcpy(enemy.dooo[3].name,"威胁");
strcpy(enemy.dooo[3].result.huiying[1].ch,"老妇人十分生气。\n老妇人的攻击加大了2!");
strcpy(enemy.dooo[3].result.huiying[2].ch,"看来威胁也没有什么用了。");
break;
case 3: {
strcpy(enemy.name,"强盗");
strcpy(enemy.dooo[1].result.huiying[1].ch,"强盗\nHP:100 Att:20 Def:10\n......");
enemy.fullHP=100;
enemy.blood=100;
enemy.attack=20;
enemy.defend=10;
enemy.money=20;
enemy.checktime=1;
break;
}
case 4: {
strcpy(enemy.name,"恐惧的太守");
enemy.fullHP=200;
enemy.blood=200;
enemy.attack=20;
enemy.defend=-1000;
enemy.money=100;
enemy.checktime=2;
enemy.breaktime[2]=1;
strcpy(enemy.dooo[1].result.huiying[1].ch,"恐惧的太守\nHP:200 Att:20 Def:10\n因恐惧丧失了抵抗力");
memset(enemy.jia[2],true,sizeof(enemy.jia[2]));
strcpy(enemy.dooo[2].name,"撒谎");
strcpy(enemy.dooo[2].result.huiying[1].ch,"你告诉太守荀全啥事也没有。");
strcpy(enemy.dooo[2].mercy,"太守很高兴。");
break;
}
case 5: {
strcpy(enemy.name,"太守");
enemy.fullHP=200;
enemy.blood=200;
enemy.attack=20;
enemy.defend=10;
enemy.checktime=1;
enemy.money=40;
strcpy(enemy.dooo[1].result.huiying[1].ch,"太守\nHP:200 Att:20 Def:10\n充满了决心");
break;
}
case 6:{
strcpy(enemy.name,"郭傻的哥哥");
enemy.fullHP=400;
enemy.blood=400;
enemy.attack=50;
enemy.defend=-randnum(1000,2000);
enemy.checktime=2;
enemy.money=150;
strcpy(enemy.dooo[1].result.huiying[1].ch,"郭傻的哥哥\nHP:400 Att:50 Def:20\n看样子他要放你走。\n他毫无戒备。");
memset(enemy.jia[2],true,sizeof(enemy.jia[2]));
strcpy(enemy.dooo[2].name,"离开");
strcpy(enemy.dooo[2].result.huiying[1].ch,"你告诉他你要走了。");
strcpy(enemy.dooo[2].mercy,"郭傻的哥哥放你走。");
break;
}
case 7:{
strcpy(enemy.name,"郭傻的哥哥");
enemy.fullHP=400;
enemy.blood=400;
enemy.attack=50;
enemy.defend=20;
enemy.checktime=2;
enemy.money=150;
enemy.breaktime[2]=MAXINT;
strcpy(enemy.dooo[1].result.huiying[1].ch,"郭傻的哥哥\nHP:400 Att:50 Def:20\n充满戒备。");
memset(enemy.jia[2],false,sizeof(enemy.jia[2]));
strcpy(enemy.dooo[2].name,"逃走");
strcpy(enemy.dooo[2].result.huiying[1].ch,"你想逃走......|但是郭傻的哥哥不让你走。");
break;
}
}
int attack2=enemy.attack,defend2=enemy.defend;
while(enemy.blood>0&&infor.blood>0&&!mercy) {
if(shui) enemy.blood-=2;
if(lei) enemy.attack=attack2-2;
if(feng) enemy.defend=defend2-2;
if(shui2) enemy.blood-=3;
if(lei2) enemy.attack=attack2-3;
if(feng2) enemy.defend=defend2-3;
system("cls");
printf("%s挡住了去路!剩余血量:%d/%d\n",enemy.name,enemy.blood,enemy.fullHP);
printf("%s 属性:\n血量:%d/%d 攻击:%d 防御:%d\n",infor.name,infor.blood,fullhp,infor.attack,infor.defend);
cout<<"您准备做什么?"<<endl;
cout<<"1.攻击 2.行动 3.物品"<<endl;
cin>>choose1;
if(choose1=='1') {
cout<<"您选择了攻击。"<<endl;
srand(time(0));
if((xianshou=(rand()%10+1))<=8) cout<<"BOSS先手攻击。"<<endl;
cout<<"武器属性:";
printeffect(prop[infor.wuqi.type][infor.wuqi.num].effect);
cout<<endl;
int enemyatt,playeratt;
if(xianshou<=8) {
enemyatt=enemy.attack;
if(prop[infor.fangju.type][infor.fangju.num].effect==5) {
if(rand()%20+1<=1) enemyatt=-enemyatt;
}
if(prop[infor.fangju.type][infor.fangju.num].effect==12) {
if(rand()%10+1<=2) enemyatt=-enemyatt;
}
}
else enemyatt=0;
playeratt=infor.attack+prop[infor.wuqi.type][infor.wuqi.num].attack+effectplus(infor.wuqi.type,infor.wuqi.num);
if(playeratt>enemyatt+enemy.defend) {
if(enemyatt<0) printf("你反弹了boss伤害。\n");
printf("你造成了%d点伤害!\n",playeratt-enemyatt-enemy.defend);
enemy.blood-=playeratt-enemyatt-enemy.defend;
}
else {
if(enemyatt<0) printf("你反弹了boss伤害。\n");
printf("你没有造成伤害。\n");
if(playeratt+infor.defend<enemyatt) infor.blood-=enemyatt-playeratt-infor.defend;
}
if(prop[infor.wuqi.type][infor.wuqi.num].effect==2) feng=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==3) lei=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==4) shui=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==9) feng2=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==10) lei2=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==11) shui2=true;
Sleep(2000);
}
if(choose1=='2') {
for(int i=1; i<=enemy.checktime; i++) cout<<i<<'.'<<enemy.dooo[i].name<<' ';
cout<<endl;
cin>>choose2;
for(int i=1; i<=enemy.checktime; i++) {
if(choose2==(char)(i+48)) {
slowsay(enemy.dooo[i].result.huiying[cishu[i]].ch);
if(enemy.jia[i][cishu[i]]) cishu[i]++;
if(enemy.dooo[i].effect[cishu[i]]) {
switch(enemy.dooo[i].type[i]) {
case 1: {
if(enemy.dooo[i].effect>0) printf("%s的攻击提高了%d。\n",enemy.name,enemy.dooo[i].effect[cishu[i]]);
else printf("%s的攻击降低了%d!\n",enemy.name,-enemy.dooo[i].effect[cishu[i]]);
break;
}
case 2: {
if(enemy.dooo[i].effect>0) printf("%s的防御提高了%d。\n",enemy.name,enemy.dooo[i].effect[cishu[i]]);
else printf("%s的防御降低了%d!\n",enemy.name,-enemy.dooo[i].effect[cishu[i]]);
break;
}
}
}
Sleep(2000);
break;
}
}
if(cishu[choose2-'0']>=enemy.breaktime[choose2-'0']) {
mercy=true;
system("cls");
slowsay(enemy.dooo[cishu[choose2-'0']].mercy);
Sleep(2000);
}
}
if(choose1=='3') {
printbag();
cout<<"你想使用哪个?"<<endl;
int a;
cin>>a;
if(a>r) {
cout<<"呵呵,点错了?"<<endl;
Sleep(2000);
continue;
}
printf("你使用了%s。\n",prop[bag[a].type][bag[a].num].name);
Sleep(1000);
switch(prop[bag[a].type][bag[a].num].type) {
case 2:
if(infor.blood+prop[bag[a].type][bag[a].num].blood>=fullhp) {
cout<<"你的血量已满。"<<endl;
infor.blood=fullhp;
} else {
printf("你回复了%d点血量!\n",prop[bag[a].type][bag[a].num].blood);
infor.blood+=prop[bag[a].type][bag[a].num].blood;
}
infor.attack+=effectplus(bag[a].type,bag[a].num);
break;
case 1:
printf("你装备了%s。\n",prop[bag[a].type][bag[a].num].name);
if(infor.wuqi.num!=0&&infor.wuqi.type!=0) getitem_noout(infor.wuqi.type,infor.wuqi.num);
infor.wuqi.type=bag[a].type;
infor.wuqi.num=bag[a].num;
break;
case 3:
printf("你装备了%s。\n",prop[bag[a].type][bag[a].num].name);
if(infor.fangju.num!=0&&infor.fangju.type!=0) getitem_noout(infor.wuqi.type,infor.wuqi.num);
infor.fangju.type=bag[a].type;
infor.fangju.num=bag[a].num;
break;
}
deleteitem(a);
Sleep(2000);
}
}
if(infor.blood<=0) END();
enemynumber++;
if(enemy.blood<=0) {
switch(boss) {
case 5: {
enemy.blood=1;
refresh("会议室");
veryslowsay("......|年轻人,看来......|这就是结局吗?\n");
Sleep(1000);
veryslowsay("所以......\n");
Sleep(2000);
cout<<"你要怎么做呢?"<<endl;
cout<<"A.攻击 B.饶恕"<<endl;
cin>>choose1;
if(choose1=='A') {
cout<<"您选择了攻击。"<<endl;
cout<<"你造成了99999点伤害!"<<endl;
Sleep(1000);
print("太守被击杀了。\n",fire_plus);
Sleep(2000);
killednumber++;
infor.money+=40;
return true;
} else {
slowsay("什么?|你放过我了?\n");
Sleep(1000);
slowsay("年轻人,你真是善良啊......|你过去吧!\n");
Sleep(2000);
return false;
}
break;
}
case 7:{
enemy.blood=randnum(1,20);
refresh("青山");
slowsay("呼......|很明显!呼......你打不过我!\n");
Sleep(1000);
slowsay("所以,|我大发慈悲,|放你走!\n");
Sleep(1000);
slowsay("走吧!\n");
Sleep(2000);
printf("A.攻击 B.离开\n");
cin>>choose3;
if(choose3=='A') {
cout<<"你突然挥出一刀。"<<endl;
Sleep(1000);
slowsay("?????\n");
slowsay("年轻人,这是为什么?\n");
Sleep(2000);
veryslowsay("你 真 的 很 有 趣 。\n");
Sleep(2000);
print("他 死 了 。\n",fire_plus);
Sleep(1000);
infor.money+=150;
killednumber++;
return true;
}
else {
printf("再见!给你50M吧。\n");
Sleep(2000);
infor.money+=50;
return false;
}
break;
}
default: {
slowsay("你胜利了!\n");
if(enemy.money) cout<<"你获得了"<<enemy.money<<"M!"<<endl;
killednumber++;
infor.money+=enemy.money;
Sleep(2000);
return true;
break;
}
}
} else return false;
}
void juqing(int sence) {
int day=0;
lineset();
save(sence);
switch(sence) {
case 0:
cout<<"你在街上漫无目的地走着。"<<endl;
Sleep(1000);
cout<<"突然,有一个人走了过来。"<<endl;
Sleep(2000);
slowsay("你好!|你一定感觉很迷茫。|没事!|我来教你如何生存下去。\n");
Sleep(2000);
slowsay("很简单!|在陷入战斗时,选择\"1.攻击\"键!|一直攻击,直到胜利为止!\n");
Sleep(2000);
slowsay("我们来试一试吧!");
Sleep(2000);
choose1='3';
while(choose1!='1') {
system("cls");
printf("实验玩偶挡住了去路!剩余血量:1/1\n");
printf("%s 属性:\n血量:%d/%d 攻击:%d 防御:%d\n",infor.name,infor.blood,fullhp,infor.attack,infor.defend);
cout<<"您准备做什么?"<<endl;
cout<<"1.攻击 2.行动 3.物品"<<endl;
cin>>choose1;
if(choose1=='1') {
cout<<"您选择了攻击。"<<endl;
cout<<"BOSS先手攻击。"<<endl;
cout<<"武器属性:";
printeffect(prop[infor.wuqi.type][infor.wuqi.num].effect);
cout<<endl;
printf("你没有造成伤害。");
infor.blood-=99;
Sleep(2000);
if(prop[infor.wuqi.type][infor.wuqi.num].effect==2) feng=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==3) lei=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==4) shui=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==9) feng2=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==10) lei2=true;
if(prop[infor.wuqi.type][infor.wuqi.num].effect==11) shui2=true;
}
if(choose1=='3') {
printbag();
cout<<"你想使用哪个?"<<endl;
int a;
cin>>a;
if(a>r) {
printf("呵呵,点错了?\n");
Sleep(2000);
continue;
}
printf("你使用了%s。\n",prop[bag[a].type][bag[a].num].name);
Sleep(1000);
switch(prop[bag[a].type][bag[a].num].type) {
case 2:
if(infor.blood+prop[bag[a].type][bag[a].num].blood>=fullhp) {
cout<<"你的血量已满。"<<endl;
infor.blood=fullhp;
} else {
printf("你回复了%d点血量!\n",prop[bag[a].type][bag[a].num].blood);
infor.blood+=prop[bag[a].type][bag[a].num].blood;
}
infor.attack+=effectplus(bag[a].type,bag[a].num);
break;
case 1:
printf("你装备了%s。\n",prop[bag[a].type][bag[a].num].name);
if(infor.wuqi.num!=0&&infor.wuqi.type!=0) getitem_noout(infor.wuqi.type,infor.wuqi.num);
infor.wuqi.type=bag[a].type;
infor.wuqi.num=bag[a].num;
break;
case 3:
printf("你装备了%s。\n",prop[bag[a].type][bag[a].num].name);
if(infor.fangju.num!=0&&infor.fangju.type!=0) getitem_noout(infor.wuqi.type,infor.wuqi.num);
infor.fangju.type=bag[a].type;
infor.fangju.num=bag[a].num;
break;
}
deleteitem(a);
Sleep(2000);
}
}
print("(你损失了99滴血。)",jiangdi);
Sleep(2000);
system("cls");
slowsay("哈哈哈!|你只有强大,才能活下去!");
Sleep(1000);
slowsay("好好学本事吧!");
Sleep(2000);
infor.blood=100;
juqing(1);
break;
case 1:
cout<<"你的面前有2座武功学堂,你要去哪个呢?"<<endl;
cout<<"A.武林大会 B.老拳门"<<endl;
cin>>choose1;
if(choose1=='A') {
cout<<"你去了武林大会拜师。"<<endl;
Sleep(2000);
line=2;
juqing(sence+1);
} else {
cout<<"你去了老拳门拜师。"<<endl;
Sleep(2000);
line=3;
juqing(sence+2);
}
break;
case 2:
refresh("武林大会");
slowsay("你想入我门,需先过守门!\n");
Sleep(2000);
battle(1);
refresh("武林大会");
slowsay("好吧,你过来了。先给你一件N级武器备用。\n");
Sleep(2000);
srand(time(0));
getitem(1,rand()%3+1);
Sleep(1000);
slowsay("以后就是我教你了。\n");
Sleep(2000);
while(infor.attack<=30&&fullhp<=120) {
refresh("武林大会");
cout<<"第 ";
reservedint(++day);
cout<<" 天"<<endl;
if(infor.attack-fullhp+100>=10) {
slowsay("今天主攻耐力。\n");
Sleep(2000);
slowsay("我出拳,你按相反方向挡。左出右,右出左。\n");
Sleep(3000);
slowsay("开始!\n");
Sleep(1000);
int sum=0;
for(int i=1; i<=20; i++) {
system("cls");
int s;
srand(time(0));
int lr=rand()%2+1,lr2;
if(lr==1) cout<<" 左!"<<endl;
else cout<<" 右!"<<endl;
cout<<"总:";
reservedint(sum);
s=getch();
if(s==224) s=getch();
if(s==75) lr2=2;
if(s==77) lr2=1;
if(lr==lr2) sum++;
}
printf("好!总共做对了%d个!\n",sum);
Sleep(2000);
if(sum<15);
else {
cout<<"血量上限增加了5。"<<endl;
fullhp+=5;
}
Sleep(2000);
continue;
}
if(-infor.attack+fullhp-100>=5) {
slowsay("今天主攻攻击。\n");
Sleep(2000);
slowsay("我出拳,你按我出的拳来出拳。左出左,右出右。\n");
Sleep(3000);
slowsay("开始!\n");
Sleep(1000);
int sum=0;
for(int i=1; i<=20; i++) {
system("cls");
int s;
srand(time(0));
int lr=rand()%2+1,lr2;
if(lr==1) cout<<" 左!"<<endl;
else cout<<" 右!"<<endl;
cout<<"总:";
reservedint(sum);
s=getch();
if(s==224) s=getch();
if(s==75) lr2=1;
if(s==77) lr2=2;
if(lr==lr2) sum++;
}
printf("好!总共做对了%d个!\n",sum);
Sleep(2000);
if(sum<20);
else {
cout<<"攻击增加了10。"<<endl;
infor.attack+=10;
}
Sleep(2000);
continue;
}
slowsay("今天随意。\n");
Sleep(3000);
slowsay("开始!\n");
Sleep(1000);
int sum=0;
for(int i=1; i<=20; i++) {
system("cls");
int s;
srand(time(0));
int lr=rand()%2+1,lr2;
if(lr==1) cout<<" 左!"<<endl;
else cout<<" 右!"<<endl;
s=getch();
if(s==224) s=getch();
if(s==75) lr2=1;
if(s==77) lr2=2;
}
Sleep(2000);
cout<<"攻击增加了5,血量上限增加了10。"<<endl;
infor.attack+=5;
fullhp+=10;
Sleep(2000);
continue;
}
refresh("武林大会");
slowsay("你已经学满了,可以出山了。\n");
Sleep(2000);
slowsay("我先看看你有什么。\n");
Sleep(1000);
printbag();
Sleep(5000);
slowsay("哦,对了,先给你20M钱花。\n");
infor.money+=20;
Sleep(2000);
juqing(4);
break;
case 3:
slowsay("你是谁?\n");
Sleep(2000);
slowsay("我是");
slowsay(infor.name);
slowsay("。\n");
Sleep(2000);
slowsay("欢迎欢迎!给你一件R级防具吧。\n");
Sleep(1000);
srand(time(0));
getitem(2,rand()%2+7);
Sleep(2000);
slowsay("你要刻苦训练啊。\n");
Sleep(2000);
while(infor.defend<=30&&fullhp<=120) {
refresh("老拳门");
cout<<"第 ";
reservedint(++day);
cout<<" 天"<<endl;
if(infor.attack-fullhp+100>=10) {
slowsay("今天主攻耐力。\n");
Sleep(2000);
slowsay("我出拳,你按相反方向挡。左出右,右出左。\n");
Sleep(3000);
slowsay("开始!\n");
Sleep(1000);
int sum=0;
for(int i=1; i<=20; i++) {
system("cls");
int s;
srand(time(0));
int lr=rand()%2+1,lr2;
if(lr==1) cout<<" 左!"<<endl;
else cout<<" 右!"<<endl;
cout<<"总:";
reservedint(sum);
s=getch();
if(s==224) s=getch();
if(s==75) lr2=2;
if(s==77) lr2=1;
if(lr==lr2) sum++;
}
printf("好!总共做对了%d个!\n",sum);
Sleep(2000);
if(sum<15);
else {
cout<<"血量上限增加了5。"<<endl;
fullhp+=5;
}
Sleep(2000);
continue;
}
if(-infor.attack+fullhp-100>=5) {
slowsay("今天主攻防御。\n");
Sleep(2000);
slowsay("我出拳,你按我出的拳来出拳。左出左,右出右。\n");
Sleep(3000);
slowsay("开始!\n");
Sleep(1000);
int sum=0;
for(int i=1; i<=20; i++) {
system("cls");
int s;
srand(time(0));
int lr=rand()%2+1,lr2;
if(lr==1) cout<<" 左!"<<endl;
else cout<<" 右!"<<endl;
cout<<"总:";
reservedint(sum);
s=getch();
if(s==224) s=getch();
if(s==75) lr2=1;
if(s==77) lr2=2;
if(lr==lr2) sum++;
}
printf("好!总共做对了%d个!\n",sum);
Sleep(2000);
if(sum<20);
else {
cout<<"防御力增加了10。"<<endl;
infor.defend+=10;
}
Sleep(2000);
continue;
}
slowsay("今天随意。\n");
Sleep(3000);
slowsay("开始!\n");
Sleep(1000);
int sum=0;
for(int i=1; i<=20; i++) {
system("cls");
int s;
srand(time(0));
int lr=rand()%2+1,lr2;
if(lr==1) cout<<" 左!"<<endl;
else cout<<" 右!"<<endl;
s=getch();
if(s==224) s=getch();
if(s==75) lr2=1;
if(s==77) lr2=2;
}
Sleep(2000);
cout<<"防御增加了5,血量上限增加了10。"<<endl;
infor.defend+=5;
fullhp+=10;
Sleep(2000);
continue;
}
slowsay("很不错啊,你已经可以出师了!\n");
Sleep(2000);
slowsay("给你30M花吧。\n");
infor.money+=30;
Sleep(4000);
juqing(4);
break;
case 4:
refresh("门外");
cout<<"你离开了学府,继续往外走。"<<endl;
Sleep(2000);
juqing(5);
break;
case 5:
do {
refresh("集市");
cout<<"1.装备铺"<<endl;
cout<<"2.驿站(旅馆)"<<endl;
cout<<"3.管理背包"<<endl;
cout<<"4.继续向前"<<endl;
cout<<"你想干什么?"<<endl;
cin>>choose1;
switch(choose1) {
case '1':
shop(1);
break;
case '2':
lvguan(20);
break;
case '3': {
printbag();
cout<<"你想管理哪一个?"<<endl;
cin>>choose2;
if(int(choose2-'0')>r) {
cout<<"呵呵,点错了?"<<endl;
Sleep(2000);
continue;
}
cout<<"1.使用 2.丢弃"<<endl;
cin>>choose3;
int a=choose2-'0';
if(choose3=='1') {
printf("你使用了%s。\n",prop[bag[a].type][bag[a].num].name);
Sleep(1000);
switch(prop[bag[a].type][bag[a].num].type) {
case 2:
if(infor.blood+prop[bag[a].type][bag[a].num].blood>=fullhp) {
cout<<"你的血量已满。"<<endl;
infor.blood=fullhp;
} else {
printf("你回复了%d点血量!\n",prop[bag[a].type][bag[a].num].blood);
infor.blood+=prop[bag[a].type][bag[a].num].blood;
}
infor.attack+=effectplus(bag[a].type,bag[a].num);
break;
case 1:
printf("你装备了%s。\n",prop[bag[a].type][bag[a].num].name);
if(infor.wuqi.num!=0&&infor.wuqi.type!=0) getitem_noout(infor.wuqi.type,infor.wuqi.num);
infor.wuqi.type=bag[a].type;
infor.wuqi.num=bag[a].num;
break;
case 3:
printf("你装备了%s。\n",prop[bag[a].type][bag[a].num].name);
if(infor.fangju.num!=0&&infor.fangju.type!=0) getitem_noout(infor.wuqi.type,infor.wuqi.num);
infor.fangju.type=bag[a].type;
infor.fangju.num=bag[a].num;
break;
}
deleteitem(a);
Sleep(2000);
} else {
printf("你丢弃了%s。\n",prop[bag[a].type][bag[a].num].name);
deleteitem(a);
Sleep(2000);
}
break;
}
case '4':
break;
}
} while(choose1!='4');
cout<<"你离开了集市,继续前进。"<<endl;
Sleep(2000);
juqing(6);
break;
case 6:
refresh("集市旁边");
cout<<"一个老妇人在伤心的哭泣。"<<endl;
slowsay("我的儿子在皇城里,几年没有回来了。\n");
Sleep(1000);
cout<<"你要做什么?"<<endl<<"A.我帮你救他吧 B.侮辱"<<endl;
cin>>choose1;
if(choose1=='A') {
slowsay("谢谢!一路向前,就是皇城了!\n");
Sleep(2000);
} else {
slowsay("你竟敢侮辱我!!!\n");
Sleep(2000);
battle(2);
cout<<"也许,皇城里有许多财宝呢。"<<endl;
cout<<"去看看吧。"<<endl;
Sleep(3000);
}
if(line==2) juqing(7);
else juqing(8);
break;
case 7: {
refresh("大路");
cout<<"你往前走着。"<<endl;
Sleep(2000);
slowsay("嘿!");
Sleep(500);
slowsay("站住!\n");
Sleep(2000);
slowsay("把钱交出来!不然就死!\n");
Sleep(1000);
if(infor.money>5) {
cout<<"交不交给强盗钱呢?"<<endl;
printf("A.交出%dM。B.死也不交!\n",infor.money-5);
cin>>choose1;
if(choose1=='A') {
printf("你交了%dM。\n强盗放走了你。\n");
infor.money=5;
Sleep(2000);
} else {
cout<<"你不交钱。"<<endl;
Sleep(2000);
cout<<"强盗来攻击你了!"<<endl;
Sleep(2000);
battle(3);
refresh("大路");
slowsay("年轻人,|我留个名,|我叫......|荀全...|你......|愿你走不出这城!\n");
Sleep(2000);
print("(强盗死了)\n",jiangdi);
Sleep(2000);
}
juqing(8);
break;
} else {
cout<<"你没有钱。"<<endl;
Sleep(2000);
cout<<"强盗来攻击你了!"<<endl;
Sleep(2000);
battle(3);
refresh("大路");
slowsay("年轻人,|我留个名,|我叫......|荀全...|你......|愿你走不出这城!\n");
Sleep(2000);
print("(强盗死了)\n",jiangdi);
Sleep(2000);
}
}
case 8: {
refresh("城门");
cout<<"听说负责人民进出的太守脾气不好。"<<endl;
Sleep(1000);
cout<<"你左思右想,还是去见他了。"<<endl;
Sleep(2000);
if(line==2) juqing(9);
else juqing(10);
break;
}
case 9: {
refresh("会议室");
slowsay("让我......|开门让你出去?\n");
Sleep(1000);
slowsay("唉......|我有个朋友,名叫荀全......\n");
Sleep(1000);
print("(你听到这个名字,不禁颤抖了一下。)\n",jiangdi);
Sleep(2000);
slowsay("什么?你知道他??莫非......|莫非");
veryslowsay("......");
if(battle(4)) {
system("cls");
slowsay("唉......|荀......|全......");
veryslowsay("............");
Sleep(2000);
juqing(12);
} else {
system("cls");
slowsay("哦,你和他不认识啊。|好吧,我让你出去!\n");
Sleep(2000);
juqing(11);
}
break;
}
case 10: {
refresh("会议室");
slowsay("让我开门让你出去?\n");
Sleep(1000);
slowsay("所以......|很高兴认识你......\n");
Sleep(2000);
SetConsoleTextAttribute(handle,fire_plus);
veryslowsay("再见。\n");
SetConsoleTextAttribute(handle,simple);
Sleep(5000);
if(battle(5)) {
cout<<"你击败了太守,继续向前。"<<endl;
Sleep(3000);
juqing(12);
} else {
cout<<"你和太守道别,继续向前。"<<endl;
Sleep(3000);
juqing(11);
}
break;
}
case 11:{
refresh("大路");
cout<<"你又遇到了那个最开始骗你的人。"<<endl;
Sleep(1000);
if(line==1) {
slowsay("嘻嘻,尽管你放过了他......\n");
Sleep(1000);
SetConsoleTextAttribute(handle,fire_plus);
slowsay("你的手上仍沾满鲜血。\n");
SetConsoleTextAttribute(handle,simple);
Sleep(1000);
slowsay("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈!\n");
Sleep(2000);
}
else {
slowsay("你真是不听劝。\n|我说过要一直攻击的!!!\n");
Sleep(2000);
}
juqing(13);
break;
}
case 12:{
refresh("大路");
cout<<"你又遇到了那个最开始骗你的人。"<<endl;
Sleep(1000);
slowsay("他真是蠢啊,不想放走你......\n");
Sleep(1000);
SetConsoleTextAttribute(handle,fire_plus);
slowsay("却浪费了自己的生命!\n");
SetConsoleTextAttribute(handle,simple);
if(line==2) {
slowsay("所以,你和我一样,|对吧?\n");
SetConsoleTextAttribute(handle,fire_plus);
veryslowsay("让我们把这个世界毁掉吧。\n");
SetConsoleTextAttribute(handle,simple);
Sleep(2000);
juqing(14);
}
else juqing(13);
break;
}
case 13: {
refresh("大路");
cout<<"你在路上走着,突然有一个人出现了。"<<endl;
Sleep(1000);
slowsay("你好,我叫郭傻,你是个时间旅行者吗?\n");
Sleep(1000);
slowsay("那就不好了,我哥哥是禁卫军的,他每天都在搜捕旅行者。\n");
Sleep(1000);
slowsay("快,躲到我家的床底下。");
Sleep(3000);
juqing(15);
break;
}
case 14: {
cout<<"你在路上走着,突然有一个人出现了。"<<endl;
Sleep(1000);
slowsay("你好,我叫郭傻......|最近我听说有座城的太守被杀了......\n|算了,管他呢。\n");
Sleep(1000);
slowsay("所以,你是个时间旅行者?\n");
Sleep(2000);
slowsay("那就不好了,我哥哥是禁卫军的,他每天都在搜捕旅行者。\n");
Sleep(1000);
slowsay("你快跑吧!\n");
Sleep(2000);
juqing(17);
break;
}
case 15: {
refresh("郭傻家的床底下");
print("(你听到了一段对话。)\n",jiangdi);
Sleep(2000);
SetConsoleTextAttribute(handle,FOREGROUND_INTENSITY);
slowsay("嘿,你回来了?|抓住人了吗?\n||");
slowsay("没有!!!|可恶,我一定要抓住一个!\n||");
print("郭傻的哥哥走了。\n",jiangdi);
Sleep(2000);
slowsay("出来吧,|他走了。\n");
Sleep(1000);
slowsay("给你50M花吧,可怜的孩子。\n");
infor.money+=50;
Sleep(2000);
juqing(16);
break;
}
case 16: {
refresh("羊肠小道");
cout<<"你走着走着,突然遇到了一个小商铺。"<<endl;
Sleep(2000);
shop(2);
refresh("羊肠小道");
cout<<"你离开了。"<<endl;
juqing(17);
break;
}
case 17:{
do {
refresh("郭家村");
cout<<"1.驿站(旅馆)"<<endl;
cout<<"2.管理背包"<<endl;
cout<<"3.继续向前"<<endl;
cout<<"你想干什么?"<<endl;
cin>>choose1;
switch(choose1) {
case '1':
lvguan(20);
break;
case '2': {
printbag();
cout<<"你想管理哪一个?"<<endl;
cin>>choose2;
if(int(choose2-'0')>r) {
cout<<"呵呵,点错了?"<<endl;
Sleep(2000);
continue;
}
cout<<"1.使用 2.丢弃"<<endl;
cin>>choose3;
int a=choose2-'0';
if(choose3=='1') {
printf("你使用了%s。\n",prop[bag[a].type][bag[a].num].name);
Sleep(1000);
switch(prop[bag[a].type][bag[a].num].type) {
case 2:
if(infor.blood+prop[bag[a].type][bag[a].num].blood>=fullhp) {
cout<<"你的血量已满。"<<endl;
infor.blood=fullhp;
} else {
printf("你回复了%d点血量!\n",prop[bag[a].type][bag[a].num].blood);
infor.blood+=prop[bag[a].type][bag[a].num].blood;
}
infor.attack+=effectplus(bag[a].type,bag[a].num);
break;
case 1:
printf("你装备了%s。\n",prop[bag[a].type][bag[a].num].name);
if(infor.wuqi.num!=0&&infor.wuqi.type!=0) getitem_noout(infor.wuqi.type,infor.wuqi.num);
infor.wuqi.type=bag[a].type;
infor.wuqi.num=bag[a].num;
break;
case 3:
printf("你装备了%s。\n",prop[bag[a].type][bag[a].num].name);
if(infor.fangju.num!=0&&infor.fangju.type!=0) getitem_noout(infor.fangju.type,infor.fangju.num);
infor.fangju.type=bag[a].type;
infor.fangju.num=bag[a].num;
break;
}
deleteitem(a);
Sleep(2000);
} else {
printf("你丢弃了%s。\n",prop[bag[a].type][bag[a].num].name);
deleteitem(a);
Sleep(2000);
}
break;
}
case '3':
break;
}
} while(choose1!='3');
cout<<"你离开了这个友好的村庄,继续前进"<<endl;
Sleep(2000);
juqing(18);
break;
}
case 18:{
refresh("青山路");
cout<<"前面就是当地人叫做“青山”的一座山。"<<endl;
Sleep(1000);
cout<<"这是前往皇城的必经之路。"<<endl;
Sleep(2000);
slowsay("嘿!|你!|站住!\n");
Sleep(1000);
cout<<"原来是郭傻的哥哥!"<<endl;
Sleep(2000);
if(line==2) {
slowsay("你是谁?|你要过去吗?\n");
Sleep(1000);
slowsay("再见!\n");
Sleep(1000);
battle(6);
}
else {
slowsay("站住!!!|你是谁?\n");
Sleep(2000);
slowsay("你一定是时间旅行者!不要跑!\n");
Sleep(1000);
battle(7);
}
break;
}
}
}
void lvguan(int cost) {
printf("住一宿要%dM。\n",cost);
cout<<"要住吗?"<<endl<<"A.要 B.不要"<<endl;
cin>>choose2;
if(choose2=='A') {
if(infor.money<cost) {
printf("你的钱不够。\n");
Sleep(3000);
return;
}
infor.money-=cost;
veryslowsay("zzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzz......\n");
Sleep(2000);
cout<<"睡得不错哦!"<<endl;
Sleep(2000);
infor.blood+=20;
if(infor.blood>fullhp) infor.blood=fullhp;
} else {
cout<<"你走开了。"<<endl;
Sleep(2000);
}
}
void shop(int a) {
shopp sh[5];
switch(a) {
case 1:
sh[1].thing.type=2;
sh[1].thing.num=rand()%8+1;
sh[1].money=15;
sh[2].thing.type=3;
sh[2].thing.num=1;
sh[2].money=27;
sh[3].thing.type=2;
sh[3].thing.num=8;
sh[3].money=20;
sh[4].thing.type=2;
sh[4].thing.num=4;
sh[4].money=17;
break;
case 2: {
sh[1].thing.type=2;
sh[1].thing.num=6;
sh[1].money=18;
sh[2].thing.type=3;
sh[2].thing.num=rand()%2+7;
sh[2].money=46;
sh[3].thing.type=1;
sh[3].thing.num=rand()%7+1;
sh[3].money=13;
sh[4].thing.type=3;
sh[4].thing.num=rand()%8+1;
sh[4].money=39;
break;
}
}
while(choose1!='5') {
system("cls");
printf("当前余额:%d\n",infor.money);
for(int i=1; i<=4; i++) {
printf("%d %s 属性:",i,prop[sh[i].thing.type][sh[i].thing.num].name);
printeffect(prop[sh[i].thing.type][sh[i].thing.num].effect);
cout<<" ";
switch(sh[i].thing.type) {
case 1:
reserved("N");
break;
case 2:
SetConsoleTextAttribute(handle,water_plus);
cout<<"R";
SetConsoleTextAttribute(handle,simple);
break;
case 3:
SetConsoleTextAttribute(handle,fantan_plus);
cout<<"SR";
SetConsoleTextAttribute(handle,simple);
break;
case 4:
SetConsoleTextAttribute(handle,thunder_plus);
cout<<"SSR";
SetConsoleTextAttribute(handle,simple);
break;
}
cout<<"级";
switch(prop[sh[i].thing.type][sh[i].thing.num].type) {
case 1:
print("武器",simple);
break;
case 2:
print("食物",simple);
break;
case 3:
print("护具",simple);
break;
}
printf(" 价格:%d\n",sh[i].money);
}
cout<<"5 离开"<<endl;
cout<<"你想购买哪一个?"<<endl;
cin>>choose1;
if(choose1!='5') {
if(infor.money<sh[choose1-'0'].money) {
cout<<"你的钱不够。"<<endl;
} else {
printf("你购买了%s。\n",prop[sh[choose1-'0'].thing.type][sh[choose1-'0'].thing.num].name);
infor.money-=sh[choose1-'0'].money;
getitem(sh[choose1-'0'].thing.type,sh[choose1-'0'].thing.num);
}
} else cout<<"再见!"<<endl;
Sleep(2000);
}
}
int main() {
SetConsoleTitle("武侠传奇");
ifstream fin;
fin.open("cundang.txt");
int a;
fin>>a;
if(a==0) {
print("Please enter the password.\n",fire_plus);
cin>>password;
check();
Sleep(2000);
}
fin.close();
strcpy(prop[1][1].name,"剑");
prop[1][1].type=1;
prop[1][1].blood=0;
prop[1][1].attack=5;
prop[1][1].defend=0;
prop[1][1].effect=0;
prop[1][1].color=15;
strcpy(prop[1][2].name,"大刀");
prop[1][2].type=1;
prop[1][2].blood=0;
prop[1][2].attack=6;
prop[1][2].defend=0;
prop[1][2].effect=0;
prop[1][2].color=15;
strcpy(prop[1][3].name,"弓");
prop[1][3].type=1;
prop[1][3].blood=0;
prop[1][3].attack=7;
prop[1][3].defend=0;
prop[1][3].effect=0;
prop[1][3].color=15;
strcpy(prop[1][4].name,"小鱼干");
prop[1][4].type=2;
prop[1][4].blood=3;
prop[1][4].attack=0;
prop[1][4].defend=0;
prop[1][4].effect=0;
prop[1][4].color=15;
strcpy(prop[1][5].name,"面包");
prop[1][5].type=2;
prop[1][5].blood=4;
prop[1][5].attack=0;
prop[1][5].defend=0;
prop[1][5].effect=0;
prop[1][5].color=15;
strcpy(prop[1][6].name,"皮甲");
prop[1][6].type=3;
prop[1][6].blood=0;
prop[1][6].attack=0;
prop[1][6].defend=3;
prop[1][6].effect=0;
prop[1][6].color=15;
strcpy(prop[1][7].name,"头盔");
prop[1][7].type=3;
prop[1][7].blood=0;
prop[1][7].attack=0;
prop[1][7].defend=4;
prop[1][7].effect=0;
prop[1][7].color=15;
strcpy(prop[2][1].name,"利剑");
prop[2][1].type=1;
prop[2][1].blood=0;
prop[2][1].attack=15;
prop[2][1].defend=0;
prop[2][1].effect=0;
prop[2][1].color=15;
strcpy(prop[2][2].name,"宝刀");
prop[2][2].type=1;
prop[2][2].blood=0;
prop[2][2].attack=14;
prop[2][2].defend=0;
prop[2][2].effect=0;
prop[2][2].color=15;
strcpy(prop[2][3].name,"飞镖");
prop[2][3].type=1;
prop[2][3].blood=0;
prop[2][3].attack=14;
prop[2][3].defend=0;
prop[2][3].effect=0;
prop[2][3].color=15;
strcpy(prop[2][4].name,"火炎团扇");
prop[2][4].type=1;
prop[2][4].blood=0;
prop[2][4].attack=10;
prop[2][4].defend=0;
prop[2][4].effect=1;
prop[2][4].color=4;
strcpy(prop[2][5].name,"r狗");
prop[2][5].type=2;
prop[2][5].blood=7;
prop[2][5].attack=0;
prop[2][5].defend=0;
prop[2][5].effect=6;
prop[2][5].color=1;
strcpy(prop[2][6].name,"老八的食物");
prop[2][6].type=2;
prop[2][6].blood=10;
prop[2][6].attack=0;
prop[2][6].defend=0;
prop[2][6].effect=7;
prop[2][6].color=8;
strcpy(prop[2][7].name,"锁子甲");
prop[2][7].type=3;
prop[2][7].blood=0;
prop[2][7].attack=0;
prop[2][7].defend=7;
prop[2][7].effect=0;
prop[2][7].color=15;
strcpy(prop[2][8].name,"精金甲");
prop[2][8].type=3;
prop[2][8].blood=0;
prop[2][8].attack=0;
prop[2][8].defend=5;
prop[2][8].effect=5;
prop[2][8].color=5;
strcpy(prop[3][1].name,"火龙剑");
prop[3][1].type=1;
prop[3][1].blood=0;
prop[3][1].attack=21;
prop[3][1].defend=0;
prop[3][1].effect=8;
prop[3][1].color=12;
strcpy(prop[3][2].name,"风魔扇");
prop[3][2].type=1;
prop[3][2].blood=0;
prop[3][2].attack=25;
prop[3][2].defend=0;
prop[3][2].effect=2;
prop[3][2].color=2;
strcpy(prop[3][3].name,"雷之剑");
prop[3][3].type=1;
prop[3][3].blood=0;
prop[3][3].attack=23;
prop[3][3].defend=0;
prop[3][3].effect=3;
prop[3][3].color=6;
strcpy(prop[3][4].name,"寒冰之刃");
prop[3][4].type=1;
prop[3][4].blood=0;
prop[3][4].attack=20;
prop[3][4].defend=0;
prop[3][4].effect=11;
prop[3][4].color=11;
strcpy(prop[3][5].name,"火烤马步鱼");
prop[3][5].type=2;
prop[3][5].blood=21;
prop[3][5].attack=0;
prop[3][5].defend=0;
prop[3][5].effect=13;
prop[3][5].color=9;
strcpy(prop[3][6].name,"“魔手牌”饮料");
prop[3][6].type=2;
prop[3][6].blood=24;
prop[3][6].attack=0;
prop[3][6].defend=0;
prop[3][6].effect=0;
prop[3][6].color=15;
strcpy(prop[3][7].name,"皇帝的新装");
prop[3][7].type=3;
prop[3][7].blood=0;
prop[3][7].attack=0;
prop[3][7].defend=14;
prop[3][7].effect=0;
prop[3][7].color=15;
strcpy(prop[3][8].name,"王之铠甲(盗版)");
prop[3][8].type=3;
prop[3][8].blood=0;
prop[3][8].attack=0;
prop[3][8].defend=9;
prop[3][8].effect=12;
prop[3][8].color=13;
strcpy(prop[4][1].name,"烈焰");
prop[4][1].type=1;
prop[4][1].blood=0;
prop[4][1].attack=43;
prop[4][1].defend=0;
prop[4][1].effect=8;
prop[4][1].color=12;
strcpy(prop[4][2].name,"千里冰封");
prop[4][2].type=1;
prop[4][2].blood=0;
prop[4][2].attack=44;
prop[4][2].defend=0;
prop[4][2].effect=11;
prop[4][2].color=11;
strcpy(prop[4][3].name,"雷霆战锤");
prop[4][3].type=1;
prop[4][3].blood=0;
prop[4][3].attack=42;
prop[4][3].defend=0;
prop[4][3].effect=10;
prop[4][3].color=14;
strcpy(prop[4][4].name,"狂·风魔扇");
prop[4][4].type=1;
prop[4][4].blood=0;
prop[4][4].attack=43;
prop[4][4].defend=0;
prop[4][4].effect=9;
prop[4][4].color=10;
strcpy(prop[4][5].name,"豪华烤串");
prop[4][5].type=2;
prop[4][5].blood=33;
prop[4][5].attack=0;
prop[4][5].defend=0;
prop[4][5].effect=13;
prop[4][5].color=9;
strcpy(prop[4][6].name,"饕餮盛宴");
prop[4][6].type=2;
prop[4][6].blood=40;
prop[4][6].attack=0;
prop[4][6].defend=0;
prop[4][6].effect=0;
prop[4][6].color=15;
strcpy(prop[4][7].name,"巧克力味冰棍");
prop[4][7].type=2;
prop[4][7].blood=35;
prop[4][7].attack=0;
prop[4][7].defend=0;
prop[4][7].effect=0;
prop[4][7].color=15;
strcpy(prop[4][8].name,"真·王之铠甲");
prop[4][8].type=3;
prop[4][8].blood=0;
prop[4][8].attack=0;
prop[4][8].defend=25;
prop[4][8].effect=5;
prop[4][8].color=5;
strcpy(prop[4][9].name,"金丝玉缕");
prop[4][9].type=3;
prop[4][9].blood=0;
prop[4][9].attack=0;
prop[4][9].defend=30;
prop[4][9].effect=0;
prop[4][9].color=15;
strcpy(prop[4][10].name,"C-12聚合纤维(碳纤维)护甲");
prop[4][10].type=3;
prop[4][10].blood=0;
prop[4][10].attack=0;
prop[4][10].defend=28;
prop[4][10].effect=12;
prop[4][10].color=13;
strcpy(prop[4][11].name,"聚变核心的光芒");
prop[4][11].type=1;
prop[4][11].blood=0;
prop[4][11].attack=49;
prop[4][11].defend=0;
prop[4][11].effect=8;
prop[4][11].color=12;
cout<<"凌晨1:30,你还在看武侠小说......"<<endl;
Sleep(2000);
cout<<"哦!该睡了。"<<endl;
Sleep(2000);
cout<<"你的头一沾枕头,便被拽入了一个奇怪的世界......"<<endl;
Sleep(3000);
system("cls");
r=0;
fin.open("cundang.txt");
bool yes;
fin>>yes;
fin.close();
if(yes) {
reserved("\n1.载入存档 2.新游戏\n");
cin>>choose1;
if(choose1=='1') {
fin.open("save.txt");
fin>>fullhp>>infor.name>>infor.blood>>infor.attack>>infor.defend>>infor.money;
int x,game;
fin>>x;
fin>>infor.wuqi.type>>infor.wuqi.num;
fin>>infor.fangju.type>>infor.fangju.num;
for(int i=1; i<=x; i++) {
int m,n;
fin>>m>>n;
getitem_noout(m,n);
}
fin>>game>>line;
fin>>enemynumber>>killednumber;
fin.close();
juqing(game);
} else {
cout<<"开始新游戏"<<endl;
Sleep(2000);
chongzhi();
juqing(0);
}
} else {
cout<<"\n1.载入存档 ";
reserved("2.新游戏\n");
cin>>choose1;
if(choose1=='1') {
cout<<"无存档,开始新游戏"<<endl;
Sleep(2000);
chongzhi();
juqing(0);
} else {
cout<<"开始新游戏"<<endl;
Sleep(2000);
chongzhi();
juqing(0);
}
}
return 0;
}