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.4 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.SetReturnOri(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.SetReturnOri(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 GameObjType.Generator:
  67. return true;
  68. default:
  69. return false;
  70. }
  71. }
  72. public override BulletType TypeOfBullet => BulletType.Strike;
  73. }
  74. internal sealed class FlyingKnife : Bullet
  75. {
  76. public FlyingKnife(Character player, XY pos, int radius = GameData.bulletRadius) :
  77. base(player, radius, pos)
  78. {
  79. AP.SetReturnOri(GameData.basicApOfGhost * 4 / 5);
  80. }
  81. public override double BulletBombRange => 0;
  82. public override double AttackDistance => GameData.basicRemoteAttackRange * 13;
  83. public override int Speed => GameData.basicBulletMoveSpeed * 25 / 10;
  84. public override bool IsRemoteAttack => true;
  85. public const int castTime = GameData.basicCastTime * 6 / 5;
  86. public override int CastTime => castTime;
  87. public override int Backswing => 0;
  88. public override int RecoveryFromHit => 0;
  89. public const int cd = castTime;
  90. public override int CD => cd;
  91. public const int maxBulletNum = 1;
  92. public override int MaxBulletNum => maxBulletNum;
  93. public override bool CanAttack(GameObj target)
  94. {
  95. return false;
  96. }
  97. public override bool CanBeBombed(GameObjType gameObjType)
  98. {
  99. switch (gameObjType)
  100. {
  101. case GameObjType.Character:
  102. return true;
  103. default:
  104. return false;
  105. }
  106. }
  107. public override BulletType TypeOfBullet => BulletType.FlyingKnife;
  108. }
  109. internal sealed class BombBomb : Bullet
  110. {
  111. public BombBomb(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
  112. {
  113. AP.SetReturnOri((int)(GameData.basicApOfGhost * 6.0 / 5));
  114. }
  115. public override double BulletBombRange => GameData.basicBulletBombRange;
  116. public override double AttackDistance => GameData.basicAttackShortRange;
  117. public override int Speed => (int)(GameData.basicBulletMoveSpeed * 30 / 37);
  118. public override bool IsRemoteAttack => false;
  119. public override int CastTime => (int)(AttackDistance * 1000 / Speed);
  120. public override int Backswing => GameData.basicBackswing * 3 / 2;
  121. public override int RecoveryFromHit => GameData.basicRecoveryFromHit;
  122. public const int cd = GameData.basicCD;
  123. public override int CD => cd;
  124. public const int maxBulletNum = 1;
  125. public override int MaxBulletNum => maxBulletNum;
  126. public override bool CanAttack(GameObj target)
  127. {
  128. return XY.DistanceFloor3(this.Position, target.Position) <= BulletBombRange;
  129. }
  130. public override bool CanBeBombed(GameObjType gameObjType)
  131. {
  132. switch (gameObjType)
  133. {
  134. case GameObjType.Character:
  135. case GameObjType.Generator:
  136. case GameObjType.Door:
  137. return true;
  138. default:
  139. return false;
  140. }
  141. }
  142. public override BulletType TypeOfBullet => BulletType.BombBomb;
  143. }
  144. internal sealed class JumpyDumpty : Bullet
  145. {
  146. public JumpyDumpty(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
  147. {
  148. AP.SetReturnOri((int)(GameData.basicApOfGhost * 0.6));
  149. }
  150. public override double BulletBombRange => GameData.basicBulletBombRange / 2;
  151. public override double AttackDistance => GameData.basicAttackShortRange * 18 / 22;
  152. public override int Speed => (int)(GameData.basicBulletMoveSpeed * 43 / 37);
  153. public override bool IsRemoteAttack => false;
  154. public override int CastTime => 0;
  155. public override int Backswing => 0;
  156. public override int RecoveryFromHit => 0;
  157. public const int cd = 0;
  158. public override int CD => cd;
  159. public const int maxBulletNum = 4;
  160. public override int MaxBulletNum => maxBulletNum;
  161. public override bool CanAttack(GameObj target)
  162. {
  163. return XY.DistanceFloor3(this.Position, target.Position) <= BulletBombRange;
  164. }
  165. public override bool CanBeBombed(GameObjType gameObjType)
  166. {
  167. switch (gameObjType)
  168. {
  169. case GameObjType.Character:
  170. return true;
  171. default:
  172. return false;
  173. }
  174. }
  175. public override BulletType TypeOfBullet => BulletType.JumpyDumpty;
  176. }
  177. }