如何编出一个大型游戏
第四部(3000~4000行)
cout << people[x].name << "气喘吁吁,有点累了";
color(16);
cout << ")" << endl;
} else if (people[x].health > people[x].maxhealth / 6 * 2) {
cout << "(";
color(12);
cout << people[x].name << "摇头晃脑,但还能支撑一会";
color(16);
cout << ")" << endl;
} else if (people[x].health > people[x].maxhealth / 6) {
cout << "(";
color(12);
cout << people[x].name << "已经力不从心,随时都可能倒下";
color(16);
cout << ")" << endl;
} else {
cout << "(";
color(4);
cout << people[x].name << "已如风中残烛,生命危在旦夕";
color(16);
cout << ")" << endl;
}
if (people[x].health <= 0) {
cout << people[x].name << "说:在下实力实在不如大侠!" << endl;
inroom.people[x].health = inroom.people[x].maxhealth;
room[nowroomi].people[x] = inroom.people[x];
die[x] = true;
lastpeople--;
if (lastpeople == 0) {
for (int i = 0; i < peoplenum; i++) {
room[nowroomi].people[peoplei[i]].canmove = cm[i];
inroom.people[peoplei[i]].canmove = cm[i];
}
return 0;
}
}
}
}
}
} else {
for (int j = 0; j < GeneralAttack[people[x].weapon.type].size(); j++) {
if (GeneralAttack[people[x].weapon.type][j] == 'a') {
cout << people[x].name;
} else if (GeneralAttack[people[x].weapon.type][j] == 'x') {
color(people[x].weapon.lv);
cout << people[x].weapon.name;
color(16);
} else if (GeneralAttack[people[x].weapon.type][j] == 'b') {
cout << "你";
} else {
cout << GeneralAttack[people[x].weapon.type][j];
}
}
cout << endl << endl;
if (rand() % 10000 < dodge - people[x].hit) {
if (nowdodgeskill.name != "") {
for (int k = 0; k < nowdodgeskill.use.size(); k++) {
if (nowdodgeskill.use[k] == 'w') {
color(nweapon.lv);
cout << nweapon.name;
color(16);
} else if (nowdodgeskill.use[k] == 'e') {
cout << people[x].name;
} else if (nowdodgeskill.use[k] == 'q') {
color(people[x].weapon.lv);
cout << people[x].weapon.name;
color(16);
} else if (nowdodgeskill.use[k] == '1') {
color(1);
} else if (nowdodgeskill.use[k] == '2') {
color(2);
} else if (nowdodgeskill.use[k] == '3') {
color(3);
} else if (nowdodgeskill.use[k] == '4') {
color(4);
} else if (nowdodgeskill.use[k] == '5') {
color(5);
} else if (nowdodgeskill.use[k] == '6') {
color(6);
} else if (nowdodgeskill.use[k] == '7') {
color(7);
} else if (nowdodgeskill.use[k] == '8') {
color(8);
} else if (nowdodgeskill.use[k] == '9') {
color(9);
} else if (nowdodgeskill.use[k] == 's') {
color(16);
} else {
cout << nowdodgeskill.use[k];
}
}
cout << endl;
} else {
cout << " 你轻轻一跳,躲过了这一招" << endl;
}
} else {
int ran = rand() % 40 - 20;
if (people[x].weapon.type == "拳") {
if (people[x].damage + ran - defense < 0) {
cout << people[x].name << "在你身上照成了一块於,造成0点伤害!" << endl;
} else {
cout << people[x].name << "在你身上照成了一块於,造成" << people[x].damage + ran
- defense << "点伤害!" << endl;
health -= people[x].damage + ran - defense;
}
} else {
if (people[x].damage + ran - defense < 0) {
cout << people[x].name << "手中";
color(people[x].weapon.lv);
cout << people[x].weapon.name;
color(16);
cout << "击中对方手部,造成0点伤害!" << endl;
} else {
cout << people[x].name << "手中";
color(people[x].weapon.lv);
cout << people[x].weapon.name;
color(16);
cout << "击中对方手部,造成" << people[x].damage + ran - defense << "点伤害!"
<< endl;
health -= people[x].damage + ran - defense;
}
}
if (health > maxhealth / 6 * 5) {
cout << "(";
color(10);
cout << "你看起来一点也不累,充满了活力";
color(16);
cout << ")" << endl;
} else if (health > maxhealth / 6 * 4) {
cout << "(";
color(14);
cout << "你看上去受了一点小伤,但并不碍事";
color(16);
cout << ")" << endl;
} else if (health > maxhealth / 6 * 3) {
cout << "(";
color(14);
cout << "你气喘吁吁,有点累了";
color(16);
cout << ")" << endl;
} else if (health > maxhealth / 6 * 2) {
cout << "(";
color(12);
cout << "你摇头晃脑,但还能支撑一会";
color(16);
cout << ")" << endl;
} else if (health > maxhealth / 6) {
cout << "(";
color(12);
cout << "你已经力不从心,随时都可能倒下";
color(16);
cout << ")" << endl;
} else {
cout << "(";
color(4);
cout << "你已如风中残烛,生命危在旦夕";
color(16);
cout << ")" << endl;
}
if (health <= 0) {
cout << "你说:在下实力实在不如大侠!" << endl;
health = maxhealth / 2;
for (int i = 0; i < peoplenum; i++) {
room[nowroomi].people[peoplei[i]].canmove = cm[i];
inroom.people[peoplei[i]].canmove = cm[i];
}
return 1;
} else if (isrebound) {
int att = people[x].skills[i].damage * reboundnum / 1000 + ran -
people[x].defense;
if (att < 0) {
att = 0;
}
cout << "你抽出";
color(nweapon.lv);
cout << nweapon.name;
color(16);
cout << "一挡,对方手中";
color(people[x].weapon.lv);
cout << people[x].weapon.name;
color(16);
cout << "往后一弹,把伤害打到了自己身上,造成" << att << "点伤害!" << endl;
people[x].health -= att;
inroom.people[peoplei[x]].health -= att;
room[nowroomi].people[peoplei[x]].health -= att;
if (people[x].health > people[x].maxhealth / 6 * 5) {
cout << "(";
color(10);
cout << people[x].name << "看起来一点也不累,充满了活力";
color(16);
cout << ")" << endl;
} else if (people[x].health > people[x].maxhealth / 6 * 4) {
cout << "(";
color(14);
cout << people[x].name << "看上去受了一点小伤,但并不碍事";
color(16);
cout << ")" << endl;
} else if (people[x].health > people[x].maxhealth / 6 * 3) {
cout << "(";
color(14);
cout << people[x].name << "气喘吁吁,有点累了";
color(16);
cout << ")" << endl;
} else if (people[x].health > people[x].maxhealth / 6 * 2) {
cout << "(";
color(12);
cout << people[x].name << "摇头晃脑,但还能支撑一会";
color(16);
cout << ")" << endl;
} else if (people[x].health > people[x].maxhealth / 6) {
cout << "(";
color(12);
cout << people[x].name << "已经力不从心,随时都可能倒下";
color(16);
cout << ")" << endl;
} else {
cout << "(";
color(4);
cout << people[x].name << "已如风中残烛,生命危在旦夕";
color(16);
cout << ")" << endl;
}
if (people[x].health <= 0) {
cout << people[x].name << "说:在下实力实在不如大侠!" << endl;
inroom.people[x].health = inroom.people[x].maxhealth;
room[nowroomi].people[x] = inroom.people[x];
die[x] = true;
lastpeople--;
if (lastpeople == 0) {
for (int i = 0; i < peoplenum; i++) {
room[nowroomi].people[peoplei[i]].canmove = cm[i];
inroom.people[peoplei[i]].canmove = cm[i];
}
return 0;
}
}
}
}
}
}
}
for (int i = 0; i < 100; i++) {
if (cooldown[i] != 0) {
cooldown[i] -= 1;
}
if (hcooldown[i] != 0) {
hcooldown[i] -= 1;
}
}
}
return 0;
}
int choose() {
int a, b, c, d, e;
cout << "请重新选择你的属性:<";
color(10);
cout << "生命";
color(16);
cout << "> <";
color(4);
cout << "攻击";
color(16);
cout << "> <";
color(14);
cout << "防御";
color(16);
cout << "> <";
color(11);
cout << "躲避";
color(16);
cout << "> <";
color(13);
cout << "命中";
color(16);
cout << "> 加起来等于";
color(4);
cout << "100";
color(16);
cout << ",选择后你的属性为" << endl;
cout << "生命 = 你选择的生命×50" << endl;
cout << "攻击 = 你选择的×5" << endl;
cout << "防御 = 你选择的防御" << endl;
cout << "躲避 = 你选择的躲避×5" << endl;
cout << "命中 = 你选择的命中×5" << endl;
cout << "现在,请选择:";
cin >> a >> b >> c >> d >> e;
if (a + b + c + d + e == 100) {
cout << "选择完毕..." << endl;
health = a * 50;
maxhealth = a * 50;
damage = b * 5;
defense = c;
dodge = d * 5;
hit = e * 5;
} else {
cout << "你选择的数的和不等于100" << endl;
choose();
}
return 0;
}
int walk() {
while (1) {
for (int i = 0; i < 100; i++) {
for (int j = 0; j < 100; j++) {
if (room[i].people[j].canmove && rand() % 10000 == 0 && rand() % 100 == 0) {
int dirnum = 0;
for (int k = 0; room[i].dir[k] != ""; k++) {
dirnum++;
}
int wh = rand() % dirnum;
for (int k = 0; k < 100; k++) {
if (room[room[i].cango[wh]].people[k].name == "") {
if (room[i].cango[wh] == nowroomi) {
color(11);
cout << room[i].people[j].name << "走了过来。" << endl;
inroom.people[k] = room[i].people[j];
color(16);
}
if (i == nowroomi) {
color(11);
cout << room[i].people[j].name << "向" << room[i].dir[wh] << "离去。" << endl;
color(16);
inroom.people[j] = {};
}
room[room[i].cango[wh]].people[k] = room[i].people[j];
room[i].people[j] = {};
break;
}
}
}
}
}
}
}
int main() {
int a, b, c, d, e;
srand((unsigned)time(NULL));
cout << "初始值加载完成(12951324/12951324)" << endl;
ofstream outdata("update.txt", ios::binary | ios::app | ios::in | ios::out);
ifstream fin("update.txt");
string od;
fin >> od;
if (od != edition) {
cout << "发现新版本,是否更新?(y/n)" << endl;
cin >> od;
if (od == "y" || od == "yes" || od == "Y") {
ofstream clear("update.txt", ios::trunc);
outdata << edition;
outdata.close();
for (int i = 0; i < 100; i++) {
system("cls");
cout << "更新中(" << edition << ")...[" << i << "/100]" << endl;
Sleep(rand() % 100);
}
} else {
return 0;
}
}
inroom = room[0];
for (int i = 0; i <= 146; i++) {
system("cls");
cout << "初始值加载完成(12951324/12951324)" << endl;
cout << "加载数据中...(";
cout << i;
cout << "/146)" << endl;
Sleep(rand() % 50);
}
system("cls");
cout << "初始值加载完成(12951324/12951324)" << endl;
cout << "加载数据完成...(146/146)" << endl;
system("pause");
system("cls");
color(11);
cout << edition << "无存档游玩版 " << endl;
color(6);
cout << " " << endl;
cout << " 4&( " << endl;
cout << " ' ~&&\\yM#1 " << endl;
cout << " ,_'Q!!NMW& ";
color(16);
color(14);
cout << "龙 的 传 人" << endl;
color(6);
cout << " WCb 7N@4D Q%,, ";
color(4);
cout << "Legend of the Dragon" << endl;
color(6);
cout << " PM'*MDk#M0p, " << endl;
cout << " J@J0&e~~4r' ,bQEQ " << endl;
cout << " F8I&#' _&B$$bW#&$ " << endl;
cout << " &0A1 L#DE&E~!QEQ, " << endl;
cout << " _=, ,#ORN1 _T@O$' ZN$Q. grNq5 " << endl;
cout << " ^ 'd ,OKOpK^ g*QOg' #Q4p&,/g9X*&#,_/ (q " << endl;
cout << " TA1 ,sDQWh4^ x&NMO' _ #FQ#K#fA# '*K#XWP~-" << endl;
cout << " ^&p,wNMMOqD: /HE#EN' ..#g)~'@NGOQx, '=X* " << endl;
cout << " ' '43$'hEk##mOD04f_g ~^ ~ '-OO**O " << endl;
cout << " ''=0#0Nq2WOBF^#, _ P,, " << endl;
cout << " . ^,,~ ~b'' **R3' " << endl;
cout << " ow,F +#F~' " << endl;
cout << " /-9! ' \\ " << endl;
color(10);
cout << "by Evan_song";
color(6);
cout << " R " << endl;
color(16);
_getch();
cout << "请输入你的英文名:";
cin >> myEnglishname;
cout << "请输入你的中文名:";
cin >> myname;
cout << "请选择你的属性:<";
color(10);
cout << "生命";
color(16);
cout << "> <";
color(4);
cout << "攻击";
color(16);
cout << "> <";
color(14);
cout << "防御";
color(16);
cout << "> <";
color(11);
cout << "躲避";
color(16);
cout << "> <";
color(13);
cout << "命中";
color(16);
cout << "> 加起来等于";
color(4);
cout << "100";
color(16);
cout << ",选择后你的属性为" << endl;
cout << "生命 = 你选择的生命×50" << endl;
cout << "攻击 = 你选择的×5" << endl;
cout << "防御 = 你选择的防御" << endl;
cout << "躲避 = 你选择的躲避×5" << endl;
cout << "命中 = 你选择的命中×5" << endl;
cout << "现在,请选择:";
cin >> a >> b >> c >> d >> e;
if (a + b + c + d + e == 100) {
cout << "选择完毕..." << endl;
health = a * 50;
maxhealth = a * 50;
damage = b * 5;
defense = c;
dodge = d * 5;
hit = e * 5;
} else {
cout << "你选择的数的和不等于100" << endl;
choose();
}
cout << endl << endl;
color(4);
cout << "______.-=+:/'";
color(11);
cout << "游戏公告";
color(4);
cout << "'\\:+=-.______" << endl;
color(10);
cout << "一,游戏更新v" << edition << endl;
cout << " 1,减少代码长度" << endl;
cout << " 2,修复武道塔BUG" << endl;
cout << " 3,新增镶嵌宝石" << endl;
cout << " 3,新增任务(task),可在任务地点或店小二那里接任务" << endl;
color(16);
cout << endl << endl;
outroom();
string po = ">";
thread thread_walk(walk);
while (1) {
if (!baishi) {
color(4);
cout << "作者建议你迅速拜师,用menpai来查询门派" << endl;
color(16);
}
if (health <= 0) {
color(4);
cout << "你眼前一黑,就什么也不知道了..." << endl;
color(16);
dienum++;
Sleep(1000);
nowroomi = 4;
inroom = room[4];
outroom();
health = maxhealth;
}
cout << po;
string ins1;
color(15);
cin >> ins1;
color(16);
if (ins1 == "l" || ins1 == "look") {
string name;
cin >> name;
if (name == "room") {
outroom();
} else {
bool is = false;
for (int i = 0; i < 100; i++) {
if (inroom.people[i].Englishname == name || inroom.people[i].name == name) {
color(12);
cout << inroom.people[i].name << endl;
color(16);
cout << inroom.people[i].tell << endl;
is = true;
break;
}
}
for (int i = 0; i < 100; i++) {
if (inroom.weapon[i].Englishname == name || inroom.weapon[i].name == name) {
color(inroom.weapon[i].lv);
cout << inroom.weapon[i].name << endl;
color(16);
if (inroom.weapon[i].type == "剑") {
color(6);
cout << " ◢" << endl;
cout << " █" << endl;
cout << "⊙█████";
color(15);
cout << "〓〓〓〓〓〓〓〓〓〓>" << endl;
color(6);
cout << " █" << endl;
cout << " ◥" << endl;
color(16);
}
if (inroom.weapon[i].type == "刀") {
color(6);
cout << " ▲ " << endl;
cout << "◇████";
color(8);
cout << "〓〓〓〓〓〓〓◤" << endl;
color(6);
cout << " ▼ " << endl;
color(16);
}
if (inroom.weapon[i].type == "鞭") {
color(6);
cout << "〓〓〓";
color(8);
cout << "=========---------" << endl;
color(16);
}
cout << inroom.weapon[i].tell << endl;
cout << "武器属性:" << endl;
cout << "攻击:" << inroom.weapon[i].plusdamage << endl;
cout << "防御:" << inroom.weapon[i].plusdefense << endl;
cout << "躲闪:" << inroom.weapon[i].plusdodge << endl;
cout << "内力:" << inroom.weapon[i].plusforce << endl;
cout << "生命:" << inroom.weapon[i].plushealth << endl;
cout << "命中:" << inroom.weapon[i].plushit << endl;
cout << "镶嵌宝石:" << endl;
if (inroom.weapon[i].inlaynum == 0) {
cout << "此武器无镶嵌空" << endl;
} else {
for (int j = 0; j < inroom.weapon[i].inlaynum; j++) {
if (inroom.weapon[i].inlaything[j].name == "") {
cout << "◇" << endl;
} else {
cout << "◆" << inroom.weapon[i].inlaything[j].name <<
inroom.weapon[i].inlaything[j].coin << endl;
}
}
}
is = true;
break;
}
}
for (int i = 0; i < 100; i++) {
if (inroom.book[i].Englishname == name || inroom.book[i].name == name) {
color(12);
cout << inroom.book[i].name << endl;
color(16);
cout << inroom.book[i].tell << endl;
is = true;
break;
}
}
for (int i = 0; i < 100; i++) {
if (inroom.thing[i].Englishname == name || inroom.thing[i].name == name) {
color(12);
cout << inroom.thing[i].name << endl;
color(16);
cout << inroom.thing[i].tell << endl;
is = true;
break;
}
}
if (!is) {
cout << "你要看什么?" << endl;
}
}
} else if (ins1 == "kill" || ins1 == "k") {
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;
killall(x, 1, y);
is = true;
break;
}
}
if (!is) {
cout << "你要击杀谁?" << endl;
cout << "指令格式:kill <某人>" << endl;
}
} else if (ins1 == "killall") {
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 {
killall(x, num, y);
}
} else if (ins1 == "i") {
color(titlecolor);
cout << title;
if (title2 != "") {
cout << " " << title2;
}
cout << " " << myname << endl;
color(16);
cout << "你的功夫看起来";
if (allskilllevel == 0) {
color(8);
cout << "一无所知" << endl;
color(16);
} else if (allskilllevel < 500) {
color(2);
cout << "初学乍练" << endl;
color(16);
} else if (allskilllevel < 1000) {
color(2);
cout << "不知所以" << endl;
color(16);
} else if (allskilllevel < 1500) {
color(2);
cout << "略知一二" << endl;
color(16);
} else if (allskilllevel < 2000) {
color(2);
cout << "出入武林" << endl;
color(16);
} else if (allskilllevel < 2500) {
color(9);
cout << "半生不熟" << endl;
color(16);
} else if (allskilllevel < 3000) {
color(9);
cout << "渐入高深" << endl;
color(16);
} else if (allskilllevel < 3500) {
color(9);
cout << "平淡无奇" << endl;
color(16);
} else if (allskilllevel < 4000) {
color(9);
cout << "似有所悟" << endl;
color(16);
} else if (allskilllevel < 4500) {
color(9);
cout << "心神领会" << endl;
color(16);
} else if (allskilllevel < 5000) {
color(9);
cout << "运用自如" << endl;
color(16);
} else if (allskilllevel < 5500) {
color(14);
cout << "熟能生巧" << endl;
color(16);
} else if (allskilllevel < 6000) {
color(14);
cout << "驾轻就熟" << endl;
color(16);
} else if (allskilllevel < 6500) {
color(14);
cout << "高深莫测" << endl;
color(16);
} else if (allskilllevel < 7000) {
color(14);
cout << "万人之上" << endl;
color(16);
} else if (allskilllevel < 7500) {
color(14);
cout << "出神入化" << endl;
color(16);
} else if (allskilllevel < 8000) {
color(14);
cout << "惊天动地" << endl;
color(16);
} else if (allskilllevel < 8500) {
color(12);
cout << "旷古绝伦" << endl;
color(16);
} else if (allskilllevel < 9000) {
color(12);
cout << "举世无双" << endl;
color(16);
} else if (allskilllevel < 9500) {
color(12);
cout << "绝世高深" << endl;
color(16);
} else if (allskilllevel < 10000) {
color(12);
cout << "万年不朽" << endl;
color(16);
} else {
color(12);
cout << "返璞归真" << endl;
color(16);
}
cout << "你装备着:" << endl;
cout << "·";
color(nweapon.lv);
cout << nweapon.name << endl;
color(16);
cout << "你有";
color(14);
cout << gold;
color(16);
cout << "金 ";
color(7);
cout << silver;
color(16);
cout << "银 ";
color(6);
cout << coin;
color(16);
cout << "文" << endl;
cout << "你身上有:" << endl;
for (int i = 0; i < 200; i++) {
if (bag[i].name != "") {
color(bag[i].lv);
cout << bag[i].name;
color(16);
cout << "(";
color(3);
cout << bag[i].Englishname;
color(16);
cout << ")" << endl;
}
}
for (int i = 0; i < 200; i++) {
if (bag2[i].name != "") {
cout << bag2[i].name << "(";
color(3);
cout << bag2[i].Englishname;
color(16);
cout << ")" << endl;
}
}
for (int i = 0; i < 200; i++) {
if (bag3[i].name != "") {
cout << bag3[i].name << "(";
color(3);
cout << bag3[i].Englishname;
color(16);
cout << ")" << endl;
}
}
} else if (ins1 == "move" || ins1 == "m") {
string dir;
bool is = false;
cin >> dir;
for (int i = 0; i < 100; i++) {
if (inroom.dir[i] == dir) {
if (inroom.name == "财主家入口" && dir == "east") {
bool iskey = false;
for (int i = 0; i < 200; i++) {
if (bag3[i].Englishname == "key") {
iskey = true;
break;
}
}
if (iskey) {
nowroomi = inroom.cango[i];
inroom = room[inroom.cango[i]];
outroom();
} else {
color(11);
cout << "你试图打开大门,但发现大门被人上了锁..." << endl;
color(16);
}
} else if (inroom.name == "道路" && dir == "east") {
bool iskey = false;
for (int i = 0; i < 200; i++) {
if (bag3[i].Englishname == "key") {
iskey = true;
break;
}
}
if (iskey) {
nowroomi = inroom.cango[i];
inroom = room[inroom.cango[i]];
outroom();
} else {
color(11);
cout << "你试图打开宝库的大门,但发现大门被人上了锁..." << endl;
color(16);
}
} else if (inroom.name == "客栈" && dir == "up") {
if (mymenpai == "武当") {
inroom = room[26];
nowroomi = 26;
outroom();
} else if (mymenpai == "丐帮") {
inroom = room[27];
nowroomi = 27;
outroom();
} else if (mymenpai == "铸剑山庄") {
inroom = room[41];
nowroomi = 41;
outroom();
} else if (mymenpai == "道家") {
inroom = room[43];
nowroomi = 43;
outroom();
} else {
color(6);
cout << "这个入口是门派入口,你还没有拜入门派..." << endl;
color(16);
}
} else if (inroom.name == "武道塔" && dir == "up") {
if (inroom.people[0].name == "") {
wudaotalevel++;
color(4);
cout << ">>>成功进入武道塔第" << wudaotalevel << "层" << endl;
cout << ">>>增加1.5银," << wudaotalevel - 1 << "点潜能" << endl;
color(16);
silver += 1;
potential += wudaotalevel - 1;
experience += (wudaotalevel - 1) / 2;
inroom.tell = "你现在处于" + to_string(wudaotalevel) + "层";
inroom.people[0] = lvpeople[wudaotalevel];
room[nowroomi].tell = "你现在处于" + to_string(wudaotalevel) + "层";
room[nowroomi].people[0] = lvpeople[wudaotalevel];
ta[1] = true;
outroom();
} else {
color(6);
cout << inroom.people[0].name <<
"飞快的拦在了你的面前,说「打败我,就可以上去!」" << endl;
color(16);
}
} else {
nowroomi = inroom.cango[i];
inroom = room[inroom.cango[i]];
outroom();
}
is = true;
break;
}
}
if (!is) {
cout << "你要去哪里?" << endl;
cout << "指令格式:move <方向>" << endl;
}
} else if (ins1 == "get" || ins1 == "g") {
string type;
string thing;
cin >> type;
cin >> thing;
bool is = false;
for (int i = 0; i < 100; i++) {
if (type == "weapon") {
if ((inroom.weapon[i].name == thing || inroom.weapon[i].Englishname == thing
|| thing == "all") && inroom.weapon[i].name != "") {
for (int j = 0; j < 1000; j++) {
if (bag[j].name == "") {
bag[j] = inroom.weapon[i];
break;
}
}
cout << "你捡起一个";
color(inroom.weapon[i].lv);
cout << inroom.weapon[i].name << endl;
color(16);
inroom.weapon[i] = {};
room[nowroomi].weapon[i] = {};
is = true;
if (thing != "all") {
break;
}
}
} else if (type == "book") {
if ((inroom.book[i].name == thing || inroom.book[i].Englishname == thing
|| thing == "all") && inroom.book[i].name != "") {
bool isspace = false;
for (int j = 0; j < 1000; j++) {
if (bag2[j].name == "") {
bag2[j] = inroom.book[i];
isspace = true;
break;
}
}
cout << "你捡起一本" << inroom.book[i].name << endl;
inroom.book[i] = {};
room[nowroomi].book[i] = {};
is = true;
if (thing != "all") {
break;
}
}
} else if (type == "thing") {
if (inroom.thing[i].name == thing || inroom.thing[i].Englishname == thing
|| thing == "all") {
is = true;
if (inroom.thing[i].name == "富人家副本[建议经验1000时进入]") {
cout << myname << "进入富人家副本成功..." << endl;
cout << endl << endl;
cout << "这村子的财主这几夜来突然变得疯疯癫癫,不像人样,然而后几天突然就没了人影,你打算去调查一番"
<< endl;
cout << "你来到了财主家..." << endl;
cout << endl;
for (int j = 0; j < 12; j++) {
room[j + 8] = instancesroom1[j];
}
inroom = room[8];
nowroomi = 8;
outroom();
} else if (inroom.thing[i].name == "森林副本[建议经验500时进入]") {
cout << myname << "进入森林副本成功..." << endl;
cout << endl << endl;
cout << "最近村子里的猎手越来越少,基本上一去树林就回不来了,村里人让你去树林里查看一下"
<< endl;
cout << "你来到了树林..." << endl;
cout << endl;
for (int j = 0; j < 6; j++) {
room[j + 20] = instancesroom2[j];
}
inroom = room[20];
nowroomi = 20;
outroom();
} else if (inroom.thing[i].name == "胡斐副本[建议经验2500时进入]") {
cout << myname << "进入胡斐副本成功..." << endl;
cout << endl << endl;
cout << "你来到了胡斐居住地点..." << endl;
cout << endl;
for (int j = 0; j < 11; j++) {
room[j + 28] = instancesroom3[j];
}
inroom = room[28];
nowroomi = 28;
outroom();
} else if (inroom.thing[i].name == "练习室[无条件即可进入]") {
cout << myname << "进入练习室成功..." << endl;
cout << endl;
room[42] = instancesroom4[0];
inroom = room[42];
nowroomi = 42;
outroom();
} else if (inroom.thing[i].name != "") {
bool isspace = false;
for (int j = 0; j < 1000; j++) {
if (bag3[j].name == "") {
bag3[j] = inroom.thing[i];
isspace = true;
break;
}
}
cout << "你捡起一个" << inroom.thing[i].name << endl;
inroom.thing[i] = {};
room[nowroomi].thing[i] = {};
if (thing != "all") {
break;
}
}
}
}
}
if (!is) {
cout << "你要拿什么?" << endl;
cout << "指令格式:get <型号> <某物>" << endl;
}
} else if (ins1 == "drop") {
string type;
string thing;
cin >> type;