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 3.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. using Preparation.Interface;
  2. using Preparation.Utility;
  3. using Preparation.GameData;
  4. namespace GameClass.GameObj
  5. {
  6. public abstract class Prop : ObjOfCharacter
  7. {
  8. protected bool laid = false;
  9. public bool Laid => laid; // 道具是否放置在地图上
  10. public override bool IsRigid => true;
  11. protected override bool IgnoreCollideExecutor(IGameObj targetObj)
  12. {
  13. if (targetObj.Type == GameObjType.BirthPoint || targetObj.Type == GameObjType.Prop || targetObj.Type == GameObjType.Bullet || targetObj.Type == GameObjType.Character)
  14. return true;
  15. return false;
  16. }
  17. public override ShapeType Shape => ShapeType.Square;
  18. public abstract PropType GetPropType();
  19. public Prop(XY initPos, int radius = GameData.PropRadius) :
  20. base(initPos, radius, PlaceType.Land, GameObjType.Prop)
  21. {
  22. this.CanMove = false;
  23. this.moveSpeed = GameData.PropMoveSpeed;
  24. }
  25. public void SetNewPos(XY pos)
  26. {
  27. this.Position = pos;
  28. }
  29. }
  30. /// <summary>
  31. /// 增益道具
  32. /// </summary>
  33. public abstract class BuffProp : Prop
  34. {
  35. public BuffProp(XY initPos) :
  36. base(initPos)
  37. {
  38. }
  39. }
  40. ///// <summary>
  41. ///// 坑人地雷
  42. ///// </summary>
  43. // public abstract class DebuffMine : Prop
  44. //{
  45. // public DebuffMine(XYPosition initPos) : base(initPos) { }
  46. // }
  47. #region 所有增益道具
  48. /// <summary>
  49. /// 增加速度
  50. /// </summary>
  51. public sealed class AddSpeed : BuffProp
  52. {
  53. public AddSpeed(XY initPos) :
  54. base(initPos)
  55. {
  56. }
  57. public override PropType GetPropType() => PropType.addSpeed;
  58. }
  59. /// <summary>
  60. /// 复活甲
  61. /// </summary>
  62. public sealed class AddLIFE : BuffProp
  63. {
  64. public AddLIFE(XY initPos) :
  65. base(initPos)
  66. {
  67. }
  68. public override PropType GetPropType() => PropType.addLIFE;
  69. }
  70. /// <summary>
  71. /// 护盾
  72. /// </summary>
  73. public sealed class Shield : BuffProp
  74. {
  75. public Shield(XY initPos) :
  76. base(initPos)
  77. {
  78. }
  79. public override PropType GetPropType() => PropType.Shield;
  80. }
  81. /// <summary>
  82. /// 矛
  83. /// </summary>
  84. public sealed class Spear : BuffProp
  85. {
  86. public Spear(XY initPos) :
  87. base(initPos)
  88. {
  89. }
  90. public override PropType GetPropType() => PropType.Spear;
  91. }
  92. #endregion
  93. // #region 所有坑人地雷
  94. ///// <summary>
  95. ///// 减速
  96. ///// </summary>
  97. // public sealed class MinusSpeed : DebuffMine
  98. //{
  99. // public MinusSpeed(XYPosition initPos) : base(initPos) { }
  100. // public override PropType GetPropType() => PropType.minusSpeed;
  101. // }
  102. ///// <summary>
  103. ///// 减少攻击力
  104. ///// </summary>
  105. // public sealed class MinusAP : DebuffMine
  106. //{
  107. // public MinusAP(XYPosition initPos) : base(initPos) { }
  108. // public override PropType GetPropType() => PropType.minusAP;
  109. // }
  110. ///// <summary>
  111. ///// 增加冷却
  112. ///// </summary>
  113. // public sealed class AddCD : DebuffMine
  114. //{
  115. // public AddCD(XYPosition initPos) : base(initPos) { }
  116. // public override PropType GetPropType() => PropType.addCD;
  117. // }
  118. // #endregion
  119. }