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.

Item.cs 2.5 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using Preparation.Interface;
  2. using Preparation.Utility;
  3. using System.Threading;
  4. namespace GameClass.GameObj
  5. {
  6. public abstract class Item : ObjOfCharacter
  7. {
  8. public override bool IsRigid => true;
  9. public override bool IgnoreCollideExecutor(IGameObj targetObj) => false;
  10. public override ShapeType Shape => ShapeType.Square;
  11. public abstract PropType GetPropType();
  12. public Item(XY initPos, int radius = GameData.propRadius) :
  13. base(initPos, radius, GameObjType.Item)
  14. {
  15. this.ReSetCanMove(false);
  16. this.MoveSpeed = 0;
  17. }
  18. }
  19. ///// <summary>
  20. ///// 坑人地雷
  21. ///// </summary>
  22. // public abstract class DebuffMine : Gadget
  23. //{
  24. // public DebuffMine(XYPosition initPos) : base(initPos) { }
  25. // }
  26. public sealed class CraftingBench : Item
  27. {
  28. public CraftingBench(XY initPos, Character character, int num) :
  29. base(initPos)
  30. {
  31. Parent = character;
  32. this.num = num;
  33. }
  34. private readonly int num;
  35. private long parentStateNum;
  36. public long ParentStateNum
  37. {
  38. get => Interlocked.Read(ref parentStateNum);
  39. set => Interlocked.Exchange(ref parentStateNum, value);
  40. }
  41. public void StopSkill()
  42. {
  43. ((SummonGolem)Parent!.FindActiveSkill(ActiveSkillType.SummonGolem)).DeleteGolem((int)num);
  44. }
  45. public void TryStopSkill()
  46. {
  47. Parent!.ResetPlayerState(parentStateNum);
  48. }
  49. public override PropType GetPropType() => PropType.CraftingBench;
  50. }
  51. // #region 所有坑人地雷
  52. ///// <summary>
  53. ///// 减速
  54. ///// </summary>
  55. // public sealed class MinusSpeed : DebuffMine
  56. //{
  57. // public MinusSpeed(XYPosition initPos) : base(initPos) { }
  58. // public override PropType GetPropType() => PropType.minusSpeed;
  59. // }
  60. ///// <summary>
  61. ///// 减少攻击力
  62. ///// </summary>
  63. // public sealed class MinusAP : DebuffMine
  64. //{
  65. // public MinusAP(XYPosition initPos) : base(initPos) { }
  66. // public override PropType GetPropType() => PropType.minusAP;
  67. // }
  68. ///// <summary>
  69. ///// 增加冷却
  70. ///// </summary>
  71. // public sealed class AddCD : DebuffMine
  72. //{
  73. // public AddCD(XYPosition initPos) : base(initPos) { }
  74. // public override PropType GetPropType() => PropType.addCD;
  75. // }
  76. // #endregion
  77. }