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

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