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.

Consumables.cs 5.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. using Preparation.Interface;
  2. using Preparation.Utility;
  3. namespace GameClass.GameObj
  4. {
  5. public abstract class Consumables : ObjOfCharacter
  6. {
  7. public override bool IsRigid => true;
  8. public override bool IgnoreCollideExecutor(IGameObj targetObj)
  9. {
  10. if (targetObj.Type == GameObjType.Consumables || targetObj.Type == GameObjType.Bullet
  11. || targetObj.Type == GameObjType.Character || targetObj.Type == GameObjType.Chest)
  12. return true;
  13. return false;
  14. }
  15. public override ShapeType Shape => ShapeType.Square;
  16. public abstract PropType GetPropType();
  17. public Consumables(XY initPos, int radius = GameData.PropRadius) :
  18. base(initPos, radius, GameObjType.Consumables)
  19. {
  20. this.canMove = false;
  21. this.MoveSpeed = GameData.PropMoveSpeed;
  22. }
  23. }
  24. ///// <summary>
  25. ///// 坑人地雷
  26. ///// </summary>
  27. // public abstract class DebuffMine : Consumables
  28. //{
  29. // public DebuffMine(XYPosition initPos) : base(initPos) { }
  30. // }
  31. #region 所有增益道具
  32. /// <summary>
  33. /// 增加速度
  34. /// </summary>
  35. public sealed class AddSpeed : Consumables
  36. {
  37. public AddSpeed(XY initPos) :
  38. base(initPos)
  39. {
  40. }
  41. public override PropType GetPropType() => PropType.AddSpeed;
  42. }
  43. /// <summary>
  44. /// 复活甲
  45. /// </summary>
  46. public sealed class AddLifeOrClairaudience : Consumables
  47. {
  48. public AddLifeOrClairaudience(XY initPos) :
  49. base(initPos)
  50. {
  51. }
  52. public override PropType GetPropType() => PropType.AddLifeOrClairaudience;
  53. }
  54. public sealed class AddHpOrAp : Consumables
  55. {
  56. public AddHpOrAp(XY initPos) :
  57. base(initPos)
  58. {
  59. }
  60. public override PropType GetPropType() => PropType.AddHpOrAp;
  61. }
  62. public sealed class RecoveryFromDizziness : Consumables
  63. {
  64. public RecoveryFromDizziness(XY initPos) :
  65. base(initPos)
  66. {
  67. }
  68. public override PropType GetPropType() => PropType.RecoveryFromDizziness;
  69. }
  70. /// <summary>
  71. /// 矛盾
  72. /// </summary>
  73. public sealed class ShieldOrSpear : Consumables
  74. {
  75. public ShieldOrSpear(XY initPos) : base(initPos)
  76. {
  77. }
  78. public override PropType GetPropType() => PropType.ShieldOrSpear;
  79. }
  80. public sealed class Key3 : Consumables
  81. {
  82. public Key3(XY initPos) : base(initPos)
  83. {
  84. }
  85. public override PropType GetPropType() => PropType.Key3;
  86. }
  87. public sealed class Key5 : Consumables
  88. {
  89. public Key5(XY initPos) : base(initPos)
  90. {
  91. }
  92. public override PropType GetPropType() => PropType.Key5;
  93. }
  94. public sealed class Key6 : Consumables
  95. {
  96. public Key6(XY initPos) : base(initPos)
  97. {
  98. }
  99. public override PropType GetPropType() => PropType.Key6;
  100. }
  101. public sealed class NullProp : Consumables
  102. {
  103. public NullProp() : base(new XY(1, 1))
  104. {
  105. }
  106. public override PropType GetPropType() => PropType.Null;
  107. }
  108. #endregion
  109. // #region 所有坑人地雷
  110. ///// <summary>
  111. ///// 减速
  112. ///// </summary>
  113. // public sealed class MinusSpeed : DebuffMine
  114. //{
  115. // public MinusSpeed(XYPosition initPos) : base(initPos) { }
  116. // public override PropType GetPropType() => PropType.minusSpeed;
  117. // }
  118. ///// <summary>
  119. ///// 减少攻击力
  120. ///// </summary>
  121. // public sealed class MinusAP : DebuffMine
  122. //{
  123. // public MinusAP(XYPosition initPos) : base(initPos) { }
  124. // public override PropType GetPropType() => PropType.minusAP;
  125. // }
  126. ///// <summary>
  127. ///// 增加冷却
  128. ///// </summary>
  129. // public sealed class AddCD : DebuffMine
  130. //{
  131. // public AddCD(XYPosition initPos) : base(initPos) { }
  132. // public override PropType GetPropType() => PropType.addCD;
  133. // }
  134. // #endregion
  135. public static class PropFactory
  136. {
  137. public static Consumables GetConsumables(PropType propType, XY pos)
  138. {
  139. switch (propType)
  140. {
  141. case PropType.AddSpeed:
  142. return new AddSpeed(pos);
  143. case PropType.AddLifeOrClairaudience:
  144. return new AddLifeOrClairaudience(pos);
  145. case PropType.ShieldOrSpear:
  146. return new ShieldOrSpear(pos);
  147. case PropType.AddHpOrAp:
  148. return new AddHpOrAp(pos);
  149. case PropType.RecoveryFromDizziness:
  150. return new RecoveryFromDizziness(pos);
  151. case PropType.Key3:
  152. return new Key3(pos);
  153. case PropType.Key5:
  154. return new Key5(pos);
  155. case PropType.Key6:
  156. return new Key6(pos);
  157. default:
  158. return new NullProp();
  159. }
  160. }
  161. }
  162. }