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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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 AttackDistance => 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)AttackDistance * 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 AttackDistance => 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 const int castTime = GameData.basicCastTime * 6 / 5;
  70. public override int CastTime => castTime;
  71. public override int Backswing => 0;
  72. public override int RecoveryFromHit => 0;
  73. public const int cd = castTime;
  74. public override int CD => cd;
  75. public const int maxBulletNum = 1;
  76. public override int MaxBulletNum => maxBulletNum;
  77. public override bool CanAttack(GameObj target)
  78. {
  79. return false;
  80. }
  81. public override bool CanBeBombed(GameObjType gameObjType)
  82. {
  83. switch (gameObjType)
  84. {
  85. case GameObjType.Character:
  86. return true;
  87. default:
  88. return false;
  89. }
  90. }
  91. public override BulletType TypeOfBullet => BulletType.FlyingKnife;
  92. }
  93. internal sealed class BombBomb : Bullet
  94. {
  95. public BombBomb(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
  96. {
  97. }
  98. public override double BulletBombRange => GameData.basicBulletBombRange;
  99. public override double AttackDistance => 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)(AttackDistance * 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, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos)
  138. {
  139. }
  140. public override double BulletBombRange => GameData.basicBulletBombRange / 2;
  141. public override double AttackDistance => GameData.basicAttackShortRange * 2;
  142. public int ap = (int)(GameData.basicApOfGhost * 0.6);
  143. public override int AP
  144. {
  145. get => ap;
  146. set
  147. {
  148. lock (gameObjLock)
  149. ap = value;
  150. }
  151. }
  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. }