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