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

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