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

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