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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 / 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 override bool CanAttack(GameObj target)
  32. {
  33. return false;
  34. }
  35. public override bool CanBeBombed(GameObjType gameObjType)
  36. {
  37. switch (gameObjType)
  38. {
  39. case GameObjType.Character:
  40. case GameObjType.Generator:
  41. return true;
  42. default:
  43. return false;
  44. }
  45. }
  46. public override BulletType TypeOfBullet => BulletType.CommonAttackOfGhost;
  47. }
  48. internal sealed class FlyingKnife : Bullet
  49. {
  50. public FlyingKnife(Character player, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) :
  51. base(player, radius, placeType, pos)
  52. {
  53. }
  54. public override double BulletBombRange => 0;
  55. public override double BulletAttackRange => GameData.basicRemoteAttackRange * 13;
  56. public int ap = GameData.basicApOfGhost * 4 / 5;
  57. public override int AP
  58. {
  59. get => ap;
  60. set
  61. {
  62. lock (gameObjLock)
  63. ap = value;
  64. }
  65. }
  66. public override int Speed => GameData.basicBulletMoveSpeed * 2;
  67. public override bool IsRemoteAttack => true;
  68. public override int CastTime => GameData.basicCastTime;
  69. public override int Backswing => 0;
  70. public override int RecoveryFromHit => 0;
  71. public const int cd = GameData.basicBackswing * 2 / 5 + 100;
  72. public override int CD => cd;
  73. public override bool CanAttack(GameObj target)
  74. {
  75. return false;
  76. }
  77. public override bool CanBeBombed(GameObjType gameObjType)
  78. {
  79. switch (gameObjType)
  80. {
  81. case GameObjType.Character:
  82. return true;
  83. default:
  84. return false;
  85. }
  86. }
  87. public override BulletType TypeOfBullet => BulletType.FlyingKnife;
  88. }
  89. internal sealed class BombBomb : Bullet
  90. {
  91. public BombBomb(Character player, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) :
  92. base(player, radius, placeType, pos)
  93. {
  94. }
  95. public override double BulletBombRange => GameData.basicBulletBombRange;
  96. public override double BulletAttackRange => GameData.basicAttackShortRange;
  97. public int ap = (int)(GameData.basicApOfGhost * 6.0 / 5);
  98. public override int AP
  99. {
  100. get => ap;
  101. set
  102. {
  103. lock (gameObjLock)
  104. ap = value;
  105. }
  106. }
  107. public override int Speed => (int)(GameData.basicBulletMoveSpeed * 0.8);
  108. public override bool IsRemoteAttack => false;
  109. public override int CastTime => (int)BulletAttackRange / Speed;
  110. public override int Backswing => GameData.basicBackswing;
  111. public override int RecoveryFromHit => GameData.basicRecoveryFromHit;
  112. public const int cd = GameData.basicCD;
  113. public override int CD => cd;
  114. public override bool CanAttack(GameObj target)
  115. {
  116. return XY.Distance(this.Position, target.Position) <= BulletBombRange;
  117. }
  118. public override bool CanBeBombed(GameObjType gameObjType)
  119. {
  120. switch (gameObjType)
  121. {
  122. case GameObjType.Character:
  123. case GameObjType.Generator:
  124. return true;
  125. default:
  126. return false;
  127. }
  128. }
  129. public override BulletType TypeOfBullet => BulletType.BombBomb;
  130. }
  131. internal sealed class JumpyDumpty : Bullet
  132. {
  133. public JumpyDumpty(Character player, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) :
  134. base(player, radius, placeType, pos)
  135. {
  136. }
  137. public override double BulletBombRange => GameData.basicBulletBombRange / 2;
  138. public override double BulletAttackRange => GameData.basicAttackShortRange * 2;
  139. public int ap = (int)(GameData.basicApOfGhost * 0.6);
  140. public override int AP
  141. {
  142. get => ap;
  143. set
  144. {
  145. lock (gameObjLock)
  146. ap = value;
  147. }
  148. }
  149. public override int Speed => (int)(GameData.basicBulletMoveSpeed * 1.2);
  150. public override bool IsRemoteAttack => false;
  151. public override int CastTime => 0;
  152. public override int Backswing => 0;
  153. public override int RecoveryFromHit => 0;
  154. public const int cd = 0;
  155. public override int CD => cd;
  156. public override bool CanAttack(GameObj target)
  157. {
  158. return XY.Distance(this.Position, target.Position) <= BulletBombRange;
  159. }
  160. public override bool CanBeBombed(GameObjType gameObjType)
  161. {
  162. switch (gameObjType)
  163. {
  164. case GameObjType.Character:
  165. case GameObjType.Generator:
  166. return true;
  167. default:
  168. return false;
  169. }
  170. }
  171. public override BulletType TypeOfBullet => BulletType.JumpyDumpty;
  172. }
  173. }