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.

Character.Student.cs 2.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using Preparation.Utility;
  2. using Preparation.Interface;
  3. namespace GameClass.GameObj
  4. {
  5. public class Student : Character
  6. {
  7. protected int fixSpeed;
  8. /// <summary>
  9. /// 修理电机速度
  10. /// </summary>
  11. public int FixSpeed
  12. {
  13. get => fixSpeed;
  14. set
  15. {
  16. lock (gameObjLock)
  17. {
  18. fixSpeed = value;
  19. }
  20. }
  21. }
  22. /// <summary>
  23. /// 原初修理电机速度
  24. /// </summary>
  25. public int OrgFixSpeed { get; protected set; }
  26. protected int treatSpeed = GameData.basicTreatSpeed;
  27. public int TreatSpeed
  28. {
  29. get => treatSpeed;
  30. set
  31. {
  32. lock (gameObjLock)
  33. {
  34. treatSpeed = value;
  35. }
  36. }
  37. }
  38. public int OrgTreatSpeed { get; protected set; }
  39. public int MaxGamingAddiction { get; protected set; }
  40. private int gamingAddiction;
  41. public int GamingAddiction
  42. {
  43. get => gamingAddiction;
  44. set
  45. {
  46. if (gamingAddiction > 0)
  47. lock (gameObjLock)
  48. gamingAddiction = value <= MaxGamingAddiction ? value : MaxGamingAddiction;
  49. else
  50. lock (gameObjLock)
  51. gamingAddiction = 0;
  52. }
  53. }
  54. private int selfHealingTimes = 1;//剩余的自愈次数
  55. public int SelfHealingTimes
  56. {
  57. get => selfHealingTimes;
  58. set
  59. {
  60. lock (gameObjLock)
  61. selfHealingTimes = (value > 0) ? value : 0;
  62. }
  63. }
  64. private int degreeOfTreatment = 0;
  65. public int DegreeOfTreatment
  66. {
  67. get => degreeOfTreatment;
  68. set
  69. {
  70. if (value > 0)
  71. lock (gameObjLock)
  72. degreeOfTreatment = (value < MaxHp - HP) ? value : MaxHp - HP;
  73. else
  74. lock (gameObjLock)
  75. degreeOfTreatment = 0;
  76. }
  77. }
  78. private int timeOfRescue = 0;
  79. public int TimeOfRescue
  80. {
  81. get => timeOfRescue;
  82. set
  83. {
  84. if (value > 0)
  85. lock (gameObjLock)
  86. timeOfRescue = (value < GameData.basicTimeOfRescue) ? value : GameData.basicTimeOfRescue;
  87. else
  88. lock (gameObjLock)
  89. timeOfRescue = 0;
  90. }
  91. }
  92. public Student(XY initPos, int initRadius, CharacterType characterType) : base(initPos, initRadius, characterType)
  93. {
  94. this.OrgFixSpeed = this.fixSpeed = ((IStudent)Occupation).FixSpeed;
  95. }
  96. }
  97. }