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.

Bullet.Ghost.cs 6.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. using Preparation.Interface;
  2. using Preparation.Utility;
  3. namespace GameClass.GameObj
  4. {
  5. internal sealed class CommonAttackOfGhost : Bullet
  6. {
  7. public CommonAttackOfGhost(Character player, XY pos, int radius = GameData.bulletRadius) :
  8. base(player, radius, pos)
  9. {
  10. }
  11. public override double BulletBombRange => 0;
  12. public override double BulletAttackRange => GameData.basicAttackShortRange;
  13. public int ap = GameData.basicApOfGhost;
  14. public override int AP
  15. {
  16. get => ap;
  17. set
  18. {
  19. lock (gameObjLock)
  20. ap = value;
  21. }
  22. }
  23. public override int Speed => GameData.basicBulletMoveSpeed;
  24. public override bool IsRemoteAttack => false;
  25. public override int CastTime => (int)BulletAttackRange * 1000 / Speed;
  26. public override int Backswing => GameData.basicBackswing;
  27. public override int RecoveryFromHit => GameData.basicRecoveryFromHit;
  28. public const int cd = GameData.basicBackswing;
  29. public override int CD => cd;
  30. public const int maxBulletNum = 1;
  31. public override int MaxBulletNum => maxBulletNum;
  32. public override bool CanAttack(GameObj target)
  33. {
  34. return false;
  35. }
  36. public override bool CanBeBombed(GameObjType gameObjType)
  37. {
  38. switch (gameObjType)
  39. {
  40. case GameObjType.Character:
  41. case GameObjType.Generator:
  42. return true;
  43. default:
  44. return false;
  45. }
  46. }
  47. public override BulletType TypeOfBullet => BulletType.CommonAttackOfGhost;
  48. }
  49. internal sealed class FlyingKnife : Bullet
  50. {
  51. public FlyingKnife(Character player, XY pos, int radius = GameData.bulletRadius) :
  52. base(player, radius, pos)
  53. {
  54. }
  55. public override double BulletBombRange => 0;
  56. public override double BulletAttackRange => GameData.basicRemoteAttackRange * 13;
  57. public int ap = GameData.basicApOfGhost * 4 / 5;
  58. public override int AP
  59. {
  60. get => ap;
  61. set
  62. {
  63. lock (gameObjLock)
  64. ap = value;
  65. }
  66. }
  67. public override int Speed => GameData.basicBulletMoveSpeed * 25 / 10;
  68. public override bool IsRemoteAttack => true;
  69. public override int CastTime => GameData.basicCastTime * 4 / 5;
  70. public override int Backswing => 0;
  71. public override int RecoveryFromHit => 0;
  72. public const int cd = GameData.basicBackswing / 2;
  73. public override int CD => cd;
  74. public const int maxBulletNum = 1;
  75. public override int MaxBulletNum => maxBulletNum;
  76. public override bool CanAttack(GameObj target)
  77. {
  78. return false;
  79. }
  80. public override bool CanBeBombed(GameObjType gameObjType)
  81. {
  82. switch (gameObjType)
  83. {
  84. case GameObjType.Character:
  85. return true;
  86. default:
  87. return false;
  88. }
  89. }
  90. public override BulletType TypeOfBullet => BulletType.FlyingKnife;
  91. }
  92. internal sealed class BombBomb : Bullet
  93. {
  94. public BombBomb(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
  95. {
  96. }
  97. public override double BulletBombRange => GameData.basicBulletBombRange;
  98. public override double BulletAttackRange => GameData.basicAttackShortRange;
  99. public int ap = (int)(GameData.basicApOfGhost * 6.0 / 5);
  100. public override int AP
  101. {
  102. get => ap;
  103. set
  104. {
  105. lock (gameObjLock)
  106. ap = value;
  107. }
  108. }
  109. public override int Speed => (int)(GameData.basicBulletMoveSpeed * 30 / 37);
  110. public override bool IsRemoteAttack => false;
  111. public override int CastTime => (int)(BulletAttackRange * 1000 / Speed);
  112. public override int Backswing => GameData.basicRecoveryFromHit;
  113. public override int RecoveryFromHit => GameData.basicRecoveryFromHit;
  114. public const int cd = GameData.basicCD;
  115. public override int CD => cd;
  116. public const int maxBulletNum = 1;
  117. public override int MaxBulletNum => maxBulletNum;
  118. public override bool CanAttack(GameObj target)
  119. {
  120. return XY.DistanceFloor3(this.Position, target.Position) <= BulletBombRange;
  121. }
  122. public override bool CanBeBombed(GameObjType gameObjType)
  123. {
  124. switch (gameObjType)
  125. {
  126. case GameObjType.Character:
  127. return true;
  128. default:
  129. return false;
  130. }
  131. }
  132. public override BulletType TypeOfBullet => BulletType.BombBomb;
  133. }
  134. internal sealed class JumpyDumpty : Bullet
  135. {
  136. public JumpyDumpty(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
  137. {
  138. }
  139. public override double BulletBombRange => GameData.basicBulletBombRange / 2;
  140. public override double BulletAttackRange => GameData.basicAttackShortRange * 2;
  141. public int ap = (int)(GameData.basicApOfGhost * 0.6);
  142. public override int AP
  143. {
  144. get => ap;
  145. set
  146. {
  147. lock (gameObjLock)
  148. ap = value;
  149. }
  150. }
  151. public override int Speed => (int)(GameData.basicBulletMoveSpeed * 43 / 37);
  152. public override bool IsRemoteAttack => false;
  153. public override int CastTime => 0;
  154. public override int Backswing => 0;
  155. public override int RecoveryFromHit => 0;
  156. public const int cd = 0;
  157. public override int CD => cd;
  158. public const int maxBulletNum = 4;
  159. public override int MaxBulletNum => maxBulletNum;
  160. public override bool CanAttack(GameObj target)
  161. {
  162. return XY.DistanceFloor3(this.Position, target.Position) <= BulletBombRange;
  163. }
  164. public override bool CanBeBombed(GameObjType gameObjType)
  165. {
  166. switch (gameObjType)
  167. {
  168. case GameObjType.Character:
  169. return true;
  170. default:
  171. return false;
  172. }
  173. }
  174. public override BulletType TypeOfBullet => BulletType.JumpyDumpty;
  175. }
  176. }