bool FindYaoGuaiOrder() { int findnum = 0; FindAgain: findnum++; if (findnum >= 3) { return(false); } Send("findguai"); Send("look"); Send("open Door"); Console.WriteLine("==============================================模拟命令findguai"); Thread.Sleep(1000); List <string> dirs = Global.CURRENT_ROOM.Dirs.Select(dir => dir.EnglishName).ToList(); Console.WriteLine("=========================================开始在" + Global.CURRENT_ROOM.ShortDesc + "寻找"); string tmp = ""; foreach (string dir in dirs) { tmp += dir + ","; } Console.WriteLine("=========================================开始在下面的方向搜索" + tmp); for (int i = 0; i < dirs.Count; i++) { if (GoFind(dirs[i])) { goto FindYG; } if (CheckIfSpecialPlace()) { return(false); } string back = UtilFunction.GetBackDirection(dirs[i]); Send("look"); Thread.Sleep(500); dirs = Global.CURRENT_ROOM.Dirs.Select(dir => dir.EnglishName).ToList(); if (dirs.Count == 1) { back = dirs[0]; } if (string.IsNullOrEmpty(back) || !dirs.Contains(back)) { Console.WriteLine("=========================================================顺序寻找没找到回去的路"); goto FindAgain; } if (GoFind(back)) { goto FindYG; } } Console.WriteLine("=========================================一轮顺序搜索完毕,地点是" + Global.CURRENT_ROOM.ShortDesc); goto FindAgain; FindYG: Console.WriteLine("=========================================================已经发现妖怪了"); return(true); }
void EighthLevel() { List <string> dirs = Global.CURRENT_ROOM.Dirs.Where(dir => dir.ChineseName.Contains("奉祭场")).Select(dir => dir.EnglishName).ToList(); for (int i = 0; i < dirs.Count; i++) { GoFight(dirs[i]); string back = UtilFunction.GetBackDirection(dirs[i]); GoFight(back); } string dirStr = Global.CURRENT_ROOM.Dirs.Where(dir => dir.ChineseName.Contains("阎罗殿")).Select(dir => dir.EnglishName).ToList().First(); GoFight(dirStr); }