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

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