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.

Prop.cs 5.4 kB

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