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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using System;
  2. namespace Preparation.Utility
  3. {
  4. public static class GameData
  5. {
  6. #region 基本常数
  7. public const int numOfStepPerSecond = 20; // 每秒行走的步数
  8. public const int frameDuration = 50; // 每帧时长
  9. public const long gameDuration = 600000; // 游戏时长600000ms = 10min
  10. public const int MinSpeed = 1; // 最小速度
  11. public const int MaxSpeed = int.MaxValue; // 最大速度
  12. #endregion
  13. #region 地图相关
  14. public const int numOfPosGridPerCell = 1000; // 每格的【坐标单位】数
  15. public const int lengthOfMap = 50000; // 地图长度
  16. public const int rows = 50; // 行数
  17. public const int cols = 50; // 列数
  18. public const int numOfBirthPoint = 5;
  19. // public const int numOfGenerator = 9;
  20. public const int numOfGeneratorRequiredForRepair = 7;
  21. public const int numOfChest = 8;
  22. private const int numOfObjNotMap = 5;
  23. public static bool IsMap(GameObjType gameObjType)
  24. {
  25. return (uint)gameObjType > numOfObjNotMap;
  26. }
  27. public static XY GetCellCenterPos(int x, int y) // 求格子的中心坐标
  28. {
  29. XY ret = new(x * numOfPosGridPerCell + numOfPosGridPerCell / 2, y * numOfPosGridPerCell + numOfPosGridPerCell / 2);
  30. return ret;
  31. }
  32. public static int PosGridToCellX(XY pos) // 求坐标所在的格子的x坐标
  33. {
  34. return pos.x / numOfPosGridPerCell;
  35. }
  36. public static int PosGridToCellY(XY pos) // 求坐标所在的格子的y坐标
  37. {
  38. return pos.y / numOfPosGridPerCell;
  39. }
  40. public static bool IsInTheSameCell(XY pos1, XY pos2)
  41. {
  42. return PosGridToCellX(pos1) == PosGridToCellX(pos2) && PosGridToCellY(pos1) == PosGridToCellY(pos2);
  43. }
  44. public static bool ApproachToInteract(XY pos1, XY pos2)
  45. {
  46. return Math.Abs(PosGridToCellX(pos1) - PosGridToCellX(pos2)) <= 1 && Math.Abs(PosGridToCellY(pos1) - PosGridToCellY(pos2)) <= 1;
  47. }
  48. #endregion
  49. #region 角色相关
  50. public const int characterRadius = numOfPosGridPerCell / 2 / 5 * 4; // 人物半径
  51. public const int basicTreatSpeed = 100;
  52. public const int basicFixSpeed = 100;
  53. public const int basicTimeOfOpeningOrLocking = 3000;
  54. public const int basicTimeOfClimbingThroughWindows = 870;
  55. public const int basicTimeOfOpenChest = 10000;
  56. public const int basicHp = 3000000; // 初始血量
  57. public const int basicMaxGamingAddiction = 60000;//基本完全沉迷时间
  58. public const int BeginGamingAddiction = 10003;
  59. public const int MidGamingAddiction = 30000;
  60. public const int basicTreatmentDegree = 1500000;
  61. public const int basicTimeOfRescue = 1000;
  62. public const int basicMoveSpeed = 1260; // 基本移动速度,单位:s-1
  63. public const int characterMaxSpeed = 12000; // 最大速度
  64. public const int basicBulletMoveSpeed = 2700; // 基本子弹移动速度,单位:s-1
  65. public const double basicConcealment = 1.0;
  66. public const int basicAlertnessRadius = 30700;
  67. public const int maxNumOfPropInPropInventory = 3;
  68. public const int addScoreWhenKillOneLevelPlayer = 30; // 击杀一级角色获得的加分
  69. public static XY PosWhoDie = new XY(1, 1);
  70. public static bool IsGhost(CharacterType characterType)
  71. {
  72. return characterType switch
  73. {
  74. CharacterType.Assassin => true,
  75. _ => false,
  76. };
  77. }
  78. #endregion
  79. #region 攻击与子弹相关
  80. public const int basicApOfGhost = 1500000; // 捣蛋鬼攻击力
  81. public const int MinAP = 0; // 最小攻击力
  82. public const int MaxAP = int.MaxValue; // 最大攻击力
  83. public const int basicCD = 3000; // 初始子弹冷却
  84. public const int basicCastTime = 500;//基本前摇时间
  85. public const int basicBackswing = 500;//基本后摇时间
  86. public const int basicRecoveryFromHit = 4300;//基本命中攻击恢复时长
  87. public const int bulletRadius = 200; // 默认子弹半径
  88. public const int basicBulletNum = 3; // 基本初始子弹量
  89. public const double basicRemoteAttackRange = 9000; // 基本远程攻击范围
  90. public const double basicAttackShortRange = 2700; // 基本近程攻击范围
  91. public const double basicBulletBombRange = 3000; // 基本子弹爆炸范围
  92. #endregion
  93. #region 技能相关
  94. public const int commonSkillCD = 30000; // 普通技能标准冷却时间
  95. public const int commonSkillTime = 10000; // 普通技能标准持续时间
  96. /// <summary>
  97. /// BeginToCharge
  98. /// </summary>
  99. public const int TimeOfGhostFainting = 7220;//=AP of Ram
  100. public const int TimeOfStudentFainting = 2090;
  101. #endregion
  102. #region 道具相关
  103. public const int MinPropTypeNum = 1;
  104. public const int MaxPropTypeNum = 10;
  105. public const int PropRadius = numOfPosGridPerCell / 2;
  106. public const int PropMoveSpeed = 3000;
  107. public const int PropMaxMoveDistance = 15 * numOfPosGridPerCell;
  108. public const long PropProduceTime = 10000;
  109. public const int PropDuration = 10000;
  110. public const int numOfKeyEachArea = 2;
  111. public const int numOfPropTypeNotKey = 4;
  112. public const int numOfTeachingBuilding = 3;
  113. #endregion
  114. #region 物体相关
  115. public const int degreeOfFixedGenerator = 10300000;
  116. public const int degreeOfOpenedDoorway = 18000;
  117. public const int maxNumOfPropInChest = 2;
  118. #endregion
  119. #region 游戏帧相关
  120. public const long checkInterval = 50; // 检查位置标志、补充子弹的帧时长
  121. #endregion
  122. }
  123. }