如何编出一个大型游戏

这段代码展示了如何编写一个大型游戏的部分逻辑,包括玩家丢弃物品、查看技能、使用武器、学习技能、聊天以及执行特殊巫师指令等功能。玩家可以通过输入不同指令进行互动,如战斗、装备、学习等,而不同级别的巫师有额外的特殊能力。
摘要由CSDN通过智能技术生成

如何编出一个大型游戏

第五部(4000~5000行)

			cin >> thing;
			bool is = false;
			if (type == "weapon") {
				for (int i = 0; i < 100; i++) {
					if (bag[i].name == thing || bag[i].Englishname == thing) {
						for (int j = 0; j < 100; j++) {
							if (inroom.weapon[j].name == "") {
								inroom.weapon[j] = bag[i];
								room[nowroomi].weapon[j] = bag[i];
								break;
							}
						}
						cout << "你丢掉一个";
						color(bag[i].lv);
						cout << bag[i].name << endl;
						color(16);
						bag[i] = {};
						is = true;
						break;
					}
				}
			} else if (type == "book") {
				for (int i = 0; i < 100; i++) {
					if (bag2[i].name == thing || bag2[i].Englishname == thing) {
						for (int j = 0; j < 100; j++) {
							if (inroom.book[j].name == "") {
								inroom.book[j] = bag2[i];
								room[nowroomi].book[j] = bag2[i];
								break;
							}
						}
						cout << "你丢掉一个" << bag2[i].name << endl;
						bag2[i] = {};
						is = true;
						break;
					}
				}
			} else if (type == "thing") {
				for (int i = 0; i < 100; i++) {
					if (bag3[i].name == thing || bag3[i].Englishname == thing) {
						for (int j = 0; j < 100; j++) {
							if (inroom.thing[j].name == "") {
								inroom.thing[j] = bag3[i];
								room[nowroomi].thing[j] = bag3[i];
								break;
							}
						}
						cout << "你丢掉一个" << bag3[i].name << endl;
						bag3[i] = {};
						is = true;
						break;
					}
				}
			}
			if (!is) {
				cout << "你要丢什么?" << endl;
				cout << "指令格式:drop <型号> <某物>" << endl;
			}
		} else if (ins1 == "help") {
			cout << "所有指令都可使用" << endl;
			cout << "指令个数:50" << endl;
			cout << " _____________战斗指令_____________" << endl;
			cout << "|跟某人比试: fight <某人>          |" << endl;
			cout << "|击杀某人: kill <某人>             |" << endl;
			cout << "|跟群人比试: fightall <人数><人名> |" << endl;
			cout << "|击杀群人: killall <人数><人名>    |" << endl;
			cout << "|使用技能: <数字>                  |" << endl;
			cout << "|__________________________________|" << endl;
			cout << " _____________装备指令_____________" << endl;
			cout << "|装备武器: wield <某武器>          |" << endl;
			cout << "|卸下武器: unwield <某武器>        |" << endl;
			cout << "|精炼武器: refine <装备武器>       |" << endl;
			cout << "|打造武器: build <某武器>          |" << endl;
			cout << "|自造武器: makesword(铸剑山庄可用) |" << endl;
			cout << "|__________________________________|" << endl;
			cout << " _____________冒险指令_____________" << endl;
			cout << "|捡东西: get <型号> <某物>         |" << endl;
			cout << "|丢掉东西: drop <型号> <某物>      |" << endl;
			cout << "|询问某人: ask <某人> about <某事> |" << endl;
			cout << "|移动: move <方向>                 |" << endl;
			cout << "|用东西砸人: throw <某物> to <某人>|" << endl;
			cout << "|查看状态: hp                      |" << endl;
			cout << "|看: l/look <...>                  |" << endl;
			cout << "|查看自己的东西: i                 |" << endl;
			cout << "|查看自己的技能: skills            |" << endl;
			cout << "|买东西: buy <某物>                |" << endl;
			cout << "|卖东西: sell <某物>               |" << endl;
			cout << "|查看所卖物品: list                |" << endl;
			cout << "|查看矿石: minebag                 |" << endl;
			cout << "|合成矿石: blend <两个材料>        |" << endl;
			cout << "|拜师: baishi <某人>               |" << endl;
			cout << "|查看师父技能: masterskill         |" << endl;
			cout << "|提升境界: uplv                    |" << endl;
			cout << "|进入武道塔: wudaota               |" << endl;
			cout << "|__________________________________|" << endl;
			cout << " _____________武功指令_____________" << endl;
			cout << "|研读: study <某书> <次数>         |" << endl;
			cout << "|学习: learn <技能> <次数>         |" << endl;
			cout << "|使用: enable <轻功技能>           |" << endl;
			cout << "|打坐: dazuo <次数>                |" << endl;
			cout << "|疗伤: liaoshang <次数>            |" << endl;
			cout << "|__________________________________|" << endl;
			cout << " _____________聊天指令_____________" << endl;
			cout << "|说话: say <...>                   |" << endl;
			cout << "|大喊: yell <...>                  |" << endl;
			cout << "|__________________________________|" << endl;
			cout << " _____________其他指令_____________" << endl;
			cout << "|埋葬尸体: bury corpse/allcorpse   |" << endl;
			cout << "|帮助: help                        |" << endl;
			cout << "|设置: set <...> to <...>          |" << endl;
			cout << "|关于游戏: AboutGame               |" << endl;
			cout << "|保存: save                        |" << endl;
			cout << "|提升至X级巫师: UTW-X              |" << endl;
			cout << "|副本攻略: introduction            |" << endl;
			cout << "|__________________________________|" << endl;
			if (IDEN == "wizard-1") {
				cout << " ____________小巫师指令____________" << endl;
				cout << "|去: goto <某地>                   |" << endl;
				cout << "|__________________________________|" << endl;
			}
			if (IDEN == "wizard-2") {
				cout << " ____________中巫师指令____________" << endl;
				cout << "|去: goto <某地>                   |" << endl;
				cout << "|雷劈: smash <某人>                |" << endl;
				cout << "|复制东西: clone <某物>            |" << endl;
				cout << "|查看某物值: score <某物>          |" << endl;
				cout << "|变出东西: conjure <某物>          |" << endl;
				cout << "|查看变出物品: ls                  |" << endl;
				cout << "|创造武器: make_weapon             |" << endl;
				cout << "|__________________________________|" << endl;
			}
			if (IDEN == "wizard-3") {
				cout << " ____________大巫师指令____________" << endl;
				cout << "|去: goto <某地>                   |" << endl;
				cout << "|雷劈: smash <某人>                |" << endl;
				cout << "|复制东西: clone <某物>            |" << endl;
				cout << "|查看某物值: score <某物>          |" << endl;
				cout << "|变出东西: conjure <某物>          |" << endl;
				cout << "|查看变出物品: ls                  |" << endl;
				cout << "|创造武器: make_weapon             |" << endl;
				cout << "|更改值: call<某人><set+东西><值>  |" << endl;
				cout << "|__________________________________|" << endl;
			}
		} else if (ins1 == "hp") {
			cout << "__________________________" << endl;
			cout << "==========================" << endl;
			cout << "|气血:" << health << "/" << maxhealth << endl;
			cout << "|内力:" << force << "/" << maxforce << endl;
			cout << "|经验:" << experience << endl;
			cout << "|潜能:" << potential << endl;
			cout << "|攻击:" << damage << endl;
			cout << "|防御:" << defense << endl;
			cout << "|躲避:" << dodge << endl;
			cout << "|命中:" << hit << endl;
			cout << "|文化:" << literate << endl;
			cout << "|杀人" << killnum << "次" << endl;
			cout << "|死亡" << dienum << "次" << endl;
			cout << "|门派:" << mymenpai << endl;
			cout << "|师父:" << myshifu << endl;
			cout << "|身份:";
			if (IDEN == "wizard-1") cout << "小巫师" << endl;
			else if (IDEN == "wizard-2") cout << "中巫师" << endl;
			else if (IDEN == "wizard-3") cout << "大巫师" << endl;
			else if (IDEN == "wizard-4") cout << "天神" << endl;
			else if (IDEN == "wizard-5") cout << "创世主" << endl;
			else cout << "平民" << endl;
			cout << "==========================" << endl;
			cout << "**************************" << endl;
		} else if (ins1 == "skills") {
			cout << "你学会了以下技能:" << endl;
			for (int i = 0; i < 9; i++) {
				cout << mybasicskill[i].name;
				for (int j = 0; j < (20 - mybasicskill[i].name.size()); j++) {
					cout << " ";
				}
				cout << mybasicskill[i].level;
				if (mybasicskill[i].level == 0) {
					color(8);
					cout << "  一无所知" << endl;
					color(16);
				} else if (mybasicskill[i].level < 100) {
					color(2);
					cout << "  初学乍练" << endl;
					color(16);
				} else if (mybasicskill[i].level < 200) {
					color(2);
					cout << "  略知一二" << endl;
					color(16);
				} else if (mybasicskill[i].level < 300) {
					color(9);
					cout << "  半生不熟" << endl;
					color(16);
				} else if (mybasicskill[i].level < 400) {
					color(9);
					cout << "  平淡无奇" << endl;
					color(16);
				} else if (mybasicskill[i].level < 500) {
					color(9);
					cout << "  心神领会" << endl;
					color(16);
				} else if (mybasicskill[i].level < 600) {
					color(14);
					cout << "  熟能生巧" << endl;
					color(16);
				} else if (mybasicskill[i].level < 700) {
					color(14);
					cout << "  高深莫测" << endl;
					color(16);
				} else if (mybasicskill[i].level < 800) {
					color(14);
					cout << "  出神入化" << endl;
					color(16);
				} else if (mybasicskill[i].level < 900) {
					color(12);
					cout << "  旷古绝伦" << endl;
					color(16);
				} else if (mybasicskill[i].level < 1000) {
					color(12);
					cout << "  绝世高深" << endl;
					color(16);
				} else {
					color(12);
					cout << "  返璞归真" << endl;
					color(16);
				}
			}
			for (int i = 0; i < 100; i++) {
				if (myskill[i].name == "") {
					break;
				}
				cout << myskill[i].name;
				for (int j = 0; j < (20 - myskill[i].name.size()); j++) {
					cout << " ";
				}
				cout << myskill[i].level;
				if (myskill[i].level < 100) {
					color(2);
					cout << "  初学乍练" << endl;
					color(16);
				} else if (myskill[i].level < 200) {
					color(2);
					cout << "  略知一二" << endl;
					color(16);
				} else if (myskill[i].level < 300) {
					color(9);
					cout << "  半生不熟" << endl;
					color(16);
				} else if (myskill[i].level < 400) {
					color(9);
					cout << "  平淡无奇" << endl;
					color(16);
				} else if (myskill[i].level < 500) {
					color(9);
					cout << "  心神领会" << endl;
					color(16);
				} else if (myskill[i].level < 600) {
					color(14);
					cout << "  熟能生巧" << endl;
					color(16);
				} else if (myskill[i].level < 700) {
					color(14);
					cout << "  高深莫测" << endl;
					color(16);
				} else if (myskill[i].level < 800) {
					color(14);
					cout << "  出神入化" << endl;
					color(16);
				} else if (myskill[i].level < 900) {
					color(12);
					cout << "  旷古绝伦" << endl;
					color(16);
				} else if (myskill[i].level < 1000) {
					color(12);
					cout << "  绝世高深" << endl;
					color(16);
				} else {
					color(12);
					cout << "  返璞归真" << endl;
					color(16);
				}
			}
		} else if (ins1 == "wield" || ins1 == "w") {
			string weapon;
			cin >> weapon;
			bool isweapon = false;
			if (nweapon.name == "拳") {
				for (int i = 0; i < 1000; i++) {
					if (bag[i].name == weapon || bag[i].Englishname == weapon) {
						isweapon = true;
						cout << "你「刷」的抽出一把";
						color(bag[i].lv);
						cout << bag[i].name;
						color(16);
						cout << "拿在手上" << endl;
						nweapon = bag[i];
						health += bag[i].plushealth;
						maxhealth += bag[i].plushealth;
						damage += bag[i].plusdamage;
						defense += bag[i].plusdefense;
						force += bag[i].plusforce;
						maxforce += bag[i].plusforce;
						dodge += bag[i].plusdodge;
						hit += bag[i].plushit;
						break;
					}
				}
				if (!isweapon) {
					cout << "你没有这个武器。" << endl;
				}
			} else {
				cout << "你已经装备着" << nweapon.type << "了" << endl;
			}
		} else if (ins1 == "unwield" || ins1 == "uw") {
			string weapon;
			cin >> weapon;
			if (nweapon.name != "拳") {
				if (nweapon.name == weapon || nweapon.Englishname == weapon) {
					cout << "你把";
					color(nweapon.lv);
					cout << nweapon.name;
					color(16);
					cout << "放回背包" << endl;
					health -= nweapon.plushealth;
					maxhealth -= nweapon.plushealth;
					damage -= nweapon.plusdamage;
					defense -= nweapon.plusdefense;
					force -= nweapon.plusforce;
					maxforce -= nweapon.plusforce;
					dodge -= nweapon.plusdodge;
					hit -= nweapon.plushit;
					nweapon = { "拳","fist","拳","这是一个拳",0,0,0,0,0,0,16 };
				} else {
					cout << "你没有装备着" << weapon << "啊" << endl;
				}
			} else {
				cout << "你没有装备着任何武器啊" << endl;
			}
		} else if (ins1 == "study") {
			string book;
			int time;
			cin >> book;
			cin >> time;
			bool is = false;
			for (int i = 0; i < 200; i++) {
				if (bag2[i].name == book || bag2[i].Englishname == book) {
					if (bag2[i].literate_need > literate) {
						cout << "你看着书上那些文字,发现自己一点也读不懂" << endl;
						break;
					}
					if (bag2[i].name[0] == -69 && bag2[i].name[1] == -7) {
						for (int j = 0; j < 9; j++) {
							if (bag2[i].skill.name == mybasicskill[j].name) {
								for (int k = 0; k < time; k++) {
									if (potential >= mybasicskill[j].level / 2) {
										potential -= mybasicskill[j].level / 2;
										mybasicskill[j].level++;
										damage += mybasicskill[j].plusattack;
										dodge += mybasicskill[j].plusdodge;
										hit += mybasicskill[j].plushit;
										maxhealth += mybasicskill[j].plushealth;
										health += mybasicskill[j].plushealth;
										force += mybasicskill[j].plusforce;
										maxforce += mybasicskill[j].plusforce;
										cout << "你";
										color(4);
										cout << mybasicskill[j].name;
										color(16);
										cout << "的等级提升了!" << endl;
										allskilllevel++;
									} else {
										cout << "可能是你缺乏实战经验,你实在理解不了" << bag2[i].name << "上所讲的东西"
										<< endl;
										break;
									}
								}
							}
						}
						is = true;
						break;
					} else {
						for (int j = 0; j < time; j++) {
							bool have = false;
							bool canstudy = true;
							for (int k = 0; k < myskilli; k++) {
								if (bag2[i].skill.name == myskill[k].name) {
									canstudy = (potential >= myskill[k].level);
									for (int a = 0; a < 100; a++) {
										if (bag2[i].needskill[a] == "") {
											break;
										} else {
											bool ishave = false;
											for (int b = 0; b < 100; b++) {
												if (bag2[i].needskill[a] == myskill[b].name) {
													ishave = true;
													canstudy &= (bag2[i].needlevel[a] <= myskill[b].level);
													break;
												}
											}
											for (int b = 0; b < 100; b++) {
												if (bag2[i].needskill[a] == mybasicskill[b].name) {
													ishave = true;
													canstudy &= (bag2[i].needlevel[a] <= mybasicskill[b].level);
													break;
												}
											}
											canstudy &= ishave;
										}
									}
									if (canstudy) {
										potential -= myskill[k].level;
										myskill[k].level++;
										damage += myskill[k].plusattack;
										dodge += myskill[k].plusdodge;
										hit += myskill[k].plushit;
										maxhealth += myskill[k].plushealth;
										health += myskill[k].plushealth;
										maxforce += myskill[k].plusforce;
										force += myskill[k].plusforce;
										cout << "你";
										color(4);
										cout << myskill[k].name;
										color(16);
										cout << "的等级提升了!" << endl;
										allskilllevel++;
										if (bag2[i].skill.name == "「反弹剑法」") {
											reboundnum += 1;
										}
									} else {
										cout << "可能是缺乏实战经验,你实在理解不了" << bag2[i].name << "上所讲的东西"
										<< endl;
									}
									have = true;
									break;
								}
							}
							if (!canstudy) {
								break;
							}
							if (!have) {
								myskill[myskilli++] = bag2[i].skill;
								if (bag2[i].skill.name == "「反弹剑法」") {
									isrebound = true;
									reboundnum = 10;
								}
								cout << "你";
								color(4);
								cout << bag2[i].skill.name;
								color(16);
								cout << "的等级提升了!" << endl;
								allskilllevel++;
							}
						}
						is = true;
						break;
					}
				}
			}
			if (!is) {
				cout << "你要读什么书?" << endl;
				cout << "指令格式:study <书> <次数>" << endl;
			}
		} else if (ins1 == "say") {
			string say;
			cin >> say;
			cout << "你说:“";
			color(8);
			cout << say;
			color(16);
			cout << "”" << endl;
		} else if (ins1 == "yell") {
			string yell;
			cin >> yell;
			cout << "你大喊:“";
			color(4);
			cout << yell;
			color(16);
			cout << "”" << endl;
			if (yell == "我太难了!" || yell == "我太难了。" || yell == "我太难了") {
				Sleep(1000);
				color(6);
				cout << "天下掉下来一本武功秘籍..." << endl;
				color(16);
				color(6);
				cout << "【东拉西扯】某人:听说有一本武功秘籍掉在了" << inroom.name << "" <<
				endl;
				color(16);
				for (int i = 0; i < 100; i++) {
					if (inroom.book[i].name == "") {
						inroom.book[i] = { "绝世武功秘籍","book",{"绝世武功","你拿起手中w胡乱舞几招,再一看,e已经死了...","kongfu",2000000000,1,"剑",0,0,0,10000000,0,1,0,0,true,0},0,{},{},"神:现在不难了吧...",0 };
						break;
					}
				}
			}
			if (yell == "我想死!" || yell == "我想死。" || yell == "我想死") {
				color(6);
				cout << "天上传来一个沉闷的声音:“那就死吧!”" << endl;
				color(16);
				health = 0;
			}
		} else if (ins1 == "bury") {
			string a;
			cin >> a;
			if (a == "allcorpse") {
				bool ishave = false;
				for (int i = 0; i < 100; i++) {
					if (inroom.thing[i].Englishname == "corpse") {
						cout << "你埋葬了" << inroom.thing[i].name << endl;
						inroom.thing[i] = {};
						room[nowroomi].thing[i] = {};
						ishave = true;
					}
				}
				if (!ishave) {
					cout << "这里没有尸体啊?";
				}
			} else if (a == "corpse") {
				bool ishave = false;
				for (int i = 0; i < 100; i++) {
					if (inroom.thing[i].Englishname == "corpse") {
						cout << "你埋葬了" << inroom.thing[i].name << endl;
						inroom.thing[i] = {};
						room[nowroomi].thing[i] = {};
						ishave = true;
						break;
					}
				}
				if (!ishave) {
					cout << "这里没有尸体啊?";
				}
			} else {
				cout << "什么?" << endl;
				cout << "如果你不知道指令,请输入 help 查询" << endl;
			}
		} else if (ins1 == "set") {
			string which;
			string what;
			cin >> which;
			if (which == "?") {
				cout << "set <...> to <...>" << endl;
				cout << "现在可以设置指针(pointer)就是这个:" << endl;
				cout << "↓" << endl;
				cout << ">set ?" << endl;
			} else {
				cin >> what >> what;
				if (which == "pointer") {
					po = what;
					color(6);
					cout << "设置成功..." << endl;
					color(16);
				}
			}
		} else if (ins1 == "sell") {
			string thing;
			cin >> thing;
			bool issell = false;
			if (inroom.isshop == true) {
				for (int i = 0; i < 200; i++) {
					if (bag[i].Englishname == thing || bag[i].name == thing) {
						cout << "你买掉了";
						color(8);
						cout << bag[i].name;
						color(16);
						cout << ",获得了";
						color(6);
						cout << bag[i].coin / 2;
						color(16);
						cout << "个铜钱" << endl;
						coin += bag[i].coin / 2;
						bag[i] = {};
						issell = true;
						break;
					}
				}
				if (!issell) {
					for (int i = 0; i < 200; i++) {
						if (bag2[i].Englishname == thing || bag2[i].name == thing) {
							cout << "你买掉了";
							color(8);
							cout << bag2[i].name;
							color(16);
							cout << ",获得了";
							color(6);
							cout << bag2[i].coin / 2;
							color(16);
							cout << "个铜钱" << endl;
							coin += bag2[i].coin / 2;
							bag2[i] = {};
							issell = true;
							break;
						}
					}
				}
				if (!issell) {
					for (int i = 0; i < 200; i++) {
						if (bag3[i].Englishname == thing || bag3[i].name == thing) {
							cout << "你买掉了";
							color(8);
							cout << bag3[i].name;
							color(16);
							cout << ",获得了";
							color(6);
							cout << bag3[i].coin / 2;
							color(16);
							cout << "个铜钱" << endl;
							coin += bag3[i].coin / 2;
							bag3[i] = {};
							issell = true;
							break;
						}
					}
				}
				if (!issell) {
					cout << "你没有这东西啊" << endl;
				}
			} else {
				cout << "这里不是商店啊?" << endl;
			}
		} else if (ins1 == "list") {
			if (inroom.isshop == false) {
				cout << "这里没有任何摆摊的商人" << endl;
			} else {
				cout << "这里现在出售以下物品:" << endl;
				cout << "_________________________" << endl;
				for (int i = 0; i < 100; i++) {
					if (inroom.booksell[i].name != "") {
						cout << inroom.booksell[i].name << "(";
						color(3);
						cout << inroom.booksell[i].Englishname;
						color(16);
						cout << ")";
						for (int j = 0;
							j < 28 - inroom.booksell[i].name.size() - inroom.booksell[i].Englishname.size();
							j++) {
							cout << " ";
						}
						color(6);
						cout << inroom.booksell[i].coin;
						color(16);
						cout << "文" << endl;
					}
				}
				for (int i = 0; i < 100; i++) {
					if (inroom.thingsell[i].name != "") {
						cout << inroom.thingsell[i].name << "(";
						color(3);
						cout << inroom.thingsell[i].Englishname;
						color(16);
						cout << ")";
						for (int j = 0;
							j < 28 - inroom.thingsell[i].name.size() -
							inroom.thingsell[i].Englishname.size(); j++) {
							cout << " ";
						}
						color(6);
						cout << inroom.thingsell[i].coin;
						color(16);
						cout << "文" << endl;
					}
				}
				for (int i = 0; i < 100; i++) {
					if (inroom.weaponsell[i].name != "") {
						cout << inroom.weaponsell[i].name << "(";
						color(3);
						cout << inroom.weaponsell[i].Englishname;
						color(16);
						cout << ")";
						for (int j = 0;
							j < 28 - inroom.weaponsell[i].name.size() -
							inroom.weaponsell[i].Englishname.size(); j++) {
							cout << " ";
						}
						color(6);
						cout << inroom.weaponsell[i].coin;
						color(16);
						cout << "文" << endl;
					}
				}
				cout << "_________________________" << endl;
			}
		} else if (ins1 == "buy") {
			string thing;
			cin >> thing;
			bool isfind = false;
			for (int i = 0; i < 100; i++) {
				if (thing == inroom.weaponsell[i].Englishname
					|| thing == inroom.weaponsell[i].name) {
					if (gold * 10000 + silver * 100 + coin < inroom.weaponsell[i].coin) {
						cout << "你的钱不够" << endl;
					} else {
						cout << "你买下了" << inroom.weaponsell[i].name << endl;
						coin = gold * 10000 + silver * 100 + coin;
						gold = 0;
						silver = 0;
						coin -= inroom.weaponsell[i].coin;
						for (int j = 0; j < 200; j++) {
							if (bag[j].name == "") {
								bag[j] = inroom.weaponsell[i];
								break;
							}
						}
					}
					isfind = true;
					break;
				}
			}
			for (int i = 0; i < 100; i++) {
				if (thing == inroom.booksell[i].Englishname
					|| thing == inroom.booksell[i].name) {
					if (gold * 10000 + silver * 100 + coin < inroom.booksell[i].coin) {
						cout << "你的钱不够" << endl;
					} else {
						cout << "你买下了" << inroom.booksell[i].name << endl;
						coin = gold * 10000 + silver * 100 + coin;
						gold = 0;
						silver = 0;
						coin -= inroom.booksell[i].coin;
						for (int j = 0; j < 200; j++) {
							if (bag2[j].name == "") {
								bag2[j] = inroom.booksell[i];
								break;
							}
						}
					}
					isfind = true;
					break;
				}
			}
			for (int i = 0; i < 100; i++) {
				if (thing == inroom.thingsell[i].Englishname
					|| thing == inroom.thingsell[i].name) {
					if (gold * 10000 + silver * 100 + coin < inroom.thingsell[i].coin) {
						cout << "你的钱不够" << endl;
					} else {
						cout << "你买下了" << inroom.thingsell[i].name << endl;
						coin = gold * 10000 + silver * 100 + coin;
						gold = 0;
						silver = 0;
						coin -= inroom.thingsell[i].coin;
						for (int j = 0; j < 200; j++) {
							if (bag3[j].name == "") {
								bag3[j] = inroom.thingsell[i];
								break;
							}
						}
					}
					isfind = true;
					break;
				}
			}
			if (!isfind) {
				cout << "这里不卖这样东西" << endl;
			}
		} else if (ins1 == "fight" || ins1 == "f") {
			string name;
			cin >> name;
			bool is = false;
			for (int i = 0; i < 100; i++) {
				if (inroom.people[i].name == name || inroom.people[i].Englishname == name) {
					x[0] = inroom.people[i];
					y[0] = i;
					fightall(x, 1, y);
					is = true;
					break;
				}
			}
			if (!is) {
				cout << "你要击杀谁?" << endl;
				cout << "指令格式:kill <某人>" << endl;
			}
		} else if (ins1 == "fightall") {
			string name;
			int many;
			cin >> many;
			int num = 0;
			bool is = false;
			for (int i = 0; i < many; i++) {
				cin >> name;
				for (int j = 0; j < 100; j++) {
					if (inroom.people[j].name == name || inroom.people[j].Englishname == name) {
						x[num] = inroom.people[j];
						y[num] = j;
						num++;
						is = true;
						break;
					}
				}
			}
			if (!is) {
				cout << "你要击杀谁?" << endl;
				cout << "指令格式:kill <某人>" << endl;
			} else {
				fightall(x, num, y);
			}
		} else if (ins1 == "AboutGame") {
			color(4);
			cout << "-========================================================" << endl;
			color(16);
			cout << "|版本:" << edition << "无存档" << endl;
			cout << "|作者:Evan_song" << endl;
			cout << "|游戏特色:模仿武林,可以创建各门派,拜师学武" << endl;
			cout << "|本版本修复了战斗BUG,新增人物自动走动" << endl;
			cout << "|本游戏正处于游玩版中" << endl;
			color(4);
			cout << "-========================================================" << endl;
			color(16);
		} else if (ins1 == "save") {
			cout << "本版本是无存档游玩版..." << endl;
		} else if (ins1 == "UpToWizard-1" || ins1 == "UTW-1" || ins1 == "wizard-1") {
			int pass;
			cout << "请输入密码:";
			int realpass = rand();
			ofstream outdata("data2.txt", ios::binary | ios::app | ios::in | ios::out);
			outdata << realpass << endl;
			cin >> pass;
			if (pass == realpass) {
				IDEN = "wizard-1";
				cout << "您成功提升为";
				color(2);
				cout << "小巫师" << endl;
				color(16);
			}
		} else if (ins1 == "UpToWizard-2" || ins1 == "UTW-2" || ins1 == "wizard-2") {
			int pass;
			cout << "请输入密码:";
			int realpass = rand();
			ofstream outdata("data2.txt", ios::binary | ios::app | ios::in | ios::out);
			outdata << realpass << endl;
			cin >> pass;
			if (pass == realpass) {
				IDEN = "wizard-2";
				cout << "您成功提升为";
				color(1);
				cout << "中巫师" << endl;
				color(16);
			}
		} else if (ins1 == "UpToWizard-3" || ins1 == "UTW-3" || ins1 == "wizard-3") {
			int pass;
			cout << "请输入密码:";
			int realpass = rand();
			ofstream outdata("data2.txt", ios::binary | ios::app | ios::in | ios::out);
			outdata << realpass << endl;
			cin >> pass;
			if (pass == realpass) {
				IDEN = "wizard-3";
				cout << "您成功提升为";
				color(5);
				cout << "大巫师" << endl;
				color(16);
			}
		} else if (ins1 == "UpToWizard-4" || ins1 == "UTW-4" || ins1 == "wizard-4") {
			int pass;
			cout << "请输入密码:";
			int realpass = rand();
			ofstream outdata("data2.txt", ios::binary | ios::app | ios::in | ios::out);
			outdata << realpass << endl;
			cin >> pass;
			if (pass == realpass) {
				IDEN = "wizard-4";
				cout << "您成功提升为";
				color(6);
				cout << "天神" << endl;
				color(16);
			}
		} else if (ins1 == "UpToWizard-5" || ins1 == "UTW-5" || ins1 == "wizard-5") {
			int pass;
			cout << "请输入密码:";
			int realpass = rand();
			ofstream outdata("data2.txt", ios::binary | ios::app | ios::in | ios::out);
			outdata << realpass << endl;
			cin >> pass;
			if (pass == realpass) {
				IDEN = "wizard-5";
				cout << "您成功提升为";
				color(4);
				cout << "创世主" << endl;
				color(16);
			}
		} else if (ins1 == "goto") {
			if (IDEN == "wizard-1" || IDEN == "wizard-2" || IDEN == "wizard-3"
				|| IDEN == "wizard-4" || IDEN == "wizard-5") {
				string w;
				bool is = false;
				cin >> w;
				for (int i = 0; i < 100; i++) {
					if (room[i].Englishname == w) {
						color(6);
						cout << "你化作长虹而去" << endl;
						color(16);
						nowroomi = i;
						inroom = room[i];
						outroom();
						color(6);
						cout << "你见到了地方,收起金光,稳稳地站在了地上" << endl;
						color(16);
						is = true;
						break;
					}
				}
				if (!is) {
					cout << "你要去哪里?" << endl;
					cout << "指令格式:goto <某地>" << endl;
				}
			} else {
				cout << "什么?" << endl;
			}
		} else if (ins1 == "smash") {
			if (IDEN == "wizard-2" || IDEN == "wizard-3" || IDEN == "wizard-4"
				|| IDEN == "wizard-5") {
				string w;
				bool is = false;
				cin >> w;
				for (int i = 0; i < 100; i++) {
					if (inroom.people[i].Englishname == w) {
						color(4);
						cout << "突然,乌云密布,天空中劈下一道闪电..." << endl;
						cout << "正中";
						color(6);
						cout << inroom.people[i].name << endl << inroom.people[i].name;
						color(4);
						cout << "大叫一声,口吐鲜血,倒在地上,死了!" << endl;
						color(16);
						make_corpse(inroom.people[i], inroom.people[i].weapon);
						break;
					}
				}
				if (!is) {
					cout << "你要劈谁?" << endl;
					cout << "指令格式:smash <某人>" << endl;
				}
			} else {
				cout << "什么?" << endl;
			}
		} else if (ins1 == "ls") {
			if (IDEN == "wizard-2" || IDEN == "wizard-3" || IDEN == "wizard-4"
				|| IDEN == "wizard-5") {
				cout << "屠龙刀(tulongdao) 倚天剑(yitianjian) 射日弓(sherigong)" << endl;
				cout << "战神弓(zhanshengong) 战神剑(zhanshengjian) 战神甲(zhanshenjia) 战神靴(zhanshenjian) 战神刀(zhanshendao)"
				<< endl;
				cout << "战神棍(zhanshengun) 战神鞭(zhanshenbian)" << endl;
				cout << "钢刀(blade) 剑(sword) 长剑(longsword) 凝碧剑(greensword) 斩铁刀(zhantiedao)"
				<< endl;
				cout << "齐眉棍(qimeigun) 打狗棍(dagougun)" << endl;
			} else {
				cout << "什么?" << endl;
			}
		} else if (ins1 == "make_weapon") {
			if (IDEN == "wizard-2" || IDEN == "wizard-3" || IDEN == "wizard-4"
				|| IDEN == "wizard-5") {
				int i;
				for (i = 0; i < 100; i++) {
					if (inroom.thing[i].name == "") {
						break;
					}
				}
				cout << "武器类型有:{剑,刀,鞭,棍,拳}" << endl;
				cout << "格式: make<名字><英文名><武器类型><武器描述><价格><攻击><增加生命><增加内力><增加防御><增加轻功><增加命中>"
				<< endl;
				cin >> inroom.weapon[i].name >> inroom.weapon[i].Englishname >>
				inroom.weapon[i].type >> inroom.weapon[i].tell >> inroom.weapon[i].coin >>
				inroom.weapon[i].plusdamage >> inroom.weapon[i].plushealth >>
				inroom.weapon[i].plusforce >> inroom.weapon[i].plusdefense >>
				inroom.weapon[i].plusdodge >> inroom.weapon[i].plushit;
				inroom.weapon[i].lv = 16;
				room[nowroomi].weapon[i] = inroom.weapon[i];
				color(6);
				cout << "创造成功。" << endl;
				color(16);
			} else {
				cout << "什么?" << endl;
			}
		} else if (ins1 == "make_thing") {
			if (IDEN == "wizard-2" || IDEN == "wizard-3" || IDEN == "wizard-4"
				|| IDEN == "wizard-5") {
				int i;
				for (i = 0; i < 100; i++) {
					if (inroom.thing[i].name == "") {
						break;
					}
				}
				cout << "格式: make<名字><英文名><物品描述><价格>" << endl;
				cin >> inroom.thing[i].name >> inroom.thing[i].Englishname >>
				inroom.thing[i].tell >> inroom.thing[i].coin;
				room[nowroomi].thing[i] = inroom.thing[i];
				color(6);
				cout << "创造成功。" << endl;
				color(16);
			} else {
				cout << "什么?" << endl;
			}
		} else if (ins1 == "make_book") {
			if (IDEN == "wizard-2" || IDEN == "wizard-3" || IDEN == "wizard-4"
				|| IDEN == "wizard-5") {
				color(4);
				cout << "暂不支持创造书" << endl;
				color(16);
			} else {
				cout << "什么?" << endl;
			}
		} else if (ins1 == "call") {
			if (IDEN == "wizard-3" || IDEN == "wizard-4" || IDEN == "wizard-5") {
当然,我可以帮你规划一个UE4地编(Level Design)的学习路线。这是一个基本的学习路线,你可以根据自己的兴趣和需求进行调整。 1. 学习基础知识: - 了解UE4编辑器的基本操作,包括创建、导入和编辑地形、静态网格等。 - 学习UE4的蓝图系统,了解如何创建基本的互动和游戏玩法。 - 学习材质系统,了解如何创建和应用材质到地形和物体上。 2. 地形设计: - 学习使用UE4的地形编辑器,掌握创建和调整地形的技巧。 - 学习使用高度图(Heightmap)来创建自然地形,并掌握如何平滑和细节化地形。 - 学习使用纹理混合来增加地形的细节和真实感。 - 学习在地形上放置植被、岩石等环境元素,并掌握合理布局的技巧。 3. 关卡设计: - 学习关卡设计原则和技巧,了解如何创造有趣和具挑战性的游戏关卡。 - 学习使用静态网格和模型来构建关卡的基本结构和场景。 - 学习使用蓝图系统来创建关卡的互动元素,如机关、任务等。 - 学习光照和后期处理技术,提高关卡的视觉效果和氛围。 4. 场景优化: - 学习场景优化的技巧,包括减少多边形数量、合并网格、使用LOD等。 - 学习使用贴花系统和粒子效果来增加场景的细节和真实感。 - 学习使用Level Streaming技术来优化大型场景的性能。 5. 进阶学习: - 学习使用UE4的虚幻引擎自带工具,如虚拟现实(VR)和增强现实(AR)等。 - 学习使用UE4的蓝图系统编写自定义的地编工具和脚本。 - 参与项目实践,练习地编技能并与其他开发者交流经验。 希望这个学习路线对你有帮助!祝你在UE4地编学习中取得成功!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值