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

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