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