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.Gadget
  41. &&gameObjType != GameObjType.Item&&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. 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 = 5000;
  85. public const int basicStudentSpeedOfClimbingThroughWindows = 1222;
  86. public const int basicGhostSpeedOfClimbingThroughWindows = 2540;
  87. public const int basicSpeedOfOpenChest = 1250;
  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. public const int basicStudentMoveSpeed = 3000;// 基本移动速度,单位:s-1
  95. public const int basicGhostMoveSpeed = (int)(basicStudentMoveSpeed * 1.2);
  96. public const int characterMaxSpeed = 12000; // 最大速度
  97. public const double basicConcealment = 1.0;
  98. public const int basicStudentAlertnessRadius = 15 * numOfPosGridPerCell;
  99. public const int basicGhostAlertnessRadius = 17 * numOfPosGridPerCell;
  100. public const int basicStudentViewRange = 10 * numOfPosGridPerCell;
  101. public const int basicGhostViewRange = 13 * numOfPosGridPerCell;
  102. public const int PinningDownRange = 5 * numOfPosGridPerCell;
  103. public const int maxNumOfPropInPropInventory = 3;
  104. public static XY PosWhoDie = new XY(1, 1);
  105. public static bool IsGhost(CharacterType characterType)
  106. {
  107. return characterType switch
  108. {
  109. CharacterType.Assassin => true,
  110. CharacterType.Klee => true,
  111. CharacterType.ANoisyPerson => true,
  112. CharacterType.Idol => true,
  113. _ => false,
  114. };
  115. }
  116. #endregion
  117. #region 得分相关
  118. public static long TrickerScoreAttackStudent(long damage)
  119. {
  120. return damage * 100 / basicApOfGhost;
  121. }
  122. public const int TrickerScoreStudentBeAddicted = 50;
  123. public const int TrickerScoreDestroyRobot = 50;
  124. public const int TrickerScoreStudentDie = 1000;
  125. public static int TrickerScoreStudentBeStunned(int time)
  126. {
  127. return time * 20 / 1000;
  128. }
  129. public static int TrickerScoreDamageGenerator(int degree)
  130. {
  131. return degree * 100 / degreeOfFixedGenerator;
  132. }
  133. public static int StudentScoreFix(int degreeOfFix)
  134. {
  135. return degreeOfFix * 200 / degreeOfFixedGenerator;
  136. }
  137. //public const int StudentScoreFixed = 25;
  138. public static int StudentScorePinDown(int timeOfPinningDown)
  139. {
  140. return (int)(timeOfPinningDown * 0.00246);
  141. }
  142. public static int StudentScoreTrickerBeStunned(int time)
  143. {
  144. return time * 20 / 1000;
  145. }
  146. public const int StudentScoreRescue = 100;
  147. public static long StudentScoreTreat(long degree)
  148. {
  149. return degree * 50 / basicTreatmentDegree;
  150. }
  151. public const int StudentScoreEscape = 1000;
  152. public const int ScorePropRemainHp = 100;
  153. public const int ScorePropUseShield = 50;
  154. public const int ScorePropUseSpear = 50;
  155. public const int ScorePropAddAp = 0;
  156. public const int ScorePropAddSpeed = 10;
  157. public const int ScorePropClairaudience = 10;
  158. public const int ScorePropAddHp = 10;
  159. public const int ScorePropRecoverFromDizziness = 30;
  160. public const int ScoreBecomeInvisible = 15;
  161. public const int ScoreInspire = ScorePropAddSpeed;
  162. #endregion
  163. #region 攻击与子弹相关
  164. public const int basicApOfGhost = 1500000; // 捣蛋鬼攻击力
  165. public const int MinAP = 0; // 最小攻击力
  166. public const int MaxAP = int.MaxValue; // 最大攻击力
  167. public const int factorDamageGenerator = 1;//子弹对电机的破坏=factorDamageGenerator*AP;
  168. public const int bulletRadius = 200; // 默认子弹半径
  169. public const int basicBulletNum = 3; // 基本初始子弹量
  170. public const int basicCD = 3000; // 初始子弹冷却
  171. public const int basicCastTime = 500;//基本前摇时间
  172. public const int basicBackswing = 800;//基本后摇时间
  173. public const int basicRecoveryFromHit = 3700;//基本命中攻击恢复时长
  174. public const int basicStunnedTimeOfStudent = 4300;
  175. public const int basicBulletMoveSpeed = 7400; // 基本子弹移动速度,单位:s-1
  176. public const double basicRemoteAttackRange = 6000; // 基本远程攻击范围
  177. public const double basicAttackShortRange = 2200; // 基本近程攻击范围
  178. public const double basicBulletBombRange = 2000; // 基本子弹爆炸范围
  179. #endregion
  180. #region 技能、特性相关
  181. public const int maxNumOfSkill = 3;
  182. public const int commonSkillCD = 30000; // 普通技能标准冷却时间
  183. public const int commonSkillTime = 10000; // 普通技能标准持续时间
  184. public const int timeOfGhostStunnedWhenCharge = 7220;
  185. public const int timeOfStudentStunnedWhenCharge = 2090;
  186. public const int timeOfGhostStunnedWhenPunish = 3070;
  187. public const int factorOfTimeStunnedWhenPunish = 500;
  188. public const int factorOfScoreWhenTeacherAttacked = 100;
  189. public const int distanceOfHaveTea = 3000;
  190. public const int timeOfGhostSwingingAfterHowl = 800;
  191. public const int timeOfStudentStunnedWhenHowl = 5500;
  192. public const int timeOfStunnedWhenJumpyDumpty = 3070;
  193. public const int checkIntervalWhenSparksNSplash = 100;
  194. public const double addedTimeOfSpeedWhenInspire = 1.6;
  195. public const int timeOfAddingSpeedWhenInspire = 6000;
  196. public const int addHpWhenEncourage = basicHp / 4;
  197. public const int checkIntervalWhenShowTime = 500;
  198. public const int addAddictionPer100msWhenShowTime = 300;
  199. public const int maxSummonedGolemNum = 3;
  200. #endregion
  201. #region 道具相关
  202. public const int propRadius = characterRadius;
  203. public const int propMoveSpeed = 3000;
  204. public const int PropMaxMoveDistance = 15 * numOfPosGridPerCell;
  205. public const long PropProduceTime = 20000;
  206. public const int PropDuration = 10000;
  207. public const int ApPropAdd = basicApOfGhost * 12 / 10;
  208. public const int ApSpearAdd = basicApOfGhost * 6 / 10;
  209. public const int RemainHpWhenAddLife = 100;
  210. public const int numOfPropSpecies = 8;
  211. public const int numOfKeyEachArea = 2;
  212. public const int numOfPropTypeNotKey = 4;
  213. public const int numOfTeachingBuilding = 3;
  214. #endregion
  215. #region 物体相关
  216. public const int degreeOfFixedGenerator = 10000000;
  217. public const int degreeOfLockingOrOpeningTheDoor = 10000000;
  218. public const int degreeOfOpenedChest = 10000000;
  219. public const int degreeOfOpenedDoorway = 18000;
  220. public const int maxNumOfPropInChest = 2;
  221. public const int numOfGeneratorRequiredForRepair = 7;
  222. public const int numOfGeneratorRequiredForEmergencyExit = 3;
  223. #endregion
  224. }
  225. }