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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) :
  8. base(player, radius, placeType, 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, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) :
  52. base(player, radius, placeType, 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, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) :
  95. base(player, radius, placeType, pos)
  96. {
  97. }
  98. public override double BulletBombRange => GameData.basicBulletBombRange;
  99. public override double BulletAttackRange => GameData.basicAttackShortRange;
  100. public int ap = (int)(GameData.basicApOfGhost * 6.0 / 5);
  101. public override int AP
  102. {
  103. get => ap;
  104. set
  105. {
  106. lock (gameObjLock)
  107. ap = value;
  108. }
  109. }
  110. public override int Speed => (int)(GameData.basicBulletMoveSpeed * 30 / 37);
  111. public override bool IsRemoteAttack => false;
  112. public override int CastTime => (int)(BulletAttackRange * 1000 / Speed);
  113. public override int Backswing => GameData.basicRecoveryFromHit;
  114. public override int RecoveryFromHit => GameData.basicRecoveryFromHit;
  115. public const int cd = GameData.basicCD;
  116. public override int CD => cd;
  117. public const int maxBulletNum = 1;
  118. public override int MaxBulletNum => maxBulletNum;
  119. public override bool CanAttack(GameObj target)
  120. {
  121. return XY.DistanceFloor3(this.Position, target.Position) <= BulletBombRange;
  122. }
  123. public override bool CanBeBombed(GameObjType gameObjType)
  124. {
  125. switch (gameObjType)
  126. {
  127. case GameObjType.Character:
  128. return true;
  129. default:
  130. return false;
  131. }
  132. }
  133. public override BulletType TypeOfBullet => BulletType.BombBomb;
  134. }
  135. internal sealed class JumpyDumpty : Bullet
  136. {
  137. public JumpyDumpty(Character player, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) :
  138. base(player, radius, placeType, pos)
  139. {
  140. }
  141. public override double BulletBombRange => GameData.basicBulletBombRange / 2;
  142. public override double BulletAttackRange => GameData.basicAttackShortRange * 2;
  143. public int ap = (int)(GameData.basicApOfGhost * 0.6);
  144. public override int AP
  145. {
  146. get => ap;
  147. set
  148. {
  149. lock (gameObjLock)
  150. ap = value;
  151. }
  152. }
  153. public override int Speed => (int)(GameData.basicBulletMoveSpeed * 43 / 37);
  154. public override bool IsRemoteAttack => false;
  155. public override int CastTime => 0;
  156. public override int Backswing => 0;
  157. public override int RecoveryFromHit => 0;
  158. public const int cd = 0;
  159. public override int CD => cd;
  160. public const int maxBulletNum = 4;
  161. public override int MaxBulletNum => maxBulletNum;
  162. public override bool CanAttack(GameObj target)
  163. {
  164. return XY.DistanceFloor3(this.Position, target.Position) <= BulletBombRange;
  165. }
  166. public override bool CanBeBombed(GameObjType gameObjType)
  167. {
  168. switch (gameObjType)
  169. {
  170. case GameObjType.Character:
  171. return true;
  172. default:
  173. return false;
  174. }
  175. }
  176. public override BulletType TypeOfBullet => BulletType.JumpyDumpty;
  177. }
  178. }