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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using GameClass.Skill;
  2. using Preparation.Utility;
  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; } = GameData.basicFixSpeed;
  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; } = GameData.basicTreatSpeed;
  39. protected int rescueSpeed = GameData.basicRescueSpeed;
  40. public int RescueSpeed
  41. {
  42. get => rescueSpeed;
  43. set
  44. {
  45. lock (gameObjLock)
  46. {
  47. rescueSpeed = value;
  48. }
  49. }
  50. }
  51. public int OrgRescueSpeed { get; protected set; } = GameData.basicRescueSpeed;
  52. public int MaxGamingAddiction { get; protected set; }
  53. private int gamingAddiction;
  54. public int GamingAddiction
  55. {
  56. get => gamingAddiction;
  57. set
  58. {
  59. if (gamingAddiction > 0)
  60. lock (gameObjLock)
  61. gamingAddiction = value <= MaxGamingAddiction ? value : MaxGamingAddiction;
  62. else
  63. lock (gameObjLock)
  64. gamingAddiction = 0;
  65. }
  66. }
  67. private int selfHealingTimes = 1;//剩余的自愈次数
  68. public int SelfHealingTimes
  69. {
  70. get => selfHealingTimes;
  71. set
  72. {
  73. lock (gameObjLock)
  74. selfHealingTimes = (value > 0) ? value : 0;
  75. }
  76. }
  77. private int degreeOfTreatment = 0;
  78. public int DegreeOfTreatment
  79. {
  80. get => degreeOfTreatment;
  81. set
  82. {
  83. if (value > 0)
  84. lock (gameObjLock)
  85. degreeOfTreatment = (value < MaxHp - HP) ? value : MaxHp - HP;
  86. else
  87. lock (gameObjLock)
  88. degreeOfTreatment = 0;
  89. }
  90. }
  91. public void Escape()
  92. {
  93. lock (gameObjLock)
  94. IsResetting = true;
  95. PlayerState = PlayerStateType.IsEscaped;
  96. }
  97. public Student(XY initPos, int initRadius, PlaceType initPlace, CharacterType characterType) : base(initPos, initRadius, initPlace)
  98. {
  99. switch (characterType)
  100. {
  101. case CharacterType.Athlete:
  102. this.Occupation = new Athlete();
  103. break;
  104. default:
  105. this.Occupation = null;
  106. break;
  107. }
  108. this.fixSpeed = ((IStudent)Occupation).FixSpeed;
  109. this.CharacterType = characterType;
  110. }
  111. }
  112. }