You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainWindow.xaml.cs 73 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using System.Diagnostics;
  16. using System.Windows.Threading;
  17. using Grpc.Core;
  18. using Protobuf;
  19. using Playback;
  20. using CommandLine;
  21. using Preparation.Utility;
  22. using Preparation.Interface;
  23. // 目前MainWindow还未复现的功能:
  24. // private void ClickToSetMode(object sender, RoutedEventArgs e)
  25. // private void Bonus()
  26. namespace Client
  27. {
  28. /// <summary>
  29. /// Interaction logic for MainWindow.xaml
  30. /// </summary>
  31. public partial class MainWindow : Window
  32. {
  33. public MainWindow()
  34. {
  35. unitHeight = unitWidth = unit = 13;
  36. bonusflag = true;
  37. timer = new DispatcherTimer
  38. {
  39. Interval = new TimeSpan(50000) // 每50ms刷新一次
  40. };
  41. timer.Tick += new EventHandler(Refresh); // 定时器初始化
  42. InitializeComponent();
  43. timer.Start();
  44. SetStatusBar();
  45. isClientStocked = true;
  46. isPlaybackMode = false;
  47. isSpectatorMode = false;
  48. drawPicLock = new();
  49. listOfProp = new List<MessageOfProp>();
  50. listOfHuman = new List<MessageOfStudent>();
  51. listOfButcher = new List<MessageOfTricker>();
  52. listOfBullet = new List<MessageOfBullet>();
  53. listOfBombedBullet = new List<MessageOfBombedBullet>();
  54. listOfAll = new List<MessageOfAll>();
  55. listOfChest = new List<MessageOfChest>();
  56. listOfClassroom = new List<MessageOfClassroom>();
  57. listOfDoor = new List<MessageOfDoor>();
  58. listOfGate = new List<MessageOfGate>();
  59. listOfHiddenGate = new List<MessageOfHiddenGate>();
  60. WindowStartupLocation = WindowStartupLocation.CenterScreen;
  61. ReactToCommandline();
  62. }
  63. private void SetStatusBar()
  64. {
  65. StatusBarsOfSurvivor = new StatusBarOfSurvivor[4];
  66. StatusBarsOfHunter = new StatusBarOfHunter(MainGrid, 3, 0);
  67. StatusBarsOfCircumstance = new StatusBarOfCircumstance(MainGrid, 1, 0);
  68. for (int i = 4; i < 8; i++)
  69. {
  70. StatusBarsOfSurvivor[i - 4] = new(MainGrid, i / 2 + 2, i % 2);
  71. }
  72. }
  73. // 获得地图信息,未更新数值
  74. private void GetMap(MessageOfMap obj)
  75. {
  76. int[,] map = new int[50, 50];
  77. try
  78. {
  79. for (int i = 0; i < 50; i++)
  80. {
  81. for (int j = 0; j < 50; j++)
  82. {
  83. map[i, j] = Convert.ToInt32(obj.Row[i].Col[j]) + 4;//与proto一致
  84. }
  85. }
  86. }
  87. catch
  88. {
  89. mapFlag = false;
  90. }
  91. finally
  92. {
  93. defaultMap = map;
  94. mapFlag = true;
  95. }
  96. }
  97. private void ReactToCommandline()
  98. {
  99. string[] args = Environment.GetCommandLineArgs();
  100. if (args.Length == 2)
  101. {
  102. Playback(args[1]);
  103. return;
  104. }
  105. _ = Parser.Default.ParseArguments<ArgumentOptions>(args).WithParsed(o =>
  106. { options = o; });
  107. if ((args.Length == 3 || args.Length == 4) && options != null && Convert.ToInt64(options.PlayerID) > 2023)
  108. {
  109. isSpectatorMode = true;
  110. string[] comInfo = new string[3];
  111. comInfo[0] = options.Ip;
  112. comInfo[1] = options.Port;
  113. comInfo[2] = options.PlayerID;
  114. ConnectToServer(comInfo);
  115. OnReceive();
  116. return;
  117. }
  118. if (options == null || options.cl == false)
  119. {
  120. OnReceive();
  121. }
  122. else
  123. {
  124. if (options.PlaybackFile == DefaultArgumentOptions.FileName)
  125. {
  126. try
  127. {
  128. string[] comInfo = new string[5];
  129. comInfo[0] = options.Ip;
  130. comInfo[1] = options.Port;
  131. comInfo[2] = options.PlayerID;
  132. comInfo[3] = options.PlayerType;
  133. comInfo[4] = options.Occupation;
  134. ConnectToServer(comInfo);
  135. OnReceive();
  136. }
  137. catch
  138. {
  139. OnReceive();
  140. }
  141. }
  142. else
  143. {
  144. Playback(options.PlaybackFile, options.PlaybackSpeed);
  145. }
  146. }
  147. }
  148. private void Playback(string fileName, double pbSpeed = 2.0)
  149. {
  150. var pbClient = new PlaybackClient(fileName, pbSpeed);
  151. int[,]? map;
  152. if ((map = pbClient.ReadDataFromFile(listOfProp, listOfHuman, listOfButcher, listOfBullet, listOfBombedBullet, listOfAll, listOfChest, listOfClassroom, listOfDoor, listOfHiddenGate, listOfGate, drawPicLock)) != null)
  153. {
  154. isClientStocked = false;
  155. isPlaybackMode = true;
  156. defaultMap = map;
  157. mapFlag = true;
  158. }
  159. else
  160. {
  161. MessageBox.Show("Failed to read the playback file!");
  162. isClientStocked = true;
  163. }
  164. }
  165. // 连接Server,comInfo[]的格式:0-ip 1- port 2-playerID 3-human/TrickerType 4-occupation
  166. private void ConnectToServer(string[] comInfo)
  167. {
  168. if (!isPlaybackMode)
  169. {
  170. if (!isSpectatorMode && comInfo.Length != 5 || isSpectatorMode && comInfo.Length != 3)
  171. throw new Exception("注册信息有误!");
  172. playerID = Convert.ToInt64(comInfo[2]);
  173. Connect.Background = Brushes.Gray;
  174. string connect = new string(comInfo[0]);
  175. connect += ':';
  176. connect += comInfo[1];
  177. Channel channel = new Channel(connect, ChannelCredentials.Insecure);
  178. client = new AvailableService.AvailableServiceClient(channel);
  179. PlayerMsg playerMsg = new PlayerMsg();
  180. playerMsg.PlayerId = playerID;
  181. if (!isSpectatorMode)
  182. {
  183. playerType = Convert.ToInt64(comInfo[3]) switch
  184. {
  185. 0 => PlayerType.NullPlayerType,
  186. 1 => PlayerType.StudentPlayer,
  187. 2 => PlayerType.TrickerPlayer,
  188. };
  189. playerMsg.PlayerType = playerType;
  190. if (Convert.ToInt64(comInfo[3]) == 1)
  191. {
  192. humanOrButcher = true;
  193. }
  194. else if (Convert.ToInt64(comInfo[3]) == 2)
  195. {
  196. humanOrButcher = false;
  197. }
  198. if (playerType == PlayerType.StudentPlayer)
  199. {
  200. switch (Convert.ToInt64(comInfo[4]))
  201. {
  202. case 1:
  203. playerMsg.StudentType = StudentType.Athlete;
  204. break;
  205. case 2:
  206. playerMsg.StudentType = StudentType.Teacher;
  207. break;
  208. case 3:
  209. playerMsg.StudentType = StudentType.StraightAStudent;
  210. break;
  211. case 4:
  212. playerMsg.StudentType = StudentType.Robot;
  213. break;
  214. case 5:
  215. playerMsg.StudentType = StudentType.TechOtaku;
  216. break;
  217. case 0:
  218. default:
  219. playerMsg.StudentType = StudentType.NullStudentType;
  220. break;
  221. }
  222. }
  223. else if (playerType == PlayerType.TrickerPlayer)
  224. {
  225. switch (Convert.ToInt64(comInfo[4]))
  226. {
  227. case 1:
  228. playerMsg.TrickerType = TrickerType.Assassin;
  229. break;
  230. case 2:
  231. playerMsg.TrickerType = TrickerType.Klee;
  232. break;
  233. case 3:
  234. playerMsg.TrickerType = TrickerType.ANoisyPerson;
  235. break;
  236. case 4:
  237. playerMsg.TrickerType = TrickerType._4;
  238. break;
  239. case 0:
  240. default:
  241. playerMsg.TrickerType = TrickerType.NullTrickerType;
  242. break;
  243. }
  244. }
  245. }
  246. responseStream = client.AddPlayer(playerMsg);
  247. Connect.Background = Brushes.Transparent;
  248. isClientStocked = false;
  249. PorC.Content = "⏸";
  250. // 建立连接的同时加入人物
  251. }
  252. }
  253. // 绘制道具
  254. private void DrawProp(MessageOfProp data, string text)
  255. {
  256. TextBox icon = new()
  257. {
  258. FontSize = 10,
  259. Width = 20,
  260. Height = 20,
  261. Text = text,
  262. HorizontalAlignment = HorizontalAlignment.Left,
  263. VerticalAlignment = VerticalAlignment.Top,
  264. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  265. Background = Brushes.Transparent,
  266. BorderBrush = Brushes.Transparent,
  267. IsReadOnly = true
  268. };
  269. UpperLayerOfMap.Children.Add(icon);
  270. }
  271. private void ZoomMap()
  272. {
  273. for (int i = 0; i < 50; i++)
  274. {
  275. for (int j = 0; j < 50; j++)
  276. {
  277. if (mapPatches[i, j] != null)
  278. {
  279. mapPatches[i, j].Width = UpperLayerOfMap.ActualWidth / 50;
  280. mapPatches[i, j].Height = UpperLayerOfMap.ActualHeight / 50;
  281. mapPatches[i, j].HorizontalAlignment = HorizontalAlignment.Left;
  282. mapPatches[i, j].VerticalAlignment = VerticalAlignment.Top;
  283. mapPatches[i, j].Margin = new Thickness(UpperLayerOfMap.ActualWidth / 50 * j, UpperLayerOfMap.ActualHeight / 50 * i, 0, 0);
  284. }
  285. }
  286. }
  287. }
  288. private void DrawMap()
  289. {
  290. for (int i = 0; i < defaultMap.GetLength(0); i++)
  291. {
  292. for (int j = 0; j < defaultMap.GetLength(1); j++)
  293. {
  294. mapPatches[i, j] = new()
  295. {
  296. Width = unitWidth,
  297. Height = unitHeight,
  298. HorizontalAlignment = HorizontalAlignment.Left,
  299. VerticalAlignment = VerticalAlignment.Top,
  300. Margin = new Thickness(Width * (j), Height * (i), 0, 0)
  301. };
  302. switch (defaultMap[i, j])
  303. {
  304. case 6:
  305. mapPatches[i, j].Fill = Brushes.Brown;
  306. mapPatches[i, j].Stroke = Brushes.Brown;
  307. break;//wall
  308. case 7:
  309. mapPatches[i, j].Fill = Brushes.Green;
  310. mapPatches[i, j].Stroke = Brushes.Green;
  311. break;//grass
  312. case 8:
  313. mapPatches[i, j].Fill = Brushes.LightPink;
  314. mapPatches[i, j].Stroke = Brushes.LightPink;
  315. break;//machine
  316. case 9:
  317. mapPatches[i, j].Fill = Brushes.LightSkyBlue;
  318. mapPatches[i, j].Stroke = Brushes.LightSkyBlue;
  319. break;//gate
  320. case 10:
  321. break;//emergency
  322. case 11:
  323. mapPatches[i, j].Fill = Brushes.Gray;
  324. mapPatches[i, j].Stroke = Brushes.Gray;
  325. break;//window
  326. case 12:
  327. case 13:
  328. case 14:
  329. mapPatches[i, j].Fill = Brushes.Khaki;
  330. mapPatches[i, j].Stroke = Brushes.Khaki;
  331. break;//door
  332. case 15:
  333. mapPatches[i, j].Fill = Brushes.Orange;
  334. mapPatches[i, j].Stroke = Brushes.Orange;
  335. break;//chest
  336. default:
  337. break;
  338. }
  339. UnderLayerOfMap.Children.Add(mapPatches[i, j]);
  340. }
  341. }
  342. hasDrawed = true;
  343. }
  344. //三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  345. private void DrawLaser(Point source, double theta, double range, double Width) // 三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  346. {
  347. Point[] endPoint = new Point[4];
  348. Point target = new();
  349. target.X = source.X + range * Math.Cos(theta);
  350. target.Y = source.Y + range * Math.Sin(theta);
  351. endPoint[0].X = source.X + Width * Math.Cos(theta - Math.PI / 2);
  352. endPoint[0].Y = source.Y + Width * Math.Sin(theta - Math.PI / 2);
  353. endPoint[1].X = target.X + Width * Math.Cos(theta - Math.PI / 2);
  354. endPoint[1].Y = target.Y + Width * Math.Sin(theta - Math.PI / 2);
  355. endPoint[2].X = target.X + Width * Math.Cos(theta + Math.PI / 2);
  356. endPoint[2].Y = target.Y + Width * Math.Sin(theta + Math.PI / 2);
  357. endPoint[3].X = source.X + Width * Math.Cos(theta + Math.PI / 2);
  358. endPoint[3].Y = source.Y + Width * Math.Sin(theta + Math.PI / 2);
  359. Polygon laserIcon = new();
  360. laserIcon.Stroke = System.Windows.Media.Brushes.Red;
  361. laserIcon.Fill = System.Windows.Media.Brushes.Red;
  362. laserIcon.StrokeThickness = 2;
  363. laserIcon.HorizontalAlignment = HorizontalAlignment.Left;
  364. laserIcon.VerticalAlignment = VerticalAlignment.Top;
  365. PointCollection laserEndPoints = new();
  366. for (int i = 0; i < 4; i++)
  367. {
  368. laserEndPoints.Add(endPoint[i]);
  369. }
  370. laserIcon.Points = laserEndPoints;
  371. UpperLayerOfMap.Children.Add(laserIcon);
  372. }
  373. private async void OnReceive() // 已按照3.5版proto更新信息,但是左侧信息栏还未填充。log未更新,switch1,2,3更新log
  374. {
  375. try
  376. {
  377. while (responseStream != null && await responseStream.ResponseStream.MoveNext())
  378. {
  379. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行,否则画图时foreach会有bug
  380. {
  381. listOfHuman.Clear();
  382. listOfButcher.Clear();
  383. listOfProp.Clear();
  384. listOfBombedBullet.Clear();
  385. listOfBullet.Clear();
  386. listOfAll.Clear();
  387. listOfChest.Clear();
  388. listOfClassroom.Clear();
  389. listOfDoor.Clear();
  390. listOfHiddenGate.Clear();
  391. listOfGate.Clear();
  392. MessageToClient content = responseStream.ResponseStream.Current;
  393. switch (content.GameState)
  394. {
  395. case GameState.GameStart:
  396. foreach (var obj in content.ObjMessage)
  397. {
  398. switch (obj.MessageOfObjCase)
  399. {
  400. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  401. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  402. {
  403. human = obj.StudentMessage;
  404. }
  405. if (obj.StudentMessage.PlayerId < GameData.numOfStudent)
  406. {
  407. IStudentType occupation = (IStudentType)OccupationFactory.FindIOccupation(Transformation.ToStudentType(obj.StudentMessage.StudentType));
  408. totalLife[obj.StudentMessage.PlayerId] = occupation.MaxHp;
  409. totalDeath[obj.StudentMessage.PlayerId] = occupation.MaxGamingAddiction;
  410. int i = 0;
  411. foreach (var skill in occupation.ListOfIActiveSkill)
  412. {
  413. var iActiveSkill = SkillFactory.FindIActiveSkill(skill);
  414. coolTime[i, obj.StudentMessage.PlayerId] = iActiveSkill.SkillCD;
  415. ++i;
  416. }
  417. }
  418. listOfHuman.Add(obj.StudentMessage);
  419. break;
  420. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  421. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  422. {
  423. butcher = obj.TrickerMessage;
  424. }
  425. IGhostType occupation1 = (IGhostType)OccupationFactory.FindIOccupation(Transformation.ToTrickerType(obj.TrickerMessage.TrickerType));
  426. int j = 0;
  427. foreach (var skill in occupation1.ListOfIActiveSkill)
  428. {
  429. var iActiveSkill = SkillFactory.FindIActiveSkill(skill);
  430. coolTime[j, GameData.numOfStudent] = iActiveSkill.SkillCD;
  431. ++j;
  432. }
  433. listOfButcher.Add(obj.TrickerMessage);
  434. break;
  435. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  436. listOfProp.Add(obj.PropMessage);
  437. break;
  438. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  439. listOfBombedBullet.Add(obj.BombedBulletMessage);
  440. break;
  441. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  442. listOfBullet.Add(obj.BulletMessage);
  443. break;
  444. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  445. listOfChest.Add(obj.ChestMessage);
  446. break;
  447. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  448. listOfClassroom.Add(obj.ClassroomMessage);
  449. break;
  450. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  451. listOfDoor.Add(obj.DoorMessage);
  452. break;
  453. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  454. listOfGate.Add(obj.GateMessage);
  455. break;
  456. case MessageOfObj.MessageOfObjOneofCase.MapMessage:
  457. GetMap(obj.MapMessage);
  458. break;
  459. }
  460. }
  461. listOfAll.Add(content.AllMessage);
  462. break;
  463. case GameState.GameRunning:
  464. foreach (var obj in content.ObjMessage)
  465. {
  466. switch (obj.MessageOfObjCase)
  467. {
  468. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  469. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  470. {
  471. human = obj.StudentMessage;
  472. }
  473. listOfHuman.Add(obj.StudentMessage);
  474. break;
  475. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  476. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  477. {
  478. butcher = obj.TrickerMessage;
  479. }
  480. listOfButcher.Add(obj.TrickerMessage);
  481. break;
  482. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  483. listOfProp.Add(obj.PropMessage);
  484. break;
  485. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  486. listOfBombedBullet.Add(obj.BombedBulletMessage);
  487. break;
  488. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  489. listOfBullet.Add(obj.BulletMessage);
  490. break;
  491. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  492. listOfChest.Add(obj.ChestMessage);
  493. break;
  494. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  495. listOfClassroom.Add(obj.ClassroomMessage);
  496. break;
  497. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  498. listOfDoor.Add(obj.DoorMessage);
  499. break;
  500. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  501. listOfGate.Add(obj.GateMessage);
  502. break;
  503. case MessageOfObj.MessageOfObjOneofCase.HiddenGateMessage:
  504. listOfHiddenGate.Add(obj.HiddenGateMessage);
  505. break;
  506. }
  507. }
  508. listOfAll.Add(content.AllMessage);
  509. break;
  510. case GameState.GameEnd:
  511. foreach (var obj in content.ObjMessage)
  512. {
  513. switch (obj.MessageOfObjCase)
  514. {
  515. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  516. listOfHuman.Add(obj.StudentMessage);
  517. break;
  518. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  519. listOfButcher.Add(obj.TrickerMessage);
  520. break;
  521. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  522. listOfProp.Add(obj.PropMessage);
  523. break;
  524. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  525. listOfBombedBullet.Add(obj.BombedBulletMessage);
  526. break;
  527. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  528. listOfBullet.Add(obj.BulletMessage);
  529. break;
  530. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  531. listOfChest.Add(obj.ChestMessage);
  532. break;
  533. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  534. listOfClassroom.Add(obj.ClassroomMessage);
  535. break;
  536. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  537. listOfDoor.Add(obj.DoorMessage);
  538. break;
  539. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  540. listOfGate.Add(obj.GateMessage);
  541. break;
  542. case MessageOfObj.MessageOfObjOneofCase.HiddenGateMessage:
  543. listOfHiddenGate.Add(obj.HiddenGateMessage);
  544. break;
  545. }
  546. }
  547. listOfAll.Add(content.AllMessage);
  548. break;
  549. }
  550. }
  551. if (responseStream == null)
  552. {
  553. throw new Exception("Unconnected");
  554. }
  555. }
  556. }
  557. catch (Exception ex)
  558. {
  559. ErrorDisplayer error = new("Error: " + ex.ToString());
  560. error.Show();
  561. }
  562. }
  563. //待修改
  564. private bool CanSee(MessageOfStudent msg)
  565. {
  566. if (msg.PlayerState == PlayerState.Quit || msg.PlayerState == PlayerState.Graduated)
  567. return false;
  568. if (isSpectatorMode)
  569. return true;
  570. if (humanOrButcher && human != null)
  571. {
  572. if (human.Guid == msg.Guid) // 自己能看见自己
  573. return true;
  574. }
  575. if (msg.Place == Protobuf.PlaceType.Grass || msg.Place == Protobuf.PlaceType.Gate || msg.Place == Protobuf.PlaceType.HiddenGate)
  576. return false;
  577. if (msg.Place == Protobuf.PlaceType.Land || msg.Place == Protobuf.PlaceType.Classroom)
  578. return true;
  579. if (humanOrButcher && human != null)
  580. {
  581. if (msg.Place != human.Place)
  582. return false;
  583. }
  584. else if (!humanOrButcher && butcher != null)
  585. {
  586. if (msg.Place != butcher.Place)
  587. return false;
  588. }
  589. return true;
  590. }
  591. private bool CanSee(MessageOfTricker msg)
  592. {
  593. if (isSpectatorMode)
  594. return true;
  595. if (!humanOrButcher && butcher != null)
  596. {
  597. if (butcher.Guid == msg.Guid) // 自己能看见自己
  598. return true;
  599. }
  600. if (msg.Place == Protobuf.PlaceType.Grass || msg.Place == Protobuf.PlaceType.Gate || msg.Place == Protobuf.PlaceType.HiddenGate)
  601. return false;
  602. if (msg.Place == Protobuf.PlaceType.Land || msg.Place == Protobuf.PlaceType.Classroom)
  603. return true;
  604. if (humanOrButcher && human != null)
  605. {
  606. if (msg.Place != human.Place)
  607. return false;
  608. }
  609. else if (!humanOrButcher && butcher != null)
  610. {
  611. if (msg.Place != butcher.Place)
  612. return false;
  613. }
  614. return true;
  615. }
  616. private bool CanSee(MessageOfProp msg)
  617. {
  618. if (isSpectatorMode)
  619. return true;
  620. if (msg.Place == Protobuf.PlaceType.Land)
  621. return true;
  622. if (humanOrButcher && human != null)
  623. {
  624. if (msg.Place != human.Place)
  625. return false;
  626. }
  627. else if (!humanOrButcher && butcher != null)
  628. {
  629. if (msg.Place != butcher.Place)
  630. return false;
  631. }
  632. return true;
  633. }
  634. private bool CanSee(MessageOfBullet msg)
  635. {
  636. if (isSpectatorMode)
  637. return true;
  638. if (msg.Place == Protobuf.PlaceType.Land)
  639. return true;
  640. if (humanOrButcher && human != null)
  641. {
  642. if (msg.Place != human.Place)
  643. return false;
  644. }
  645. else if (!humanOrButcher && butcher != null)
  646. {
  647. if (msg.Place != butcher.Place)
  648. return false;
  649. }
  650. return true;
  651. }
  652. private void Refresh(object? sender, EventArgs e) //log未更新
  653. {
  654. // Bonus();
  655. if (WindowState == WindowState.Maximized)
  656. MaxButton.Content = "❐";
  657. else
  658. MaxButton.Content = "🗖";
  659. if (StatusBarsOfSurvivor != null)
  660. {
  661. for (int i = 0; i < GameData.numOfStudent; i++)
  662. {
  663. StatusBarsOfSurvivor[i].SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  664. StatusBarsOfSurvivor[i].NewData(totalLife, totalDeath, coolTime);
  665. }
  666. }
  667. if (StatusBarsOfHunter != null)
  668. {
  669. StatusBarsOfHunter.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  670. StatusBarsOfHunter.NewData(totalLife, totalDeath, coolTime);
  671. }
  672. if (StatusBarsOfCircumstance != null)
  673. StatusBarsOfCircumstance.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  674. // 完成窗口信息更新
  675. if (!isClientStocked)
  676. {
  677. unit = Math.Sqrt(UpperLayerOfMap.ActualHeight * UpperLayerOfMap.ActualWidth) / 50;
  678. unitHeight = UpperLayerOfMap.ActualHeight / 50;
  679. unitWidth = UpperLayerOfMap.ActualWidth / 50;
  680. try
  681. {
  682. // if (log != null)
  683. //{
  684. // string temp = "";
  685. // for (int i = 0; i < dataDict[GameObjType.Character].Count; i++)
  686. // {
  687. // temp += Convert.ToString(dataDict[GameObjType.Character][i].MessageOfCharacter.TeamID) + "\n";
  688. // }
  689. // log.Content = temp;
  690. // }
  691. UpperLayerOfMap.Children.Clear();
  692. // if ((communicator == null || !communicator.Client.IsConnected) && !isPlaybackMode)
  693. //{
  694. // UnderLayerOfMap.Children.Clear();
  695. // throw new Exception("Client is unconnected.");
  696. // }
  697. // else
  698. //{
  699. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行
  700. {
  701. foreach (var data in listOfAll)
  702. {
  703. StatusBarsOfCircumstance.SetValue(data, gateOpened, isEmergencyDrawed, isEmergencyOpened, playerID);
  704. }
  705. if (!hasDrawed && mapFlag)
  706. DrawMap();
  707. foreach (var data in listOfHuman)
  708. {
  709. StatusBarsOfSurvivor[data.PlayerId].SetValue(data, data.PlayerId);
  710. if (CanSee(data))
  711. {
  712. Ellipse icon = new()
  713. {
  714. Width = 2 * radiusTimes * unitWidth,
  715. Height = 2 * radiusTimes * unitHeight,
  716. HorizontalAlignment = HorizontalAlignment.Left,
  717. VerticalAlignment = VerticalAlignment.Top,
  718. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth * radiusTimes, data.X * unitHeight / 1000.0 - unitHeight * radiusTimes, 0, 0),
  719. Fill = Brushes.BlueViolet,
  720. };
  721. UpperLayerOfMap.Children.Add(icon);
  722. }
  723. }
  724. foreach (var data in listOfButcher)
  725. {
  726. StatusBarsOfHunter.SetValue(data);
  727. if (CanSee(data))
  728. {
  729. Ellipse icon = new()
  730. {
  731. Width = 2 * radiusTimes * unitWidth,
  732. Height = 2 * radiusTimes * unitHeight,
  733. HorizontalAlignment = HorizontalAlignment.Left,
  734. VerticalAlignment = VerticalAlignment.Top,
  735. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth * radiusTimes, data.X * unitHeight / 1000.0 - unitHeight * radiusTimes, 0, 0),
  736. Fill = Brushes.Chocolate,
  737. };
  738. UpperLayerOfMap.Children.Add(icon);
  739. }
  740. }
  741. foreach (var data in listOfProp)
  742. {
  743. if (CanSee(data))
  744. {
  745. switch (data.Type)
  746. {
  747. case Protobuf.PropType.Key3:
  748. DrawProp(data, "🔑");
  749. break;
  750. case Protobuf.PropType.Key5:
  751. DrawProp(data, "🔑");
  752. break;
  753. case Protobuf.PropType.Key6:
  754. DrawProp(data, "🔑");
  755. break;
  756. case Protobuf.PropType.AddSpeed:
  757. DrawProp(data, "⛸");
  758. break;
  759. case Protobuf.PropType.AddHpOrAp:
  760. DrawProp(data, "♥");
  761. break;
  762. case Protobuf.PropType.AddLifeOrClairaudience:
  763. DrawProp(data, "🏅");
  764. break;
  765. case Protobuf.PropType.ShieldOrSpear:
  766. DrawProp(data, "🛡");
  767. break;
  768. case Protobuf.PropType.RecoveryFromDizziness:
  769. DrawProp(data, "🕶");
  770. break;
  771. default:
  772. DrawProp(data, "");
  773. break;
  774. }
  775. }
  776. }
  777. foreach (var data in listOfBullet)
  778. {
  779. if (CanSee(data))
  780. {
  781. Ellipse icon = new()
  782. {
  783. Width = 10,
  784. Height = 10,
  785. HorizontalAlignment = HorizontalAlignment.Left,
  786. VerticalAlignment = VerticalAlignment.Top,
  787. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  788. Fill = Brushes.Red,
  789. };
  790. switch (data.Type)
  791. {
  792. case Protobuf.BulletType.FlyingKnife:
  793. icon.Fill = Brushes.Blue;
  794. break;
  795. case Protobuf.BulletType.CommonAttackOfTricker:
  796. case Protobuf.BulletType.BombBomb:
  797. case Protobuf.BulletType.JumpyDumpty:
  798. icon.Fill = Brushes.Red;
  799. break;
  800. default:
  801. break;
  802. }
  803. UpperLayerOfMap.Children.Add(icon);
  804. }
  805. }
  806. foreach (var data in listOfBombedBullet)
  807. {
  808. switch (data.Type)
  809. {
  810. case Protobuf.BulletType.BombBomb:
  811. {
  812. Ellipse icon = new();
  813. double bombRange = data.BombRange / 1000;
  814. icon.Width = bombRange * unitWidth;
  815. icon.Height = bombRange * unitHeight;
  816. icon.HorizontalAlignment = HorizontalAlignment.Left;
  817. icon.VerticalAlignment = VerticalAlignment.Top;
  818. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  819. icon.Fill = Brushes.Red;
  820. UpperLayerOfMap.Children.Add(icon);
  821. break;
  822. }
  823. case Protobuf.BulletType.JumpyDumpty:
  824. {
  825. Ellipse icon = new Ellipse();
  826. double bombRange = data.BombRange / 1000;
  827. icon.Width = bombRange * unitWidth;
  828. icon.Height = bombRange * unitHeight;
  829. icon.HorizontalAlignment = HorizontalAlignment.Left;
  830. icon.VerticalAlignment = VerticalAlignment.Top;
  831. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  832. icon.Fill = Brushes.Red;
  833. UpperLayerOfMap.Children.Add(icon);
  834. break;
  835. }
  836. //case Protobuf.BulletType.LineBullet:
  837. // {
  838. // double bombRange = data.BombRange / 1000;
  839. // DrawLaser(new Point(data.Y * unitWidth / 1000.0, data.X * unitHeight / 1000.0), -data.FacingDirection + Math.PI / 2, bombRange * unitHeight, 0.5 * unitWidth);
  840. // break;
  841. // }
  842. default:
  843. break;
  844. }
  845. }
  846. foreach (var data in listOfClassroom)
  847. {
  848. int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfFixedGenerator);
  849. TextBox icon = new()
  850. {
  851. FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
  852. Width = unitWidth,
  853. Height = unitHeight,
  854. Text = Convert.ToString(deg),
  855. HorizontalAlignment = HorizontalAlignment.Left,
  856. VerticalAlignment = VerticalAlignment.Top,
  857. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  858. Background = Brushes.Transparent,
  859. BorderBrush = Brushes.Transparent,
  860. IsReadOnly = true
  861. };
  862. if (deg == 100)
  863. {
  864. icon.Text = "A+";
  865. }
  866. UpperLayerOfMap.Children.Add(icon);
  867. }
  868. foreach (var data in listOfChest)
  869. {
  870. int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedChest);
  871. TextBox icon = new()
  872. {
  873. FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
  874. Width = unitWidth,
  875. Height = unitHeight,
  876. Text = Convert.ToString(deg),
  877. HorizontalAlignment = HorizontalAlignment.Left,
  878. VerticalAlignment = VerticalAlignment.Top,
  879. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  880. Background = Brushes.Transparent,
  881. BorderBrush = Brushes.Transparent,
  882. IsReadOnly = true
  883. };
  884. if (deg == 100)
  885. {
  886. icon.Text = "Ø";
  887. }
  888. UpperLayerOfMap.Children.Add(icon);
  889. }
  890. foreach (var data in listOfGate)
  891. {
  892. int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedDoorway);
  893. TextBox icon = new()
  894. {
  895. FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
  896. Width = unitWidth,
  897. Height = unitHeight,
  898. Text = Convert.ToString(deg),
  899. HorizontalAlignment = HorizontalAlignment.Left,
  900. VerticalAlignment = VerticalAlignment.Top,
  901. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  902. Background = Brushes.Transparent,
  903. BorderBrush = Brushes.Transparent,
  904. IsReadOnly = true
  905. };
  906. if (deg == 100)
  907. {
  908. gateOpened = true;
  909. icon.Text = "🔓";
  910. }
  911. UpperLayerOfMap.Children.Add(icon);
  912. }
  913. foreach (var data in listOfDoor)
  914. {
  915. TextBox icon = new()
  916. {
  917. FontSize = 9 * UpperLayerOfMap.ActualHeight / 650,
  918. Width = unitWidth,
  919. Height = unitHeight,
  920. HorizontalAlignment = HorizontalAlignment.Left,
  921. VerticalAlignment = VerticalAlignment.Top,
  922. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  923. Background = Brushes.Transparent,
  924. BorderBrush = Brushes.Transparent,
  925. IsReadOnly = true
  926. };
  927. if (data.IsOpen)
  928. {
  929. icon.Text = Convert.ToString("🔓");
  930. }
  931. else
  932. {
  933. icon.Text = Convert.ToString("🔒");
  934. }
  935. UpperLayerOfMap.Children.Add(icon);
  936. }
  937. foreach (var data in listOfHiddenGate)
  938. {
  939. if (!isEmergencyDrawed)
  940. {
  941. mapPatches[data.X / Preparation.Utility.GameData.numOfPosGridPerCell, data.Y / Preparation.Utility.GameData.numOfPosGridPerCell].Fill = Brushes.LightSalmon;
  942. mapPatches[data.X / Preparation.Utility.GameData.numOfPosGridPerCell, data.Y / Preparation.Utility.GameData.numOfPosGridPerCell].Stroke = Brushes.LightSalmon;
  943. isEmergencyDrawed = true;
  944. }
  945. if (data.Opened)
  946. {
  947. isEmergencyOpened = true;
  948. TextBox icon = new()
  949. {
  950. FontSize = 9 * UpperLayerOfMap.ActualHeight / 650,
  951. Width = unitWidth,
  952. Height = unitHeight,
  953. Text = Convert.ToString("🔓"),
  954. HorizontalAlignment = HorizontalAlignment.Left,
  955. VerticalAlignment = VerticalAlignment.Top,
  956. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  957. Background = Brushes.Transparent,
  958. BorderBrush = Brushes.Transparent,
  959. IsReadOnly = true
  960. };
  961. }
  962. }
  963. //}
  964. ZoomMap();
  965. }
  966. }
  967. catch (Exception exc)
  968. {
  969. ErrorDisplayer error = new("Error: " + exc.ToString());
  970. error.Show();
  971. isClientStocked = true;
  972. PorC.Content = "▶";
  973. }
  974. }
  975. counter++;
  976. }
  977. // 键盘控制,未完善
  978. private void KeyBoardControl(object sender, KeyEventArgs e)
  979. {
  980. if (!isPlaybackMode && !isSpectatorMode)
  981. {
  982. switch (e.Key)
  983. {
  984. case Key.W:
  985. case Key.NumPad8:
  986. MoveMsg msgW = new()
  987. {
  988. PlayerId = playerID,
  989. TimeInMilliseconds = 25,
  990. Angle = Math.PI
  991. };
  992. client.Move(msgW);
  993. break;
  994. case Key.S:
  995. case Key.NumPad2:
  996. MoveMsg msgS = new()
  997. {
  998. PlayerId = playerID,
  999. TimeInMilliseconds = 25,
  1000. Angle = 0
  1001. };
  1002. client.Move(msgS);
  1003. break;
  1004. case Key.D:
  1005. case Key.NumPad6:
  1006. MoveMsg msgD = new()
  1007. {
  1008. PlayerId = playerID,
  1009. TimeInMilliseconds = 25,
  1010. Angle = Math.PI / 2
  1011. };
  1012. client.Move(msgD);
  1013. break;
  1014. case Key.A:
  1015. case Key.NumPad4:
  1016. MoveMsg msgA = new()
  1017. {
  1018. PlayerId = playerID,
  1019. TimeInMilliseconds = 25,
  1020. Angle = 3 * Math.PI / 2
  1021. };
  1022. client.Move(msgA);
  1023. break;
  1024. case Key.J:
  1025. AttackMsg msgJ = new()
  1026. {
  1027. PlayerId = playerID,
  1028. Angle = Math.PI
  1029. };
  1030. client.Attack(msgJ);
  1031. break;
  1032. case Key.K:
  1033. IDMsg msgK = new()
  1034. {
  1035. PlayerId = playerID,
  1036. };
  1037. client.StartLearning(msgK);
  1038. break;
  1039. case Key.R:
  1040. TreatAndRescueMsg msgR = new()
  1041. {
  1042. PlayerId = playerID,
  1043. ToPlayerId = -1,
  1044. };
  1045. client.StartRescueMate(msgR);
  1046. break;
  1047. case Key.T:
  1048. TreatAndRescueMsg msgT = new()
  1049. {
  1050. PlayerId = playerID,
  1051. ToPlayerId = -1,
  1052. };
  1053. client.StartTreatMate(msgT);
  1054. break;
  1055. case Key.G:
  1056. IDMsg msgG = new()
  1057. {
  1058. PlayerId = playerID,
  1059. };
  1060. client.Graduate(msgG);
  1061. break;
  1062. case Key.H:
  1063. IDMsg msgH = new()
  1064. {
  1065. PlayerId = playerID,
  1066. };
  1067. client.StartOpenGate(msgH);
  1068. break;
  1069. case Key.O:
  1070. IDMsg msgO = new()
  1071. {
  1072. PlayerId = playerID,
  1073. };
  1074. client.OpenDoor(msgO);
  1075. break;
  1076. case Key.P:
  1077. IDMsg msgP = new()
  1078. {
  1079. PlayerId = playerID,
  1080. };
  1081. client.CloseDoor(msgP);
  1082. break;
  1083. case Key.U:
  1084. IDMsg msgU = new()
  1085. {
  1086. PlayerId = playerID,
  1087. };
  1088. client.SkipWindow(msgU);
  1089. break;
  1090. case Key.I:
  1091. IDMsg msgI = new()
  1092. {
  1093. PlayerId = playerID,
  1094. };
  1095. client.StartOpenChest(msgI);
  1096. break;
  1097. case Key.E:
  1098. IDMsg msgE = new()
  1099. {
  1100. PlayerId = playerID,
  1101. };
  1102. client.EndAllAction(msgE);
  1103. break;
  1104. case Key.F:
  1105. PropMsg msgF = new()
  1106. {
  1107. PlayerId = playerID,
  1108. PropType = Protobuf.PropType.NullPropType,
  1109. };
  1110. client.PickProp(msgF);
  1111. break;
  1112. case Key.C:
  1113. PropMsg msgC = new()
  1114. {
  1115. PlayerId = playerID,
  1116. PropType = Protobuf.PropType.NullPropType,
  1117. };
  1118. client.ThrowProp(msgC);
  1119. break;
  1120. case Key.V:
  1121. PropMsg msgV = new()
  1122. {
  1123. PlayerId = playerID,
  1124. PropType = Protobuf.PropType.NullPropType,
  1125. };
  1126. client.UseProp(msgV);
  1127. break;
  1128. case Key.B:
  1129. SkillMsg msgB = new()
  1130. {
  1131. PlayerId = playerID,
  1132. SkillId = 0,
  1133. };
  1134. client.UseSkill(msgB);
  1135. break;
  1136. case Key.N:
  1137. SkillMsg msgN = new()
  1138. {
  1139. PlayerId = playerID,
  1140. SkillId = 1,
  1141. };
  1142. client.UseSkill(msgN);
  1143. break;
  1144. case Key.M:
  1145. SkillMsg msgM = new()
  1146. {
  1147. PlayerId = playerID,
  1148. SkillId = 2,
  1149. };
  1150. client.UseSkill(msgM);
  1151. break;
  1152. default:
  1153. break;
  1154. }
  1155. }
  1156. }
  1157. //鼠标双击
  1158. private void Attack(object sender, RoutedEventArgs e)
  1159. {
  1160. if (!isPlaybackMode && !isSpectatorMode)
  1161. {
  1162. if (humanOrButcher && human != null)
  1163. {
  1164. AttackMsg msgJ = new()
  1165. {
  1166. PlayerId = playerID
  1167. };
  1168. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  1169. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  1170. msgJ.Angle = Math.Atan2(mouseY - human.Y, mouseX - human.X);
  1171. client.Attack(msgJ);
  1172. }
  1173. if (!humanOrButcher && butcher != null)
  1174. {
  1175. AttackMsg msgJ = new()
  1176. {
  1177. PlayerId = playerID
  1178. };
  1179. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  1180. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  1181. msgJ.Angle = Math.Atan2(mouseY - butcher.Y, mouseX - butcher.X);
  1182. client.Attack(msgJ);
  1183. }
  1184. }
  1185. }
  1186. // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
  1187. private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
  1188. {
  1189. if (!isClientStocked)
  1190. {
  1191. isClientStocked = true;
  1192. PorC.Content = "▶";
  1193. }
  1194. else
  1195. {
  1196. isClientStocked = false;
  1197. PorC.Content = "⏸";
  1198. }
  1199. }
  1200. // 未复现
  1201. private void ClickToConnect(object sender, RoutedEventArgs e)
  1202. {
  1203. }
  1204. // 窗口最大化、关闭、最小化、拖拽
  1205. private void ClickToMaxmize(object sender, RoutedEventArgs e)
  1206. {
  1207. if (WindowState != WindowState.Maximized)
  1208. WindowState = WindowState.Maximized;
  1209. else
  1210. WindowState = WindowState.Normal;
  1211. }
  1212. private void ClickToClose(object sender, RoutedEventArgs e)
  1213. {
  1214. Application.Current.Shutdown();
  1215. }
  1216. private void ClickToMinimize(object sender, RoutedEventArgs e)
  1217. {
  1218. WindowState = WindowState.Minimized;
  1219. }
  1220. private void DragWindow(object sender, RoutedEventArgs e)
  1221. {
  1222. DragMove();
  1223. }
  1224. // 寻求帮助、访问EESAST(部分功能未复原)
  1225. private void ClickForHelp(object sender, RoutedEventArgs e)
  1226. {
  1227. PleaseWait();
  1228. }
  1229. private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
  1230. {
  1231. try
  1232. {
  1233. _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
  1234. }
  1235. catch (Exception)
  1236. {
  1237. //ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
  1238. //error.Show();
  1239. }
  1240. }
  1241. // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
  1242. private void ClickToSetConnect(object sender, RoutedEventArgs e)
  1243. {
  1244. // ConnectRegister crg = new();
  1245. // crg.Show();
  1246. }
  1247. private void ClickToEnterVS(object sender, RoutedEventArgs e)
  1248. {
  1249. // try
  1250. //{
  1251. // if (!File.Exists("VSRoute.txt"))
  1252. // {
  1253. // File.Create("VSRoute.txt");
  1254. // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
  1255. // throw ex;
  1256. // }//创建路径文件
  1257. // using StreamReader sr = new("VSRoute.txt");
  1258. // _ = Process.Start(sr.ReadLine());
  1259. // }
  1260. // catch (Exception exc)
  1261. //{
  1262. // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
  1263. // error.Show();
  1264. // }
  1265. PleaseWait();
  1266. }
  1267. private void ClickForUpdate(object sender, RoutedEventArgs e)
  1268. {
  1269. PleaseWait();
  1270. }
  1271. private void ClickToCheckLadder(object sender, RoutedEventArgs e)
  1272. {
  1273. PleaseWait();
  1274. }
  1275. // 敬请期待函数
  1276. private void PleaseWait()
  1277. {
  1278. try
  1279. {
  1280. throw new Exception("敬请期待");
  1281. }
  1282. catch (Exception)
  1283. {
  1284. //ErrorDisplayer error = new(exc.Message)
  1285. //error.Show()
  1286. }
  1287. }
  1288. // 以下为Mainwindow自定义属性
  1289. private readonly DispatcherTimer timer; // 定时器
  1290. private long counter; // 预留的取时间变量
  1291. AvailableService.AvailableServiceClient client;
  1292. AsyncServerStreamingCall<MessageToClient>? responseStream;
  1293. private StatusBarOfSurvivor[] StatusBarsOfSurvivor;
  1294. private StatusBarOfHunter StatusBarsOfHunter;
  1295. private StatusBarOfCircumstance StatusBarsOfCircumstance;
  1296. private bool isClientStocked;
  1297. private bool isPlaybackMode;
  1298. private long playerID;
  1299. private PlayerType playerType;
  1300. private double unit;
  1301. private double unitHeight;
  1302. private double unitWidth;
  1303. private readonly Rectangle[,] mapPatches = new Rectangle[50, 50];
  1304. private List<MessageOfProp> listOfProp;
  1305. private List<MessageOfStudent> listOfHuman;
  1306. private List<MessageOfTricker> listOfButcher;
  1307. private List<MessageOfBullet> listOfBullet;
  1308. private List<MessageOfBombedBullet> listOfBombedBullet;
  1309. private List<MessageOfAll> listOfAll;
  1310. private List<MessageOfChest> listOfChest;
  1311. private List<MessageOfClassroom> listOfClassroom;
  1312. private List<MessageOfDoor> listOfDoor;
  1313. private List<MessageOfGate> listOfGate;
  1314. private List<MessageOfHiddenGate> listOfHiddenGate;
  1315. private object drawPicLock = new object();
  1316. private MessageOfStudent? human = null;
  1317. private MessageOfTricker? butcher = null;
  1318. private bool humanOrButcher;//true for human
  1319. private bool bonusflag;
  1320. private bool mapFlag = false;
  1321. private bool hasDrawed = false;
  1322. public int[,] defaultMap = new int[,] {
  1323. { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },//6墙,1-5出生点
  1324. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },//7草
  1325. { 6, 0, 0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 6, 6, 6, 6, 6, 0, 0, 0, 0, 6, 0, 0, 0, 0, 7, 6, 6, 0, 0, 0, 6 },
  1371. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 7, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 6, 0, 0, 0, 7, 7, 6, 6, 0, 0, 0, 6 },
  1372. { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }
  1373. };
  1374. private string[] comInfo = new string[5];
  1375. ArgumentOptions? options = null;
  1376. bool gateOpened = false;
  1377. bool isSpectatorMode = false;
  1378. bool isEmergencyOpened = false;
  1379. bool isEmergencyDrawed = false;
  1380. const double radiusTimes = 1.0 * Preparation.Utility.GameData.characterRadius / Preparation.Utility.GameData.numOfPosGridPerCell;
  1381. private int[] totalLife = new int[4] { 100, 100, 100, 100 }, totalDeath = new int[4] { 100, 100, 100, 100 };
  1382. private int[,] coolTime = new int[3, 5] { { 100, 100, 100, 100, 100 }, { 100, 100, 100, 100, 100 }, { 100, 100, 100, 100, 100 } };
  1383. }
  1384. }