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 9.2 kB

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