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
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435
  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. listOfHuman.Add(obj.StudentMessage);
  406. break;
  407. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  408. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  409. {
  410. butcher = obj.TrickerMessage;
  411. }
  412. listOfButcher.Add(obj.TrickerMessage);
  413. break;
  414. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  415. listOfProp.Add(obj.PropMessage);
  416. break;
  417. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  418. listOfBombedBullet.Add(obj.BombedBulletMessage);
  419. break;
  420. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  421. listOfBullet.Add(obj.BulletMessage);
  422. break;
  423. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  424. listOfChest.Add(obj.ChestMessage);
  425. break;
  426. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  427. listOfClassroom.Add(obj.ClassroomMessage);
  428. break;
  429. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  430. listOfDoor.Add(obj.DoorMessage);
  431. break;
  432. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  433. listOfGate.Add(obj.GateMessage);
  434. break;
  435. case MessageOfObj.MessageOfObjOneofCase.MapMessage:
  436. GetMap(obj.MapMessage);
  437. break;
  438. }
  439. }
  440. listOfAll.Add(content.AllMessage);
  441. break;
  442. case GameState.GameRunning:
  443. foreach (var obj in content.ObjMessage)
  444. {
  445. switch (obj.MessageOfObjCase)
  446. {
  447. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  448. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  449. {
  450. human = obj.StudentMessage;
  451. }
  452. listOfHuman.Add(obj.StudentMessage);
  453. break;
  454. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  455. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  456. {
  457. butcher = obj.TrickerMessage;
  458. }
  459. listOfButcher.Add(obj.TrickerMessage);
  460. break;
  461. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  462. listOfProp.Add(obj.PropMessage);
  463. break;
  464. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  465. listOfBombedBullet.Add(obj.BombedBulletMessage);
  466. break;
  467. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  468. listOfBullet.Add(obj.BulletMessage);
  469. break;
  470. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  471. listOfChest.Add(obj.ChestMessage);
  472. break;
  473. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  474. listOfClassroom.Add(obj.ClassroomMessage);
  475. break;
  476. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  477. listOfDoor.Add(obj.DoorMessage);
  478. break;
  479. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  480. listOfGate.Add(obj.GateMessage);
  481. break;
  482. case MessageOfObj.MessageOfObjOneofCase.HiddenGateMessage:
  483. listOfHiddenGate.Add(obj.HiddenGateMessage);
  484. break;
  485. case MessageOfObj.MessageOfObjOneofCase.MapMessage:
  486. GetMap(obj.MapMessage);
  487. break;
  488. }
  489. }
  490. listOfAll.Add(content.AllMessage);
  491. break;
  492. case GameState.GameEnd:
  493. MessageBox.Show("Game Over!");
  494. foreach (var obj in content.ObjMessage)
  495. {
  496. switch (obj.MessageOfObjCase)
  497. {
  498. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  499. listOfHuman.Add(obj.StudentMessage);
  500. break;
  501. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  502. listOfButcher.Add(obj.TrickerMessage);
  503. break;
  504. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  505. listOfProp.Add(obj.PropMessage);
  506. break;
  507. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  508. listOfBombedBullet.Add(obj.BombedBulletMessage);
  509. break;
  510. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  511. listOfBullet.Add(obj.BulletMessage);
  512. break;
  513. case MessageOfObj.MessageOfObjOneofCase.ChestMessage:
  514. listOfChest.Add(obj.ChestMessage);
  515. break;
  516. case MessageOfObj.MessageOfObjOneofCase.ClassroomMessage:
  517. listOfClassroom.Add(obj.ClassroomMessage);
  518. break;
  519. case MessageOfObj.MessageOfObjOneofCase.DoorMessage:
  520. listOfDoor.Add(obj.DoorMessage);
  521. break;
  522. case MessageOfObj.MessageOfObjOneofCase.GateMessage:
  523. listOfGate.Add(obj.GateMessage);
  524. break;
  525. case MessageOfObj.MessageOfObjOneofCase.HiddenGateMessage:
  526. listOfHiddenGate.Add(obj.HiddenGateMessage);
  527. break;
  528. }
  529. }
  530. listOfAll.Add(content.AllMessage);
  531. break;
  532. }
  533. }
  534. if (responseStream == null)
  535. {
  536. throw new Exception("Unconnected");
  537. }
  538. }
  539. }
  540. catch (Exception ex)
  541. {
  542. ErrorDisplayer error = new("Error: " + ex.ToString());
  543. error.Show();
  544. }
  545. }
  546. //待修改
  547. private bool CanSee(MessageOfStudent msg)
  548. {
  549. if (msg.PlayerState == PlayerState.Quit || msg.PlayerState == PlayerState.Graduated)
  550. return false;
  551. if (isSpectatorMode)
  552. return true;
  553. if (humanOrButcher && human != null)
  554. {
  555. if (human.Guid == msg.Guid) // 自己能看见自己
  556. return true;
  557. }
  558. if (msg.Place == Protobuf.PlaceType.Grass || msg.Place == Protobuf.PlaceType.Gate || msg.Place == Protobuf.PlaceType.HiddenGate)
  559. return false;
  560. if (msg.Place == Protobuf.PlaceType.Land || msg.Place == Protobuf.PlaceType.Classroom)
  561. return true;
  562. if (humanOrButcher && human != null)
  563. {
  564. if (msg.Place != human.Place)
  565. return false;
  566. }
  567. else if (!humanOrButcher && butcher != null)
  568. {
  569. if (msg.Place != butcher.Place)
  570. return false;
  571. }
  572. return true;
  573. }
  574. private bool CanSee(MessageOfTricker msg)
  575. {
  576. if (isSpectatorMode)
  577. return true;
  578. if (!humanOrButcher && butcher != null)
  579. {
  580. if (butcher.Guid == msg.Guid) // 自己能看见自己
  581. return true;
  582. }
  583. if (msg.Place == Protobuf.PlaceType.Grass || msg.Place == Protobuf.PlaceType.Gate || msg.Place == Protobuf.PlaceType.HiddenGate)
  584. return false;
  585. if (msg.Place == Protobuf.PlaceType.Land || msg.Place == Protobuf.PlaceType.Classroom)
  586. return true;
  587. if (humanOrButcher && human != null)
  588. {
  589. if (msg.Place != human.Place)
  590. return false;
  591. }
  592. else if (!humanOrButcher && butcher != null)
  593. {
  594. if (msg.Place != butcher.Place)
  595. return false;
  596. }
  597. return true;
  598. }
  599. private bool CanSee(MessageOfProp msg)
  600. {
  601. if (isSpectatorMode)
  602. return true;
  603. if (msg.Place == Protobuf.PlaceType.Land)
  604. return true;
  605. if (humanOrButcher && human != null)
  606. {
  607. if (msg.Place != human.Place)
  608. return false;
  609. }
  610. else if (!humanOrButcher && butcher != null)
  611. {
  612. if (msg.Place != butcher.Place)
  613. return false;
  614. }
  615. return true;
  616. }
  617. private bool CanSee(MessageOfBullet msg)
  618. {
  619. if (isSpectatorMode)
  620. return true;
  621. if (msg.Place == Protobuf.PlaceType.Land)
  622. return true;
  623. if (humanOrButcher && human != null)
  624. {
  625. if (msg.Place != human.Place)
  626. return false;
  627. }
  628. else if (!humanOrButcher && butcher != null)
  629. {
  630. if (msg.Place != butcher.Place)
  631. return false;
  632. }
  633. return true;
  634. }
  635. private void Refresh(object? sender, EventArgs e) //log未更新
  636. {
  637. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行
  638. {
  639. // Bonus();
  640. if (WindowState == WindowState.Maximized)
  641. MaxButton.Content = "❐";
  642. else
  643. MaxButton.Content = "🗖";
  644. foreach (var obj in listOfHuman)
  645. {
  646. if (obj.PlayerId < GameData.numOfStudent)
  647. {
  648. IStudentType occupation = (IStudentType)OccupationFactory.FindIOccupation(Transformation.ToStudentType(obj.StudentType));
  649. totalLife[obj.PlayerId] = occupation.MaxHp;
  650. totalDeath[obj.PlayerId] = occupation.MaxGamingAddiction;
  651. int i = 0;
  652. foreach (var skill in occupation.ListOfIActiveSkill)
  653. {
  654. var iActiveSkill = SkillFactory.FindIActiveSkill(skill);
  655. coolTime[i, obj.PlayerId] = iActiveSkill.SkillCD;
  656. ++i;
  657. }
  658. }
  659. }
  660. foreach (var obj in listOfButcher)
  661. {
  662. IGhostType occupation1 = (IGhostType)OccupationFactory.FindIOccupation(Transformation.ToTrickerType(obj.TrickerType));
  663. int j = 0;
  664. foreach (var skill in occupation1.ListOfIActiveSkill)
  665. {
  666. var iActiveSkill = SkillFactory.FindIActiveSkill(skill);
  667. coolTime[j, GameData.numOfStudent] = iActiveSkill.SkillCD;
  668. ++j;
  669. }
  670. }
  671. if (StatusBarsOfSurvivor != null)
  672. {
  673. for (int i = 0; i < GameData.numOfStudent; i++)
  674. {
  675. StatusBarsOfSurvivor[i].SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  676. StatusBarsOfSurvivor[i].NewData(totalLife, totalDeath, coolTime);
  677. }
  678. }
  679. if (StatusBarsOfHunter != null)
  680. {
  681. StatusBarsOfHunter.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  682. StatusBarsOfHunter.NewData(totalLife, totalDeath, coolTime);
  683. }
  684. if (StatusBarsOfCircumstance != null)
  685. StatusBarsOfCircumstance.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  686. // 完成窗口信息更新
  687. if (!isClientStocked)
  688. {
  689. unit = Math.Sqrt(UpperLayerOfMap.ActualHeight * UpperLayerOfMap.ActualWidth) / 50;
  690. unitHeight = UpperLayerOfMap.ActualHeight / 50;
  691. unitWidth = UpperLayerOfMap.ActualWidth / 50;
  692. try
  693. {
  694. // if (log != null)
  695. //{
  696. // string temp = "";
  697. // for (int i = 0; i < dataDict[GameObjType.Character].Count; i++)
  698. // {
  699. // temp += Convert.ToString(dataDict[GameObjType.Character][i].MessageOfCharacter.TeamID) + "\n";
  700. // }
  701. // log.Content = temp;
  702. // }
  703. UpperLayerOfMap.Children.Clear();
  704. // if ((communicator == null || !communicator.Client.IsConnected) && !isPlaybackMode)
  705. //{
  706. // UnderLayerOfMap.Children.Clear();
  707. // throw new Exception("Client is unconnected.");
  708. // }
  709. // else
  710. //{
  711. foreach (var data in listOfAll)
  712. {
  713. StatusBarsOfCircumstance.SetValue(data, gateOpened, isEmergencyDrawed, isEmergencyOpened, playerID);
  714. }
  715. if (!hasDrawed && mapFlag)
  716. DrawMap();
  717. foreach (var data in listOfHuman)
  718. {
  719. StatusBarsOfSurvivor[data.PlayerId].SetValue(data, data.PlayerId);
  720. if (CanSee(data))
  721. {
  722. Ellipse icon = new()
  723. {
  724. Width = 2 * radiusTimes * unitWidth,
  725. Height = 2 * radiusTimes * unitHeight,
  726. HorizontalAlignment = HorizontalAlignment.Left,
  727. VerticalAlignment = VerticalAlignment.Top,
  728. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth * radiusTimes, data.X * unitHeight / 1000.0 - unitHeight * radiusTimes, 0, 0),
  729. Fill = Brushes.BlueViolet,
  730. };
  731. UpperLayerOfMap.Children.Add(icon);
  732. }
  733. }
  734. foreach (var data in listOfButcher)
  735. {
  736. StatusBarsOfHunter.SetValue(data);
  737. if (CanSee(data))
  738. {
  739. Ellipse icon = new()
  740. {
  741. Width = 2 * radiusTimes * unitWidth,
  742. Height = 2 * radiusTimes * unitHeight,
  743. HorizontalAlignment = HorizontalAlignment.Left,
  744. VerticalAlignment = VerticalAlignment.Top,
  745. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth * radiusTimes, data.X * unitHeight / 1000.0 - unitHeight * radiusTimes, 0, 0),
  746. Fill = Brushes.Chocolate,
  747. };
  748. UpperLayerOfMap.Children.Add(icon);
  749. }
  750. }
  751. foreach (var data in listOfProp)
  752. {
  753. if (CanSee(data))
  754. {
  755. switch (data.Type)
  756. {
  757. case Protobuf.PropType.Key3:
  758. DrawProp(data, "🔑");
  759. break;
  760. case Protobuf.PropType.Key5:
  761. DrawProp(data, "🔑");
  762. break;
  763. case Protobuf.PropType.Key6:
  764. DrawProp(data, "🔑");
  765. break;
  766. case Protobuf.PropType.AddSpeed:
  767. DrawProp(data, "⛸");
  768. break;
  769. case Protobuf.PropType.AddHpOrAp:
  770. DrawProp(data, "♥");
  771. break;
  772. case Protobuf.PropType.AddLifeOrClairaudience:
  773. DrawProp(data, "🏅");
  774. break;
  775. case Protobuf.PropType.ShieldOrSpear:
  776. DrawProp(data, "🛡");
  777. break;
  778. case Protobuf.PropType.RecoveryFromDizziness:
  779. DrawProp(data, "🕶");
  780. break;
  781. default:
  782. DrawProp(data, "");
  783. break;
  784. }
  785. }
  786. }
  787. foreach (var data in listOfBullet)
  788. {
  789. if (CanSee(data))
  790. {
  791. Ellipse icon = new()
  792. {
  793. Width = 10,
  794. Height = 10,
  795. HorizontalAlignment = HorizontalAlignment.Left,
  796. VerticalAlignment = VerticalAlignment.Top,
  797. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  798. Fill = Brushes.Red,
  799. };
  800. switch (data.Type)
  801. {
  802. case Protobuf.BulletType.FlyingKnife:
  803. icon.Fill = Brushes.Blue;
  804. break;
  805. case Protobuf.BulletType.CommonAttackOfTricker:
  806. case Protobuf.BulletType.BombBomb:
  807. case Protobuf.BulletType.JumpyDumpty:
  808. icon.Fill = Brushes.Red;
  809. break;
  810. default:
  811. break;
  812. }
  813. UpperLayerOfMap.Children.Add(icon);
  814. }
  815. }
  816. foreach (var data in listOfBombedBullet)
  817. {
  818. switch (data.Type)
  819. {
  820. case Protobuf.BulletType.BombBomb:
  821. {
  822. Ellipse icon = new();
  823. double bombRange = data.BombRange / 1000;
  824. icon.Width = bombRange * unitWidth;
  825. icon.Height = bombRange * unitHeight;
  826. icon.HorizontalAlignment = HorizontalAlignment.Left;
  827. icon.VerticalAlignment = VerticalAlignment.Top;
  828. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  829. icon.Fill = Brushes.Red;
  830. UpperLayerOfMap.Children.Add(icon);
  831. break;
  832. }
  833. case Protobuf.BulletType.JumpyDumpty:
  834. {
  835. Ellipse icon = new Ellipse();
  836. double bombRange = data.BombRange / 1000;
  837. icon.Width = bombRange * unitWidth;
  838. icon.Height = bombRange * unitHeight;
  839. icon.HorizontalAlignment = HorizontalAlignment.Left;
  840. icon.VerticalAlignment = VerticalAlignment.Top;
  841. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  842. icon.Fill = Brushes.Red;
  843. UpperLayerOfMap.Children.Add(icon);
  844. break;
  845. }
  846. //case Protobuf.BulletType.LineBullet:
  847. // {
  848. // double bombRange = data.BombRange / 1000;
  849. // DrawLaser(new Point(data.Y * unitWidth / 1000.0, data.X * unitHeight / 1000.0), -data.FacingDirection + Math.PI / 2, bombRange * unitHeight, 0.5 * unitWidth);
  850. // break;
  851. // }
  852. default:
  853. break;
  854. }
  855. }
  856. foreach (var data in listOfClassroom)
  857. {
  858. int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfFixedGenerator);
  859. TextBox icon = new()
  860. {
  861. FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
  862. Width = unitWidth,
  863. Height = unitHeight,
  864. Text = Convert.ToString(deg),
  865. HorizontalAlignment = HorizontalAlignment.Left,
  866. VerticalAlignment = VerticalAlignment.Top,
  867. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  868. Background = Brushes.Transparent,
  869. BorderBrush = Brushes.Transparent,
  870. IsReadOnly = true
  871. };
  872. if (deg == 100)
  873. {
  874. icon.Text = "A+";
  875. }
  876. UpperLayerOfMap.Children.Add(icon);
  877. }
  878. foreach (var data in listOfChest)
  879. {
  880. int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedChest);
  881. TextBox icon = new()
  882. {
  883. FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
  884. Width = unitWidth,
  885. Height = unitHeight,
  886. Text = Convert.ToString(deg),
  887. HorizontalAlignment = HorizontalAlignment.Left,
  888. VerticalAlignment = VerticalAlignment.Top,
  889. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  890. Background = Brushes.Transparent,
  891. BorderBrush = Brushes.Transparent,
  892. IsReadOnly = true
  893. };
  894. if (deg == 100)
  895. {
  896. icon.Text = "Ø";
  897. }
  898. UpperLayerOfMap.Children.Add(icon);
  899. }
  900. foreach (var data in listOfGate)
  901. {
  902. int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedDoorway);
  903. TextBox icon = new()
  904. {
  905. FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
  906. Width = unitWidth,
  907. Height = unitHeight,
  908. Text = Convert.ToString(deg),
  909. HorizontalAlignment = HorizontalAlignment.Left,
  910. VerticalAlignment = VerticalAlignment.Top,
  911. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  912. Background = Brushes.Transparent,
  913. BorderBrush = Brushes.Transparent,
  914. IsReadOnly = true
  915. };
  916. if (deg == 100)
  917. {
  918. gateOpened = true;
  919. icon.Text = "🔓";
  920. }
  921. UpperLayerOfMap.Children.Add(icon);
  922. }
  923. foreach (var data in listOfDoor)
  924. {
  925. TextBox icon = new()
  926. {
  927. FontSize = 9 * UpperLayerOfMap.ActualHeight / 650,
  928. Width = unitWidth,
  929. Height = unitHeight,
  930. HorizontalAlignment = HorizontalAlignment.Left,
  931. VerticalAlignment = VerticalAlignment.Top,
  932. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  933. Background = Brushes.Transparent,
  934. BorderBrush = Brushes.Transparent,
  935. IsReadOnly = true
  936. };
  937. if (data.IsOpen)
  938. {
  939. icon.Text = Convert.ToString("🔓");
  940. }
  941. else
  942. {
  943. icon.Text = Convert.ToString("🔒");
  944. }
  945. UpperLayerOfMap.Children.Add(icon);
  946. }
  947. foreach (var data in listOfHiddenGate)
  948. {
  949. if (!isEmergencyDrawed)
  950. {
  951. mapPatches[data.X / Preparation.Utility.GameData.numOfPosGridPerCell, data.Y / Preparation.Utility.GameData.numOfPosGridPerCell].Fill = Brushes.LightSalmon;
  952. mapPatches[data.X / Preparation.Utility.GameData.numOfPosGridPerCell, data.Y / Preparation.Utility.GameData.numOfPosGridPerCell].Stroke = Brushes.LightSalmon;
  953. isEmergencyDrawed = true;
  954. }
  955. if (data.Opened)
  956. {
  957. isEmergencyOpened = true;
  958. TextBox icon = new()
  959. {
  960. FontSize = 9 * UpperLayerOfMap.ActualHeight / 650,
  961. Width = unitWidth,
  962. Height = unitHeight,
  963. Text = Convert.ToString("🔓"),
  964. HorizontalAlignment = HorizontalAlignment.Left,
  965. VerticalAlignment = VerticalAlignment.Top,
  966. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  967. Background = Brushes.Transparent,
  968. BorderBrush = Brushes.Transparent,
  969. IsReadOnly = true
  970. };
  971. }
  972. }
  973. //}
  974. ZoomMap();
  975. }
  976. catch (Exception exc)
  977. {
  978. ErrorDisplayer error = new("Error: " + exc.ToString());
  979. error.Show();
  980. isClientStocked = true;
  981. PorC.Content = "▶";
  982. }
  983. }
  984. counter++;
  985. }
  986. }
  987. // 键盘控制,未完善
  988. private void KeyBoardControl(object sender, KeyEventArgs e)
  989. {
  990. if (!isPlaybackMode && !isSpectatorMode)
  991. {
  992. switch (e.Key)
  993. {
  994. case Key.W:
  995. case Key.NumPad8:
  996. MoveMsg msgW = new()
  997. {
  998. PlayerId = playerID,
  999. TimeInMilliseconds = 25,
  1000. Angle = Math.PI
  1001. };
  1002. client.Move(msgW);
  1003. break;
  1004. case Key.S:
  1005. case Key.NumPad2:
  1006. MoveMsg msgS = new()
  1007. {
  1008. PlayerId = playerID,
  1009. TimeInMilliseconds = 25,
  1010. Angle = 0
  1011. };
  1012. client.Move(msgS);
  1013. break;
  1014. case Key.D:
  1015. case Key.NumPad6:
  1016. MoveMsg msgD = new()
  1017. {
  1018. PlayerId = playerID,
  1019. TimeInMilliseconds = 25,
  1020. Angle = Math.PI / 2
  1021. };
  1022. client.Move(msgD);
  1023. break;
  1024. case Key.A:
  1025. case Key.NumPad4:
  1026. MoveMsg msgA = new()
  1027. {
  1028. PlayerId = playerID,
  1029. TimeInMilliseconds = 25,
  1030. Angle = 3 * Math.PI / 2
  1031. };
  1032. client.Move(msgA);
  1033. break;
  1034. case Key.J:
  1035. AttackMsg msgJ = new()
  1036. {
  1037. PlayerId = playerID,
  1038. Angle = Math.PI
  1039. };
  1040. client.Attack(msgJ);
  1041. break;
  1042. case Key.K:
  1043. IDMsg msgK = new()
  1044. {
  1045. PlayerId = playerID,
  1046. };
  1047. client.StartLearning(msgK);
  1048. break;
  1049. case Key.R:
  1050. TreatAndRescueMsg msgR = new()
  1051. {
  1052. PlayerId = playerID,
  1053. ToPlayerId = -1,
  1054. };
  1055. client.StartRescueMate(msgR);
  1056. break;
  1057. case Key.T:
  1058. TreatAndRescueMsg msgT = new()
  1059. {
  1060. PlayerId = playerID,
  1061. ToPlayerId = -1,
  1062. };
  1063. client.StartTreatMate(msgT);
  1064. break;
  1065. case Key.G:
  1066. IDMsg msgG = new()
  1067. {
  1068. PlayerId = playerID,
  1069. };
  1070. client.Graduate(msgG);
  1071. break;
  1072. case Key.H:
  1073. IDMsg msgH = new()
  1074. {
  1075. PlayerId = playerID,
  1076. };
  1077. client.StartOpenGate(msgH);
  1078. break;
  1079. case Key.O:
  1080. IDMsg msgO = new()
  1081. {
  1082. PlayerId = playerID,
  1083. };
  1084. client.OpenDoor(msgO);
  1085. break;
  1086. case Key.P:
  1087. IDMsg msgP = new()
  1088. {
  1089. PlayerId = playerID,
  1090. };
  1091. client.CloseDoor(msgP);
  1092. break;
  1093. case Key.U:
  1094. IDMsg msgU = new()
  1095. {
  1096. PlayerId = playerID,
  1097. };
  1098. client.SkipWindow(msgU);
  1099. break;
  1100. case Key.I:
  1101. IDMsg msgI = new()
  1102. {
  1103. PlayerId = playerID,
  1104. };
  1105. client.StartOpenChest(msgI);
  1106. break;
  1107. case Key.E:
  1108. IDMsg msgE = new()
  1109. {
  1110. PlayerId = playerID,
  1111. };
  1112. client.EndAllAction(msgE);
  1113. break;
  1114. case Key.F:
  1115. PropMsg msgF = new()
  1116. {
  1117. PlayerId = playerID,
  1118. PropType = Protobuf.PropType.NullPropType,
  1119. };
  1120. client.PickProp(msgF);
  1121. break;
  1122. case Key.C:
  1123. PropMsg msgC = new()
  1124. {
  1125. PlayerId = playerID,
  1126. PropType = Protobuf.PropType.NullPropType,
  1127. };
  1128. client.ThrowProp(msgC);
  1129. break;
  1130. case Key.V:
  1131. PropMsg msgV = new()
  1132. {
  1133. PlayerId = playerID,
  1134. PropType = Protobuf.PropType.NullPropType,
  1135. };
  1136. client.UseProp(msgV);
  1137. break;
  1138. case Key.B:
  1139. SkillMsg msgB = new()
  1140. {
  1141. PlayerId = playerID,
  1142. SkillId = 0,
  1143. };
  1144. client.UseSkill(msgB);
  1145. break;
  1146. case Key.N:
  1147. SkillMsg msgN = new()
  1148. {
  1149. PlayerId = playerID,
  1150. SkillId = 1,
  1151. };
  1152. client.UseSkill(msgN);
  1153. break;
  1154. case Key.M:
  1155. SkillMsg msgM = new()
  1156. {
  1157. PlayerId = playerID,
  1158. SkillId = 2,
  1159. };
  1160. client.UseSkill(msgM);
  1161. break;
  1162. default:
  1163. break;
  1164. }
  1165. }
  1166. }
  1167. //鼠标双击
  1168. private void Attack(object sender, RoutedEventArgs e)
  1169. {
  1170. if (!isPlaybackMode && !isSpectatorMode)
  1171. {
  1172. if (humanOrButcher && human != null)
  1173. {
  1174. AttackMsg msgJ = new()
  1175. {
  1176. PlayerId = playerID
  1177. };
  1178. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  1179. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  1180. msgJ.Angle = Math.Atan2(mouseY - human.Y, mouseX - human.X);
  1181. client.Attack(msgJ);
  1182. }
  1183. if (!humanOrButcher && butcher != null)
  1184. {
  1185. AttackMsg msgJ = new()
  1186. {
  1187. PlayerId = playerID
  1188. };
  1189. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  1190. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  1191. msgJ.Angle = Math.Atan2(mouseY - butcher.Y, mouseX - butcher.X);
  1192. client.Attack(msgJ);
  1193. }
  1194. }
  1195. }
  1196. // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
  1197. private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
  1198. {
  1199. if (!isClientStocked)
  1200. {
  1201. isClientStocked = true;
  1202. PorC.Content = "▶";
  1203. }
  1204. else if (!isPlaybackMode)
  1205. {
  1206. try
  1207. {
  1208. isClientStocked = false;
  1209. PorC.Content = "⏸";
  1210. }
  1211. catch (Exception ex)
  1212. {
  1213. ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + ex.ToString());
  1214. error.Show();
  1215. }
  1216. }
  1217. }
  1218. // 未复现
  1219. private void ClickToConnect(object sender, RoutedEventArgs e)
  1220. {
  1221. }
  1222. // 窗口最大化、关闭、最小化、拖拽
  1223. private void ClickToMaxmize(object sender, RoutedEventArgs e)
  1224. {
  1225. if (WindowState != WindowState.Maximized)
  1226. WindowState = WindowState.Maximized;
  1227. else
  1228. WindowState = WindowState.Normal;
  1229. }
  1230. private void ClickToClose(object sender, RoutedEventArgs e)
  1231. {
  1232. Application.Current.Shutdown();
  1233. }
  1234. private void ClickToMinimize(object sender, RoutedEventArgs e)
  1235. {
  1236. WindowState = WindowState.Minimized;
  1237. }
  1238. private void DragWindow(object sender, RoutedEventArgs e)
  1239. {
  1240. DragMove();
  1241. }
  1242. // 寻求帮助、访问EESAST(部分功能未复原)
  1243. private void ClickForHelp(object sender, RoutedEventArgs e)
  1244. {
  1245. PleaseWait();
  1246. }
  1247. private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
  1248. {
  1249. try
  1250. {
  1251. _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
  1252. }
  1253. catch (Exception)
  1254. {
  1255. //ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
  1256. //error.Show();
  1257. }
  1258. }
  1259. // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
  1260. private void ClickToSetConnect(object sender, RoutedEventArgs e)
  1261. {
  1262. // ConnectRegister crg = new();
  1263. // crg.Show();
  1264. }
  1265. private void ClickToEnterVS(object sender, RoutedEventArgs e)
  1266. {
  1267. // try
  1268. //{
  1269. // if (!File.Exists("VSRoute.txt"))
  1270. // {
  1271. // File.Create("VSRoute.txt");
  1272. // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
  1273. // throw ex;
  1274. // }//创建路径文件
  1275. // using StreamReader sr = new("VSRoute.txt");
  1276. // _ = Process.Start(sr.ReadLine());
  1277. // }
  1278. // catch (Exception exc)
  1279. //{
  1280. // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
  1281. // error.Show();
  1282. // }
  1283. PleaseWait();
  1284. }
  1285. private void ClickForUpdate(object sender, RoutedEventArgs e)
  1286. {
  1287. PleaseWait();
  1288. }
  1289. private void ClickToCheckLadder(object sender, RoutedEventArgs e)
  1290. {
  1291. PleaseWait();
  1292. }
  1293. // 敬请期待函数
  1294. private void PleaseWait()
  1295. {
  1296. try
  1297. {
  1298. throw new Exception("敬请期待");
  1299. }
  1300. catch (Exception)
  1301. {
  1302. //ErrorDisplayer error = new(exc.Message)
  1303. //error.Show()
  1304. }
  1305. }
  1306. // 以下为Mainwindow自定义属性
  1307. private readonly DispatcherTimer timer; // 定时器
  1308. private long counter; // 预留的取时间变量
  1309. AvailableService.AvailableServiceClient client;
  1310. AsyncServerStreamingCall<MessageToClient>? responseStream;
  1311. private StatusBarOfSurvivor[] StatusBarsOfSurvivor;
  1312. private StatusBarOfHunter StatusBarsOfHunter;
  1313. private StatusBarOfCircumstance StatusBarsOfCircumstance;
  1314. private bool isClientStocked;
  1315. private bool isPlaybackMode;
  1316. private long playerID;
  1317. private PlayerType playerType;
  1318. private double unit;
  1319. private double unitHeight;
  1320. private double unitWidth;
  1321. private readonly Rectangle[,] mapPatches = new Rectangle[50, 50];
  1322. private List<MessageOfProp> listOfProp;
  1323. private List<MessageOfStudent> listOfHuman;
  1324. private List<MessageOfTricker> listOfButcher;
  1325. private List<MessageOfBullet> listOfBullet;
  1326. private List<MessageOfBombedBullet> listOfBombedBullet;
  1327. private List<MessageOfAll> listOfAll;
  1328. private List<MessageOfChest> listOfChest;
  1329. private List<MessageOfClassroom> listOfClassroom;
  1330. private List<MessageOfDoor> listOfDoor;
  1331. private List<MessageOfGate> listOfGate;
  1332. private List<MessageOfHiddenGate> listOfHiddenGate;
  1333. private object drawPicLock = new object();
  1334. private MessageOfStudent? human = null;
  1335. private MessageOfTricker? butcher = null;
  1336. private bool humanOrButcher;//true for human
  1337. private bool bonusflag;
  1338. private bool mapFlag = false;
  1339. private bool hasDrawed = false;
  1340. public int[,] defaultMap = new int[,] {
  1341. { 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, 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, 0, 0, 6, 6, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 11, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 6 },
  1388. { 6, 0, 0, 0, 6, 6, 6, 6, 6, 7, 0, 0, 0, 10, 0, 0, 0, 0, 6, 6, 7, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 6, 0, 0, 0, 0, 7, 6, 6, 0, 0, 0, 6 },
  1389. { 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 },
  1390. { 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 }
  1391. };
  1392. private string[] comInfo = new string[5];
  1393. ArgumentOptions? options = null;
  1394. bool gateOpened = false;
  1395. bool isSpectatorMode = false;
  1396. bool isEmergencyOpened = false;
  1397. bool isEmergencyDrawed = false;
  1398. bool isDataFixed = false;
  1399. const double radiusTimes = 1.0 * Preparation.Utility.GameData.characterRadius / Preparation.Utility.GameData.numOfPosGridPerCell;
  1400. private int[] totalLife = new int[4] { 100, 100, 100, 100 }, totalDeath = new int[4] { 100, 100, 100, 100 };
  1401. private int[,] coolTime = new int[3, 5] { { 100, 100, 100, 100, 100 }, { 100, 100, 100, 100, 100 }, { 100, 100, 100, 100, 100 } };
  1402. }
  1403. }