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

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