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

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