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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. namespace Preparation.Utility
  3. {
  4. public static class GameData
  5. {
  6. #region 基本常数与常方法
  7. public const int numOfPosGridPerCell = 1000; // 每格的【坐标单位】数
  8. public const int numOfStepPerSecond = 20; // 每秒行走的步数
  9. public const int lengthOfMap = 50000; // 地图长度
  10. public const int rows = 50; // 行数
  11. public const int cols = 50; // 列数
  12. public const long gameDuration = 600000; // 游戏时长600000ms = 10min
  13. public const long frameDuration = 50; // 每帧时长
  14. public const int MinSpeed = 1; // 最小速度
  15. public const int MaxSpeed = int.MaxValue; // 最大速度
  16. public const int numOfBirthPoint = 5;
  17. // public const int numOfGenerator = 7;
  18. public const int numOfGeneratorRequiredForRepair = 5;
  19. public const int numOfObjNotMap = 5;
  20. public static XY GetCellCenterPos(int x, int y) // 求格子的中心坐标
  21. {
  22. XY ret = new(x * numOfPosGridPerCell + numOfPosGridPerCell / 2, y * numOfPosGridPerCell + numOfPosGridPerCell / 2);
  23. return ret;
  24. }
  25. public static int PosGridToCellX(XY pos) // 求坐标所在的格子的x坐标
  26. {
  27. return pos.x / numOfPosGridPerCell;
  28. }
  29. public static int PosGridToCellY(XY pos) // 求坐标所在的格子的y坐标
  30. {
  31. return pos.y / numOfPosGridPerCell;
  32. }
  33. public static bool IsInTheSameCell(XY pos1, XY pos2)
  34. {
  35. return PosGridToCellX(pos1) == PosGridToCellX(pos2) && PosGridToCellY(pos1) == PosGridToCellY(pos2);
  36. }
  37. public static bool ApproachToInteract(XY pos1, XY pos2)
  38. {
  39. return Math.Abs(PosGridToCellX(pos1) - PosGridToCellX(pos2)) <= 1 && Math.Abs(PosGridToCellY(pos1) - PosGridToCellY(pos2)) <= 1;
  40. }
  41. #endregion
  42. #region 角色相关
  43. public const int characterRadius = numOfPosGridPerCell / 2; // 人物半径
  44. public const int basicApOfGhost = 500; // 初始攻击力
  45. public const int basicHp = 1003; // 初始血量
  46. public const int basicCD = 3000; // 初始子弹冷却
  47. public const int basicBackswing = 500;//基本后摇时间
  48. public const int basicRecoveryFromHit = 4300;//基本命中攻击恢复时长
  49. public const int basicBulletNum = 3; // 基本初始子弹量
  50. public const int MinAP = 0; // 最小攻击力
  51. public const int MaxAP = int.MaxValue; // 最大攻击力
  52. public const double basicRemoteAttackRange = 9000; // 基本远程攻击范围
  53. public const double basicAttackShortRange = 2700; // 基本近程攻击范围
  54. public const double basicBulletBombRange = 3000; // 基本子弹爆炸范围
  55. public const int basicMoveSpeed = 3800; // 基本移动速度,单位:s-1
  56. public const int basicBulletMoveSpeed = 5400; // 基本子弹移动速度,单位:s-1
  57. public const int characterMaxSpeed = 12000; // 最大速度
  58. public const int addScoreWhenKillOneLevelPlayer = 30; // 击杀一级角色获得的加分
  59. public const int commonSkillCD = 30000; // 普通技能标准冷却时间
  60. public const int commonSkillTime = 10000; // 普通技能标准持续时间
  61. public const int bulletRadius = 200; // 默认子弹半径
  62. public const int reviveTime = 30000; // 复活时间
  63. public const int shieldTimeAtBirth = 3000; // 复活时的护盾时间
  64. public const int gemToScore = 4; // 一个宝石的标准加分
  65. #endregion
  66. #region 道具相关
  67. public const int MinPropTypeNum = 1;
  68. public const int MaxPropTypeNum = 10;
  69. public const int PropRadius = numOfPosGridPerCell / 2;
  70. public const int PropMoveSpeed = 3000;
  71. public const int PropMaxMoveDistance = 15 * numOfPosGridPerCell;
  72. public const int MaxGemSize = 5; // 随机生成的宝石最大size
  73. public const long GemProduceTime = 10000;
  74. public const long PropProduceTime = 10000;
  75. public const int PropDuration = 10000;
  76. public const int degreeOfFixedGenerator = 2000;
  77. #endregion
  78. #region 游戏帧相关
  79. public const long checkInterval = 50; // 检查位置标志、补充子弹的帧时长
  80. #endregion
  81. }
  82. }