game.cpp 21.7 KB
Newer Older
struct_cym's avatar
struct_cym 已提交
1 2 3 4 5 6
/*
关于所有函数的解释
main12:主界面 
main: 一开始进入的主界面
board: 一些选项
其它的可以百度一下,都是英文(有些是拼音) 
struct_cym's avatar
struct_cym 已提交
7 8 9 10 11


有重要的变量 
option:通用选择 
 
struct_cym's avatar
struct_cym 已提交
12 13 14 15 16 17 18 19 20 21
 
游戏说明:

此游戏包含很多玩法
有迷宫,技能,等级制,战斗等等

可以自由去探索 



struct_cym's avatar
struct_cym 已提交
22
*/
struct_cym's avatar
struct_cym 已提交
23

struct_cym's avatar
struct_cym 已提交
24
#include <bits/stdc++.h>
struct_cym's avatar
struct_cym 已提交
25 26 27 28 29 30 31
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
struct_cym's avatar
struct_cym 已提交
32
#include <conio.h>
struct_cym's avatar
struct_cym 已提交
33 34
using namespace std;

struct_cym's avatar
struct_cym 已提交
35
int main12();	 
struct_cym's avatar
struct_cym 已提交
36 37 38
void start();
void board();
void maps();	
struct_cym's avatar
struct_cym 已提交
39
void bag();//bug 可以先看一下,不知道出了什么问题 
struct_cym's avatar
struct_cym 已提交
40
void box();
struct_cym's avatar
struct_cym 已提交
41
void equips();//装备   未完成 
struct_cym's avatar
struct_cym 已提交
42
void skill_board();//技能板   未完成 
struct_cym's avatar
struct_cym 已提交
43
void lingdong();
struct_cym's avatar
struct_cym 已提交
44
void zhanchang();//未完成 
struct_cym's avatar
struct_cym 已提交
45 46
void shenming(); 
void huo(); 
struct_cym's avatar
struct_cym 已提交
47 48 49 50 51
void bin();//未完成 
void jin();//未完成 
void shu();//未完成 
void lu();//未完成 
void equip_bag();//未完成 
struct_cym's avatar
struct_cym 已提交
52 53 54 55
int shanghai(double gong);
int jianshang(double fang);
int boss_shanghai(double gong);
void pretreatment();
struct_cym's avatar
struct_cym 已提交
56 57 58 59 60 61
void ten();
void eleven();
void twelve();
void thirteen();
void fourteen();
void fifteen(); 
struct_cym's avatar
struct_cym 已提交
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
const int N=1e3+10;

struct op{
	string name;
	string lei;
	string fangyu;
	string gongji;
}equip_attributes[N];

struct xh{
	int cnn; 
	string bag;
}bags[N];

struct xu{
	int cnn;
	string boxx;
}boxs[N];

struct_cym's avatar
struct_cym 已提交
81
bool jineng[100];
struct_cym's avatar
struct_cym 已提交
82 83 84 85 86
int grade=1;
int blood[101]={0,100};
int experience[101];
string name;
int option,attribute,flag_box[N],flag_bag[N],exits,savage,times,attack=1,defense=1;
struct_cym's avatar
struct_cym 已提交
87 88
int jinyan;
int baoji=5;
struct_cym's avatar
struct_cym 已提交
89
int sum_level[101]={};
struct_cym's avatar
struct_cym 已提交
90
bool ops[N];
struct_cym's avatar
struct_cym 已提交
91 92 93 94 95
string head,body,trousers,shoes;


int main(){
	start();
struct_cym's avatar
struct_cym 已提交
96
	pretreatment();
struct_cym's avatar
struct_cym 已提交
97 98
	cout<<endl<<"请输入你所要的属性"<<endl; 
	cout<<"1.金   2.木   3.水   4.火   5.土";
struct_cym's avatar
struct_cym 已提交
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
	cin>>attribute;
	board();
	cin>>option;
	if(option==1){
		maps();
		if(exits==1){
			return 0;
		}
		main12();
	}else if(option==2){
		bag();
		main12();
	}else if(option==3){
		box();
		main12();
	}else if(option==4){
struct_cym's avatar
struct_cym 已提交
115
		equips();
struct_cym's avatar
struct_cym 已提交
116 117 118 119 120 121 122 123 124 125 126 127 128
		main12();
	}else if(option==5){
		skill_board();
		main12();
	}
}


void start(){
	cout<<"Welcome to AXX";
	cout<<endl;
	cout<<"Please wait a moment"<<endl;
	Sleep(1000);
struct_cym's avatar
struct_cym 已提交
129
	cout<<"请输入你的名字"<<endl;
struct_cym's avatar
struct_cym 已提交
130 131 132 133 134
	cin>>name;
}

void pretreatment(){
	int num=1;
struct_cym's avatar
struct_cym 已提交
135
	for(int i=100;i<=10000;i+=100){
struct_cym's avatar
struct_cym 已提交
136 137 138 139 140 141 142 143 144 145 146
		blood[num]=i;
		experience[num]=i;
		num++;
	}
	for(int i=1;i<=100;i++){
		bags[i-1].cnn=i;
	}
}

void board(){
	cout<<endl<<endl<<endl;
struct_cym's avatar
struct_cym 已提交
147
	cout<<"姓名:"<<name<<endl;
struct_cym's avatar
struct_cym 已提交
148
	cout<<"境界"<<endl;	//暂不开放 
struct_cym's avatar
struct_cym 已提交
149 150 151
	cout<<"等级:"<<grade<<endl;
	cout<<"血量:"<<blood[grade]<<endl;
	cout<<"属性:";
struct_cym's avatar
struct_cym 已提交
152
	if(attribute==1){
struct_cym's avatar
struct_cym 已提交
153
		cout<<"金"<<endl; 
struct_cym's avatar
struct_cym 已提交
154
	}else if(attribute==2){
struct_cym's avatar
struct_cym 已提交
155
		cout<<"木"<<endl;
struct_cym's avatar
struct_cym 已提交
156
	}else if(attribute==3){
struct_cym's avatar
struct_cym 已提交
157
		cout<<"水"<<endl; 
struct_cym's avatar
struct_cym 已提交
158
	}else if(attribute==4){
struct_cym's avatar
struct_cym 已提交
159
		cout<<"火"<<endl; 
struct_cym's avatar
struct_cym 已提交
160
	}else {
struct_cym's avatar
struct_cym 已提交
161
		cout<<"土"<<endl;
struct_cym's avatar
struct_cym 已提交
162
	}
struct_cym's avatar
struct_cym 已提交
163 164
	cout<<"攻击:"<<attack<<endl;
	cout<<"防御:"<<defense<<endl;
struct_cym's avatar
struct_cym 已提交
165
	Sleep(1000);
struct_cym's avatar
struct_cym 已提交
166
	cout<<"1.地图   "<<"2.背包   "<<"3.精灵箱   "<<"4.装备   "<<"5.技能板   "<<endl; 
struct_cym's avatar
struct_cym 已提交
167 168 169
}

void maps(){
struct_cym's avatar
struct_cym 已提交
170 171
	cout<<"1.灵洞   "<<"2.战场   "<<"3.生命之树   "<<"4.流火之地   "<<"5.深海之地   "<<endl;
	cout<<"6.铁金山   "<<"7.恶魔树林   "<<"8.阿比努斯的大陆沙漠   "<<"9.退出";
struct_cym's avatar
struct_cym 已提交
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
	cin>>option;
	if(option==1){
		lingdong();
		main12();
	}else if(option==2){
		zhanchang();
		main12();
	}else if(option==3){
		shenming();
		main12();
	}else if(option==4){
		huo();
		main12();
	}else if(option==5){
		bin();
		main12();
	}else if(option==6){
		jin();
		main12();
	}else if(option==7){
		shu();
		main12();
	}else if(option==8){
		lu();
		main12();
	}else{
		exits=1;
	} 
}

void bag(){									//bug 
	int sum=0;
	for(int i=0;i<=20;i++){
		for(int j=0;j<5;j++){
			if(!flag_bag[i])
			cout<<bags[i].cnn<<":"<<bags[i].bag[j]<<" ";
		} 
		cout<<endl;
	}
	cout<<endl;
struct_cym's avatar
struct_cym 已提交
212
	cout<<"1.丢弃";
struct_cym's avatar
struct_cym 已提交
213 214
	cin>>option;
	if(option==1){
struct_cym's avatar
struct_cym 已提交
215
		cout<<"请输入丢弃的序号";
struct_cym's avatar
struct_cym 已提交
216 217 218 219 220 221 222
		cin>>option;
		for(int i=0;i<100;i++){
			if(option==bags[i].cnn){
				flag_bag[i]=1;
				for(int j=i+1;j<100;j++){
					bags[j].cnn--;
				}
struct_cym's avatar
struct_cym 已提交
223
				cout<<"丢弃成功"; 
struct_cym's avatar
struct_cym 已提交
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
				return;
			}
		}
	}
}

void box(){
	int sum=0;
	for(int i=0;i<20;i++){
		for(int j=0;j<5;j++){
			if(!flag_box[i])
			cout<<boxs[i].cnn<<":"<<boxs[i].boxx[j]<<" ";
		} 
		cout<<endl;
	}
	cout<<endl;
struct_cym's avatar
struct_cym 已提交
240
	cout<<"1.丢弃";
struct_cym's avatar
struct_cym 已提交
241 242 243
	cin>>option;
	if(option==1){
		Sleep(1000);
struct_cym's avatar
struct_cym 已提交
244
		cout<<"请输入丢弃的序号";
struct_cym's avatar
struct_cym 已提交
245 246 247 248 249 250 251
		cin>>option;
		for(int i=0;i<100;i++){
			if(option==bags[i].cnn){
				flag_box[i]=1;
				for(int j=i+1;j<100;j++){
					bags[j].cnn--;
				}
struct_cym's avatar
struct_cym 已提交
252
				cout<<"丢弃成功"; 
struct_cym's avatar
struct_cym 已提交
253 254 255 256 257 258 259
				return;
			}
		} 
	}
}

int main12(){
struct_cym's avatar
struct_cym 已提交
260 261 262
	if(grade==0){
		grade++;
	}
struct_cym's avatar
struct_cym 已提交
263 264 265 266
	if(jinyan>=experience[grade]){
		grade++;
		jinyan-=experience[grade-1];
	}
struct_cym's avatar
struct_cym 已提交
267 268 269
	if(exits==1){
		return 0;
	}
struct_cym's avatar
struct_cym 已提交
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
	board();
	cin>>option;
	if(option==1){
		maps();
		if(exits==1){
			return 0;
		}
		main12();
	}else if(option==2){
		bag();
		main12();
	}else if(option==3){
		box();
		main12();
	}else if(option==4){
struct_cym's avatar
struct_cym 已提交
285
		equips();
struct_cym's avatar
struct_cym 已提交
286 287 288 289 290 291 292 293
		main12();
	}else if(option==5){
		skill_board();
		main12();
	}
}

void lingdong(){
struct_cym's avatar
struct_cym 已提交
294
	cout<<"欢迎来到灵洞"<<endl;
struct_cym's avatar
struct_cym 已提交
295
	Sleep(1000);
struct_cym's avatar
struct_cym 已提交
296
	cout<<"1.刷级(等级高)   2.泡温泉";
struct_cym's avatar
struct_cym 已提交
297 298
	cin>>option;
	if(option==1){
struct_cym's avatar
struct_cym 已提交
299
		cout<<"你遇见了——"<<endl;
struct_cym's avatar
struct_cym 已提交
300 301 302
		Sleep(1000);
		savage=rand()%2;
		if(savage==0){
struct_cym's avatar
struct_cym 已提交
303 304
			double x=rand()%(100-80+1)+80;
			cout<<"碧水金睛兽"<<" "<<"等级:"<<x<<endl;
struct_cym's avatar
struct_cym 已提交
305
			int tema=blood[grade];
struct_cym's avatar
struct_cym 已提交
306
			int temb=blood[(int)x];
struct_cym's avatar
struct_cym 已提交
307 308
			double temg=attack*1.5;
			double temf=defense*1.5;
struct_cym's avatar
struct_cym 已提交
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
			cout<<name<<"开始释放技能";
			for(int i=1;i<=5;i++){
				if(jineng[i]&&i==1){
					cout<<"火神术--"<<endl;
					cout<<"焚毁!"<<endl;
					temb-=5*10+attack;
					cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
					if(temb<=0){
						cout<<"你赢了";
						int n=rand()%20+1;
						if(n==1){
							cout<<",你获得了碧水金睛兽一只"; 
						}else{
							cout<<",你获得了碧水珠"; 
						}
						jinyan+=(double)experience[(int)x]/10;
						return;
					} 
				} 
			}
struct_cym's avatar
struct_cym 已提交
329
			while(true){
struct_cym's avatar
struct_cym 已提交
330
				 
struct_cym's avatar
struct_cym 已提交
331 332 333
				int y1=boss_shanghai(x);
				tema-=y1+jianshang(defense);
				cout<<"碧水金睛兽打出了"<<y1<<"点伤害"<<endl;
struct_cym's avatar
struct_cym 已提交
334 335 336
				Sleep(1000);
				cout<<name<<"还剩"<<tema<<"滴血"<<endl;
				Sleep(1000);
struct_cym's avatar
struct_cym 已提交
337
				if(tema<=0){
struct_cym's avatar
struct_cym 已提交
338
					cout<<"你落败了,等级-1"<<endl;
struct_cym's avatar
struct_cym 已提交
339 340 341 342
					grade--; 
					return;
				}
				int y2=shanghai(attack);
struct_cym's avatar
struct_cym 已提交
343 344
				temb-=y2;
				temb+=jianshang(temf);
struct_cym's avatar
struct_cym 已提交
345
				cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
struct_cym's avatar
struct_cym 已提交
346
				Sleep(1000);
struct_cym's avatar
struct_cym 已提交
347
				cout<<"碧水金睛兽还剩"<<temb<<"滴血";
struct_cym's avatar
struct_cym 已提交
348
				Sleep(1000);
struct_cym's avatar
struct_cym 已提交
349 350
				if(temb<=0){
					cout<<"你赢了";
struct_cym's avatar
struct_cym 已提交
351
					int n=rand()%20+1;
struct_cym's avatar
struct_cym 已提交
352 353 354 355 356
					if(n==1){
						cout<<",你获得了碧水金睛兽一只"; 
					}else{
						cout<<",你获得了碧水珠"; 
					}
struct_cym's avatar
struct_cym 已提交
357
					jinyan+=(double)experience[(int)x]/10;
struct_cym's avatar
struct_cym 已提交
358 359 360
					return;
				} 
			}
struct_cym's avatar
struct_cym 已提交
361
		}else if(savage==1){
struct_cym's avatar
struct_cym 已提交
362 363
			double x=rand()%(100-80+1)+80;
			cout<<"太古龙象"<<" "<<"等级:"<<x<<endl;
struct_cym's avatar
struct_cym 已提交
364
			int tema=blood[grade];
struct_cym's avatar
struct_cym 已提交
365
			int temb=blood[(int)x];
struct_cym's avatar
struct_cym 已提交
366 367
			double temg=attack*1.5;
			double temf=defense*1.5;
struct_cym's avatar
struct_cym 已提交
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
			cout<<name<<"开始释放技能";
			for(int i=1;i<=5;i++){
				if(jineng[i]&&i==1){
					cout<<"火神术--"<<endl;
					cout<<"焚毁!"<<endl;
					temb-=5*10+attack;
					cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
					cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
					if(temb<=0){
						cout<<"你赢了"<<endl;
						int n=rand()%10+1;
						if(n==1){
							cout<<",你获得了太古龙象一只"<<endl;
							//加坐骑的属性 
						}else{
							cout<<",你获得了 龙象牙"<<endl; 
						}
						jinyan+=(double)experience[(int)x]/10;
						return;
					} 
				} 
			}
struct_cym's avatar
struct_cym 已提交
390 391
			while(true){
				int y1=boss_shanghai(x);
struct_cym's avatar
struct_cym 已提交
392
				tema-=y1+jianshang((int)defense);
struct_cym's avatar
struct_cym 已提交
393
				cout<<"太古龙象打出了"<<y1<<"点伤害"<<endl;
struct_cym's avatar
struct_cym 已提交
394 395 396
				Sleep(1000);
				cout<<name<<"还剩"<<tema<<"滴血"<<endl;
				Sleep(1000);
struct_cym's avatar
struct_cym 已提交
397
				if(tema<=0){
struct_cym's avatar
struct_cym 已提交
398
					cout<<"你落败了,等级-1"<<endl;
struct_cym's avatar
struct_cym 已提交
399 400 401
					grade--; 
					return;
				}
struct_cym's avatar
struct_cym 已提交
402 403
				cout<<endl;
				int y2=shanghai((int)attack);
struct_cym's avatar
struct_cym 已提交
404 405
				temb-=y2+jianshang(temf);
				cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
struct_cym's avatar
struct_cym 已提交
406 407 408
				Sleep(1000);
				cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
				Sleep(1000);
struct_cym's avatar
struct_cym 已提交
409
				if(temb<=0){
struct_cym's avatar
struct_cym 已提交
410
					cout<<"你赢了"<<endl;
struct_cym's avatar
struct_cym 已提交
411 412
					int n=rand()%10+1;
					if(n==1){
struct_cym's avatar
struct_cym 已提交
413
						cout<<",你获得了太古龙象一只"<<endl;
struct_cym's avatar
struct_cym 已提交
414 415
						//加坐骑的属性 
					}else{
struct_cym's avatar
struct_cym 已提交
416
						cout<<",你获得了 龙象牙"<<endl; 
struct_cym's avatar
struct_cym 已提交
417
					}
struct_cym's avatar
struct_cym 已提交
418
					jinyan+=(double)experience[(int)x]/10;
struct_cym's avatar
struct_cym 已提交
419 420
					return;
				} 
struct_cym's avatar
struct_cym 已提交
421
				cout<<endl;
struct_cym's avatar
struct_cym 已提交
422
			}
struct_cym's avatar
struct_cym 已提交
423 424
		}
	}else if(option==2){
struct_cym's avatar
struct_cym 已提交
425
		cout<<"请输入要泡的时间";
struct_cym's avatar
struct_cym 已提交
426
		cin>>times;
struct_cym's avatar
struct_cym 已提交
427
		for(int i=1;i<=times;i++){
struct_cym's avatar
struct_cym 已提交
428 429
			cout<<i<<" ";
			Sleep(1000);
struct_cym's avatar
struct_cym 已提交
430
			jinyan++;
struct_cym's avatar
struct_cym 已提交
431
		}
struct_cym's avatar
struct_cym 已提交
432 433
		cout << "你加了" <<times<<"点经验";
		Sleep(1000);
struct_cym's avatar
struct_cym 已提交
434 435 436 437 438
	}else{
		return;
	}
}

struct_cym's avatar
struct_cym 已提交
439 440
void equips(){
	cout<<"暂时为空"; 
struct_cym's avatar
struct_cym 已提交
441 442 443 444 445
//	cout<<"头部:"<<head<<endl;
//	cout<<"胸甲:"<<body<<endl;
//	cout<<"裤子:"<<trousers<<endl;
//	cout<<"鞋子:"<<shoes<<endl;
//	cout<<"武器:"<<
struct_cym's avatar
struct_cym 已提交
446
//	cout<<endl;
struct_cym's avatar
struct_cym 已提交
447 448
//	cout<<"请问是否要调整装备"<<endl;
//	cout<< "1.要   2.不要";
struct_cym's avatar
struct_cym 已提交
449 450 451
//	cin>>option;
//	if(option==1){
//		bag2();
struct_cym's avatar
struct_cym 已提交
452
//		cout<<"请输入要替换的装备的名称"<<endl;
struct_cym's avatar
struct_cym 已提交
453 454 455 456 457 458 459
//		string a; 
//		cin>>a;
//		for(int i=0;i<100;i++){
//			if()
//		}
//		
//	}
struct_cym's avatar
struct_cym 已提交
460
}
struct_cym's avatar
struct_cym 已提交
461 462

void equip_bag(){
struct_cym's avatar
struct_cym 已提交
463
	cout<<"暂时为空";
struct_cym's avatar
struct_cym 已提交
464 465 466
}

void skill_board(){
struct_cym's avatar
struct_cym 已提交
467
	cout<<"暂时为空"; 
struct_cym's avatar
struct_cym 已提交
468 469
} 

struct_cym's avatar
struct_cym 已提交
470 471 472
void zhanchang(){
	cout<<"删除"; 
}
struct_cym's avatar
struct_cym 已提交
473 474

void huo(){
struct_cym's avatar
struct_cym 已提交
475 476 477 478 479 480 481 482 483 484 485 486 487 488
	cout<<"流火之地"<<endl;
	cout<<"这里是火神祝融坐化的地方"<<endl;
	cout<<"1.下矿  2.探险";
	cin>>option;
	int exits1=0;
	if(option==1){
		while(!exits1){
			cout<<"挖矿中..."<<endl;
			Sleep(3000);
			int y=rand()%3+1; 	
			if(y==1){
				cout<<"恭喜你获得了 炎溶石  "<<endl;
				
			}
struct_cym's avatar
struct_cym 已提交
489
			y=rand()%50+1;
struct_cym's avatar
struct_cym 已提交
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
			if(y==5){
				cout<<"恭喜你找到了 火神传承  "<<endl;
				grade++;
				if(attribute==4){
					cout<<"火神真迹 技能:焚毁"<<endl;
					jineng[1]=1; 
				}
			} 
			cout<<"恭喜你获得了 岩溶石  "<<endl; 
			cout<<"1.继续 2.离开"<<endl;
			cin>>option;
			if(option==2){
				exits1=1;
			} 
		}	
	}else{
		cout<<"你遇到了---"<<endl;
		int n=rand()%2;
		if(n==0){
			double x=rand()%20;
			cout<<"熔岩虫"<<" "<<"等级:"<<x<<endl;
			int tema=blood[grade];
			int temb=blood[(int)x];
			double temg=5;
			double temf=0;
			cout<<name<<"开始释放技能";
			Sleep(1000); 
			for(int i=1;i<=5;i++){
				if(jineng[i]&&i==1){
					cout<<"火神术--"<<endl;
					Sleep(1000); 
					cout<<"焚毁!"<<endl;
					Sleep(1000); 
					temb-=5*10+attack;
					cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
					Sleep(1000); 
					cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
					Sleep(1000); 
					if(temb<=0){
						cout<<"你赢了"<<endl;
						cout<<"你获得了 熔岩宝石 "<<endl;				
						jinyan+=(double)experience[(int)x]/10;
						return;
					} 
				} 
			}
			while(true){
				int y1=shanghai(x);
				tema-=y1+jianshang((int)defense);
				cout<<"熔岩虫打出了"<<y1<<"点伤害"<<endl;
				Sleep(1000);
				cout<<name<<"还剩"<<tema<<"滴血"<<endl;
				Sleep(1000);
				if(tema<=0){
					cout<<"你落败了,等级-1"<<endl;
					grade--; 
					return;
				}
				cout<<endl;
				int y2=shanghai((int)attack);
				temb-=y2+jianshang(temf);
				cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
				Sleep(1000);
				cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
				Sleep(1000);
				if(temb<=0){
					cout<<"你赢了"<<endl;
					cout<<"你获得了 熔岩宝石"; 
					jinyan+=(double)experience[(int)x]/10;
						return;
				} 
				cout<<endl;
			}
		}else if(n==1){
			int op2=rand()%3;
			if(op2==0||op2==1){
				double x=rand()%60+30;
				cout<<"熔岩地龙"<<" "<<"等级:"<<x<<endl;
				int tema=blood[grade];
				int temb=blood[(int)x];
				double temg=5;
				double temf=1;
				cout<<name<<"开始释放技能";
				for(int i=1;i<=5;i++){
					if(jineng[i]&&i==1){
						cout<<"火神术--"<<endl;
						Sleep(1000); 
						cout<<"焚毁!"<<endl;
						Sleep(1000); 
						temb-=5*10+attack;
						cout<<name<<"打出了"<<5*10+attack<<"点伤害"<<endl;
						Sleep(1000); 
						cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
						Sleep(1000); 
						if(temb<=0){
							cout<<"你赢了"<<endl;
							int n=rand()%10+1;
							if(n==1){
								cout<<",你获得了 地龙之心 "<<endl;
								//加坐骑的属性 
							}else{
								cout<<",你获得了 熔炎宝石"<<endl; 
							}
							jinyan+=(double)experience[(int)x]/10;
							return;
						} 
					} 
				}
				while(true){
					int y1=shanghai(x);
					tema-=y1+jianshang((int)defense);
					cout<<"熔岩地龙打出了"<<y1<<"点伤害"<<endl;
					Sleep(1000);
					cout<<name<<"还剩"<<tema<<"滴血"<<endl;
					Sleep(1000);
					if(tema<=0){
						cout<<"你落败了,等级-1"<<endl;
						grade--; 
						return;
					}
					cout<<endl;
					int y2=shanghai((int)attack);
					temb-=y2+jianshang(temf);
					cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
					Sleep(1000);
					cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
					Sleep(1000);
					if(temb<=0){
						cout<<"你赢了"<<endl;
						int n=rand()%10+1;
						if(n==1){
							cout<<",你获得了 地龙之心 "<<endl;
							//加坐骑的属性 
						}else{
							cout<<",你获得了 熔炎宝石"<<endl; 
						}
						jinyan+=(double)experience[(int)x]/10;
						return;
					} 
				}
			}
		}	 
	} 
} 

struct_cym's avatar
struct_cym 已提交
635 636

void bin(){
struct_cym's avatar
struct_cym 已提交
637
	cout<<"暂时为空"; 
struct_cym's avatar
struct_cym 已提交
638 639
}

struct_cym's avatar
struct_cym 已提交
640 641 642
void jin(){
	cout<<"删除"; 
}
struct_cym's avatar
struct_cym 已提交
643 644

void shu(){
struct_cym's avatar
struct_cym 已提交
645
	cout<<"暂时为空"; 
struct_cym's avatar
struct_cym 已提交
646
}
struct_cym's avatar
struct_cym 已提交
647 648 649 650

void lu(){
	cout<<"删除"; 
}
struct_cym's avatar
struct_cym 已提交
651 652


struct_cym's avatar
struct_cym 已提交
653 654 655 656 657 658 659 660 661 662 663 664 665
int shanghai(double gong){
	int bao=0;
	int n=10*((double)gong/100);
	int op=rand()%100+1;
	for(int i=1;i<=baoji;i++){
		ops[i]=1;
	}
	if(ops[op]){
		return n*(rand()%3+1);
		bao=1;
	}else{
		return n;
	}
struct_cym's avatar
struct_cym 已提交
666 667
}

struct_cym's avatar
struct_cym 已提交
668
int jianshang(double fang){
struct_cym's avatar
struct_cym 已提交
669 670
	return (double)fang/10;
}
struct_cym's avatar
struct_cym 已提交
671 672 673 674 675 676 677 678 679 680 681 682 683 684 685

int boss_shanghai(double gong){
	int bao=0;
	int n=10*((double)gong/100);
	int op=rand()%100+1;
	for(int i=1;i<=baoji;i++){
		ops[i]=1;
	}
	if(ops[op]){
		return n*(rand()%2+1);
		bao=1;
	}else{
		return n;
	}
}
struct_cym's avatar
struct_cym 已提交
686

struct_cym's avatar
struct_cym 已提交
687
void ten(){
struct_cym's avatar
struct_cym 已提交
688 689 690 691 692 693 694 695 696 697 698 699 700 701
	cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
	char a[10][10] =
	{
		{'#','#','#','#','#','#','#','#','#','#'},
		{'#',' ',' ','#','#',' ','#','#',' ','@'},
		{'#',' ','#',' ',' ',' ',' ','#',' ','#'},
		{'#',' ',' ',' ','#','#',' ','#',' ','#'},
		{'#','O',' ','#','#',' ',' ','#',' ','#'},
		{'#',' ','#',' ',' ','#',' ',' ',' ','#'},
		{'#',' ','#',' ',' ','#',' ','#',' ','#'},
		{'#',' ',' ','#','#',' ',' ',' ',' ','#'},
		{'#','#',' ',' ',' ',' ','#','#',' ','#'},
		{'#','#','#','#','#','#','#','#','#','#'},
	};
struct_cym's avatar
struct_cym 已提交
702 703
	for(int i = 0; i < 10; i++){
		for(int j = 0; j < 10; j++){
struct_cym's avatar
struct_cym 已提交
704 705 706 707 708 709 710
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	char ch;
	int x = 4, y = 1;
	int q = 1, p = 9;
struct_cym's avatar
struct_cym 已提交
711
	while(ch = getch()){
struct_cym's avatar
struct_cym 已提交
712 713 714
		system("cls");
		cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
		
struct_cym's avatar
struct_cym 已提交
715
		if(ch == 'w' && a[x - 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
716 717 718 719
			a[x][y] = ' ';
			x--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
720
		else if(ch == 's' && a[x + 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
721 722 723 724
			a[x][y] = ' ';
			x++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
725
		else if(ch == 'a' && a[x][y - 1] != '#'){
struct_cym's avatar
struct_cym 已提交
726 727 728 729
			a[x][y] = ' ';
			y--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
730
		else if(ch == 'd' && a[x][y + 1] != '#'){
struct_cym's avatar
struct_cym 已提交
731 732 733 734
			a[x][y] = ' ';
			y++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
735 736
		for(int i = 0; i < 10; i++){
			for(int j = 0; j < 10; j++){
struct_cym's avatar
struct_cym 已提交
737 738 739 740
				cout << a[i][j] << " ";
			}
			cout << endl;
		}
struct_cym's avatar
struct_cym 已提交
741
		if(x == q && y == p){
struct_cym's avatar
struct_cym 已提交
742 743 744 745 746 747 748
			cout << "win"<<endl;
			cout<<"你将获得10点经验"<<endl;
			jinyan+=10;
			break;
		}
	}
}
struct_cym's avatar
struct_cym 已提交
749
void eleven(){
struct_cym's avatar
struct_cym 已提交
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764
	cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
	char a[11][11] =
	{
		{'#','#','#','#','#','#','#','#','#','#','#'},
		{'#','O','#','#','#',' ','#','#','#','#','#'},
		{'#',' ','#',' ','#','#','#','#',' ',' ',' '},
		{'#',' ','#',' ','#',' ','#','#',' ','#',' '},
		{'#',' ','#',' ',' ',' ','#','#',' ','#',' '},
		{'#',' ',' ',' ','#',' ','#','#',' ','#',' '},
		{'#',' ','#','#','#',' ','#',' ',' ','#','@'},
		{'#',' ','#','#','#',' ','#','#',' ','#',' '},
		{'#',' ',' ',' ','#',' ','#','#',' ','#','#'},
		{'#','#','#',' ',' ',' ',' ',' ',' ','#','#'},
		{'#','#','#','#','#','#','#','#','#','#','#'},
	};
struct_cym's avatar
struct_cym 已提交
765 766
	for(int i = 0; i < 11; i++){
		for(int j = 0; j < 11; j++){
struct_cym's avatar
struct_cym 已提交
767 768 769 770 771 772 773
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	char ch;
	int x = 1, y = 1;
	int q = 6, p = 10;
struct_cym's avatar
struct_cym 已提交
774
	while(ch = getch()){
struct_cym's avatar
struct_cym 已提交
775 776
		system("cls");
		cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
struct_cym's avatar
struct_cym 已提交
777
		if(ch == 'w' && a[x - 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
778 779 780 781
			a[x][y] = ' ';
			x--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
782
		else if(ch == 's' && a[x + 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
783 784 785 786
			a[x][y] = ' ';
			x++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
787
		else if(ch == 'a' && a[x][y - 1] != '#'){
struct_cym's avatar
struct_cym 已提交
788 789 790 791
			a[x][y] = ' ';
			y--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
792
		else if(ch == 'd' && a[x][y + 1] != '#'){
struct_cym's avatar
struct_cym 已提交
793 794 795 796
			a[x][y] = ' ';
			y++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
797 798
		for(int i = 0; i < 11; i++){
			for(int j = 0; j < 11; j++){
struct_cym's avatar
struct_cym 已提交
799 800 801 802
				cout << a[i][j] << " ";
			}
			cout << endl;
		}
struct_cym's avatar
struct_cym 已提交
803
		if(x == q && y == p){
struct_cym's avatar
struct_cym 已提交
804 805 806 807 808 809 810
			cout << "win"<<endl;
			cout<<"你将获得11点经验"<<endl;
			jinyan+=11;
			break;
		}
	}
}
struct_cym's avatar
struct_cym 已提交
811
void twelve(){
struct_cym's avatar
struct_cym 已提交
812 813 814 815 816 817 818 819 820 821 822 823 824 825 826
	cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
	char a[12][12] =
	{
		{'#','#','#','#','#','#','#','#','#','#','#','#'},
		{'#',' ',' ',' ',' ','#','#','#','#','#','#','#'},
		{'#','O','#','#',' ','#','#',' ','#','#',' ',' '},
		{'#',' ',' ','#',' ',' ',' ',' ','#',' ',' ','#'},
		{'#','#',' ','#','#','#','#',' ','#',' ','#',' '},
		{'#',' ',' ','#','#',' ','#',' ',' ',' ','#','@'},
		{'#','#',' ',' ','#',' ','#','#','#','#','#',' '},
		{'#','#','#',' ','#','#','#','#',' ',' ',' ',' '},
		{'#',' ','#',' ',' ',' ','#','#',' ','#',' ',' '},
		{'#',' ','#','#','#',' ',' ',' ',' ','#','#','#'},
		{'#','#','#','#','#','#','#','#','#','#','#','#'},
	};
struct_cym's avatar
struct_cym 已提交
827 828
	for(int i = 0; i < 12; i++){
		for(int j = 0; j < 12; j++){
struct_cym's avatar
struct_cym 已提交
829 830 831 832 833 834 835
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	char ch;
	int x = 2, y = 1;
	int q = 5, p = 11;
struct_cym's avatar
struct_cym 已提交
836
	while(ch = getch()){
struct_cym's avatar
struct_cym 已提交
837 838
		system("cls");
		cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
struct_cym's avatar
struct_cym 已提交
839
		if(ch == 'w' && a[x - 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
840 841 842 843
			a[x][y] = ' ';
			x--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
844
		else if(ch == 's' && a[x + 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
845 846 847 848
			a[x][y] = ' ';
			x++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
849
		else if(ch == 'a' && a[x][y - 1] != '#'){
struct_cym's avatar
struct_cym 已提交
850 851 852 853
			a[x][y] = ' ';
			y--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
854
		else if(ch == 'd' && a[x][y + 1] != '#'){
struct_cym's avatar
struct_cym 已提交
855 856 857 858
			a[x][y] = ' ';
			y++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
859 860
		for(int i = 0; i < 12; i++){
			for(int j = 0; j < 12; j++){
struct_cym's avatar
struct_cym 已提交
861 862 863 864
				cout << a[i][j] << " ";
			}
			cout << endl;
		}
struct_cym's avatar
struct_cym 已提交
865
		if(x == q && y == p){
struct_cym's avatar
struct_cym 已提交
866 867 868 869 870 871 872
			cout << "win"<<endl;
			cout<<"你将获得12点经验"<<endl;
			jinyan+=12;
			break;
		}
	}
}
struct_cym's avatar
struct_cym 已提交
873
void thirteen(){
struct_cym's avatar
struct_cym 已提交
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890
	cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
	char a[13][13] =
	{
		{'#','#','#','#','#','#','#','#','#','#','#','#','#'},
		{'#',' ','#',' ',' ',' ',' ',' ',' ',' ','#','#','#'},
		{'#','O','#','#','#','#','#','#','#','#','#','#','#'},
		{'#',' ','#','#','#','#','#',' ',' ',' ','#','#','#'},
		{'#',' ','#','#',' ',' ',' ','#','#',' ',' ','#','#'},
		{'#',' ',' ',' ',' ','#',' ','#','#',' ',' ','#','#'},
		{'#',' ','#','#',' ','#',' ','#','#','#',' ',' ',' '},
		{'#',' ','#','#','#',' ',' ',' ',' ','#','#','#','@'},
		{'#',' ','#','#','#',' ','#','#',' ','#',' ',' ',' '},
		{'#',' ',' ',' ',' ',' ','#','#',' ',' ',' ','#','#'},
		{'#',' ','#','#','#','#','#','#','#',' ',' ','#','#'},
		{'#',' ',' ',' ',' ',' ','#',' ',' ','#','#','#','#'},
		{'#','#','#','#','#','#','#','#','#','#','#','#','#'},
	};
struct_cym's avatar
struct_cym 已提交
891 892
	for(int i = 0; i < 13; i++){
		for(int j = 0; j < 13; j++){
struct_cym's avatar
struct_cym 已提交
893 894 895 896 897 898 899
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	char ch;
	int x = 2, y = 1;
	int q = 7, p = 12;
struct_cym's avatar
struct_cym 已提交
900
	while(ch = getch()){
struct_cym's avatar
struct_cym 已提交
901 902
		system("cls");
		cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
struct_cym's avatar
struct_cym 已提交
903
		if(ch == 'w' && a[x - 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
904 905 906 907
			a[x][y] = ' ';
			x--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
908
		else if(ch == 's' && a[x + 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
909 910 911 912
			a[x][y] = ' ';
			x++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
913
		else if(ch == 'a' && a[x][y - 1] != '#'){
struct_cym's avatar
struct_cym 已提交
914 915 916 917
			a[x][y] = ' ';
			y--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
918
		else if(ch == 'd' && a[x][y + 1] != '#'){
struct_cym's avatar
struct_cym 已提交
919 920 921 922
			a[x][y] = ' ';
			y++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
923 924
		for(int i = 0; i < 13; i++){
			for(int j = 0; j < 13; j++){
struct_cym's avatar
struct_cym 已提交
925 926 927 928
				cout << a[i][j] << " ";
			}
			cout << endl;
		}
struct_cym's avatar
struct_cym 已提交
929
		if(x == q && y == p){
struct_cym's avatar
struct_cym 已提交
930 931 932 933 934 935 936
			cout << "win"<<endl;
			cout<<"你将获得13点经验"<<endl;
			jinyan+=13;
			break;
		}
	}
}
struct_cym's avatar
struct_cym 已提交
937
void forteen(){
struct_cym's avatar
struct_cym 已提交
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955
	cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
	char a[14][14] =
	{
		{'#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
		{'#','#','#','#',' ',' ','#',' ',' ','#','#','#','#','#'},
		{'#','O','#','#',' ','#','#','#','#','#',' ','#','#','#'},
		{'#',' ',' ',' ',' ','#',' ','#','#','#',' ','#','#','#'},
		{'#','#',' ','#',' ','#',' ',' ','#','#',' ',' ',' ','@'},
		{'#','#',' ','#',' ',' ','#',' ',' ','#','#','#',' ','#'},
		{'#','#',' ',' ',' ','#','#','#',' ',' ',' ','#',' ','#'},
		{'#','#','#',' ',' ',' ',' ','#',' ','#',' ','#',' ','#'},
		{'#',' ','#','#',' ','#',' ','#',' ','#',' ','#',' ','#'},
		{'#',' ','#','#','#','#',' ','#',' ','#',' ',' ',' ','#'},
		{'#',' ','#','#','#','#',' ','#',' ','#',' ','#',' ','#'},
		{'#',' ',' ',' ',' ',' ',' ','#',' ','#','#','#','#','#'},
		{'#','#','#','#','#','#',' ',' ',' ','#','#','#','#','#'},
		{'#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
	};
struct_cym's avatar
struct_cym 已提交
956 957
	for(int i = 0; i < 14; i++){
		for(int j = 0; j < 14; j++){
struct_cym's avatar
struct_cym 已提交
958 959 960 961 962 963 964
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	char ch;
	int x = 2, y = 1;
	int q = 4, p = 13;
struct_cym's avatar
struct_cym 已提交
965
	while(ch = getch()){
struct_cym's avatar
struct_cym 已提交
966 967
		system("cls");
		cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
struct_cym's avatar
struct_cym 已提交
968
		if(ch == 'w' && a[x - 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
969 970 971 972
			a[x][y] = ' ';
			x--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
973
		else if(ch == 's' && a[x + 1][y] != '#'){
struct_cym's avatar
struct_cym 已提交
974 975 976 977
			a[x][y] = ' ';
			x++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
978
		else if(ch == 'a' && a[x][y - 1] != '#'){
struct_cym's avatar
struct_cym 已提交
979 980 981 982
			a[x][y] = ' ';
			y--;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
983
		else if(ch == 'd' && a[x][y + 1] != '#'){
struct_cym's avatar
struct_cym 已提交
984 985 986 987
			a[x][y] = ' ';
			y++;
			a[x][y] = 'O';
		}
struct_cym's avatar
struct_cym 已提交
988 989
		for(int i = 0; i < 14; i++){
			for(int j = 0; j < 14; j++){
struct_cym's avatar
struct_cym 已提交
990 991 992 993
				cout << a[i][j] << " ";
			}
			cout << endl;
		}
struct_cym's avatar
struct_cym 已提交
994
		if(x == q && y == p){
struct_cym's avatar
struct_cym 已提交
995 996 997 998 999 1000 1001
			cout << "win"<<endl;
			cout<<"你将获得14点经验"<<endl;
			jinyan+=14;
			break;
		}
	}
}
struct_cym's avatar
struct_cym 已提交
1002

struct_cym's avatar
struct_cym 已提交
1003
void shenming(){
struct_cym's avatar
struct_cym 已提交
1004 1005 1006
	int n;
	cout << "请输入你想要的级别 1 ~ 5" << endl;
	cin >> n;
struct_cym's avatar
struct_cym 已提交
1007
	if(n == 1){
struct_cym's avatar
struct_cym 已提交
1008 1009
		ten();
	}
struct_cym's avatar
struct_cym 已提交
1010
	else if(n == 2){
struct_cym's avatar
struct_cym 已提交
1011 1012
		eleven();
	}
struct_cym's avatar
struct_cym 已提交
1013
	else if(n == 3){
struct_cym's avatar
struct_cym 已提交
1014 1015
		twelve();
	}
struct_cym's avatar
struct_cym 已提交
1016
	else if(n == 4){
struct_cym's avatar
struct_cym 已提交
1017 1018
		thirteen();
	}
struct_cym's avatar
struct_cym 已提交
1019
	else if(n == 5){
struct_cym's avatar
struct_cym 已提交
1020 1021 1022
		forteen();
	}
}