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.

GameData.cs 8.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. using System;
  2. using System.Net.NetworkInformation;
  3. namespace Preparation.Utility
  4. {
  5. public static class GameData
  6. {
  7. #region 基本常数
  8. public const int numOfStepPerSecond = 20; // 每秒行走的步数
  9. public const int frameDuration = 50; // 每帧时长
  10. public const int checkInterval = 50; // 检查位置标志、补充子弹的帧时长
  11. public const long gameDuration = 600000; // 游戏时长600000ms = 10min
  12. public const int MinSpeed = 1; // 最小速度
  13. public const int MaxSpeed = int.MaxValue; // 最大速度
  14. #endregion
  15. #region 地图相关
  16. public const int numOfPosGridPerCell = 1000; // 每格的【坐标单位】数
  17. public const int lengthOfMap = 50000; // 地图长度
  18. public const int rows = 50; // 行数
  19. public const int cols = 50; // 列数
  20. public const int numOfBirthPoint = 5;
  21. // public const int numOfGenerator = 9;
  22. public const int numOfChest = 8;
  23. private const int numOfObjNotMap = 5;
  24. public static bool IsMap(GameObjType gameObjType)
  25. {
  26. return (uint)gameObjType > numOfObjNotMap;
  27. }
  28. public static XY GetCellCenterPos(int x, int y) // 求格子的中心坐标
  29. {
  30. XY ret = new(x * numOfPosGridPerCell + numOfPosGridPerCell / 2, y * numOfPosGridPerCell + numOfPosGridPerCell / 2);
  31. return ret;
  32. }
  33. public static int PosGridToCellX(XY pos) // 求坐标所在的格子的x坐标
  34. {
  35. return pos.x / numOfPosGridPerCell;
  36. }
  37. public static int PosGridToCellY(XY pos) // 求坐标所在的格子的y坐标
  38. {
  39. return pos.y / numOfPosGridPerCell;
  40. }
  41. public static XY PosGridToCellXY(XY pos) // 求坐标所在的格子的y坐标
  42. {
  43. return new XY(pos.x / numOfPosGridPerCell, pos.y / numOfPosGridPerCell);
  44. }
  45. public static bool IsInTheSameCell(XY pos1, XY pos2)
  46. {
  47. return PosGridToCellX(pos1) == PosGridToCellX(pos2) && PosGridToCellY(pos1) == PosGridToCellY(pos2);
  48. }
  49. public static bool ApproachToInteract(XY pos1, XY pos2)
  50. {
  51. return Math.Abs(PosGridToCellX(pos1) - PosGridToCellX(pos2)) <= 1 && Math.Abs(PosGridToCellY(pos1) - PosGridToCellY(pos2)) <= 1;
  52. }
  53. public static bool ApproachToInteractInACross(XY pos1, XY pos2)
  54. {
  55. return (Math.Abs(PosGridToCellX(pos1) - PosGridToCellX(pos2)) + Math.Abs(PosGridToCellY(pos1) - PosGridToCellY(pos2))) <= 1;
  56. }
  57. #endregion
  58. #region 角色相关
  59. public const int numOfStudent = 4;
  60. public const int characterRadius = numOfPosGridPerCell / 2 / 5 * 4; // 人物半径
  61. public const int basicTreatSpeed = 100;
  62. public const int basicFixSpeed = 100;
  63. public const int basicSpeedOfOpeningOrLocking = 3280;
  64. public const int basicStudentSpeedOfClimbingThroughWindows = 611;
  65. public const int basicGhostSpeedOfClimbingThroughWindows = 1270;
  66. public const int basicSpeedOfOpenChest = 1000;
  67. public const int basicHp = 3000000; // 初始血量
  68. public const int basicMaxGamingAddiction = 60000;//基本完全沉迷时间
  69. public const int BeginGamingAddiction = 10003;
  70. public const int MidGamingAddiction = 30000;
  71. public const int basicTreatmentDegree = 1500000;
  72. public const int basicTimeOfRescue = 1000;
  73. public const int basicMoveSpeed = 1270; // 基本移动速度,单位:s-1
  74. public const int characterMaxSpeed = 12000; // 最大速度
  75. public const int basicBulletMoveSpeed = 2700; // 基本子弹移动速度,单位:s-1
  76. public const double basicConcealment = 1.0;
  77. public const int basicAlertnessRadius = 30700;
  78. public const int basicViewRange = 5 * numOfPosGridPerCell;
  79. public const int maxNumOfPropInPropInventory = 3;
  80. public static XY PosWhoDie = new XY(1, 1);
  81. public static bool IsGhost(CharacterType characterType)
  82. {
  83. return characterType switch
  84. {
  85. CharacterType.Assassin => true,
  86. _ => false,
  87. };
  88. }
  89. #endregion
  90. #region 得分相关
  91. public static int TrickerScoreAttackStudent(int damage)
  92. {
  93. return damage * 100 / basicApOfGhost;
  94. }
  95. public const int TrickerScoreStudentBeAddicted = 50;
  96. public const int TrickerScoreStudentBeStunned = 25;
  97. public const int TrickerScoreStudentDie = 1000;
  98. public static int StudentScoreFix(int degreeOfFix)
  99. {
  100. return degreeOfFix;
  101. }
  102. public const int StudentScoreFixed = 25;
  103. public static int StudentScorePinDown(int timeOfPiningDown)
  104. {
  105. return 0;
  106. }
  107. public const int StudentScoreTrickerBeStunned = 25;
  108. public const int StudentScoreRescue = 100;
  109. public static int StudentScoreTreat(int degree)
  110. {
  111. return degree;
  112. }
  113. public const int StudentScoreEscape = 1000;
  114. public static int ScoreUseProp(PropType prop, bool IsGhost)
  115. {
  116. return 0;
  117. }
  118. public static int ScoreUseSkill(ActiveSkillType activeSkillType)
  119. {
  120. return 0;
  121. }
  122. #endregion
  123. #region 攻击与子弹相关
  124. public const int basicApOfGhost = 1500000; // 捣蛋鬼攻击力
  125. public const int MinAP = 0; // 最小攻击力
  126. public const int MaxAP = int.MaxValue; // 最大攻击力
  127. public const int basicCD = 3000; // 初始子弹冷却
  128. public const int basicCastTime = 500;//基本前摇时间
  129. public const int basicBackswing = 818;//基本后摇时间
  130. public const int basicRecoveryFromHit = 4300;//基本命中攻击恢复时长
  131. public const int basicStunnedTimeOfStudent = 4130;
  132. public const int bulletRadius = 200; // 默认子弹半径
  133. public const int basicBulletNum = 3; // 基本初始子弹量
  134. public const double basicRemoteAttackRange = 9000; // 基本远程攻击范围
  135. public const double basicAttackShortRange = 2700; // 基本近程攻击范围
  136. public const double basicBulletBombRange = 3000; // 基本子弹爆炸范围
  137. #endregion
  138. #region 技能相关
  139. public const int maxNumOfSkill = 3;
  140. public const int commonSkillCD = 30000; // 普通技能标准冷却时间
  141. public const int commonSkillTime = 10000; // 普通技能标准持续时间
  142. /// <summary>
  143. /// BeginToCharge
  144. /// </summary>
  145. public const int TimeOfGhostFainting = 7220;//=AP of Ram
  146. public const int TimeOfStudentFainting = 2090;
  147. #endregion
  148. #region 道具相关
  149. public const int MinPropTypeNum = 1;
  150. public const int MaxPropTypeNum = 10;
  151. public const int PropRadius = numOfPosGridPerCell / 2;
  152. public const int PropMoveSpeed = 3000;
  153. public const int PropMaxMoveDistance = 15 * numOfPosGridPerCell;
  154. public const long PropProduceTime = 10000;
  155. public const int PropDuration = 10000;
  156. public const int ApPropAdd = basicApOfGhost * 12 / 10;
  157. public const int ApSpearAdd = basicApOfGhost * 6 / 10;
  158. public const int RemainHpWhenAddLife = 100;
  159. public const int numOfKeyEachArea = 2;
  160. public const int numOfPropTypeNotKey = 4;
  161. public const int numOfTeachingBuilding = 3;
  162. #endregion
  163. #region 物体相关
  164. public const int degreeOfFixedGenerator = 10300000;
  165. public const int degreeOfLockingOrOpeningTheDoor = 10000;
  166. public const int degreeOfOpeningChest = 10000;
  167. public const int degreeOfOpenedDoorway = 18000;
  168. public const int maxNumOfPropInChest = 2;
  169. public const int numOfGeneratorRequiredForRepair = 7;
  170. public const int numOfGeneratorRequiredForEmergencyExit = 3;
  171. #endregion
  172. }
  173. }