SkillFeaturesData.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System;
  2. using Fort23.Core;
  3. namespace GameLogic.Combat.Skill
  4. {
  5. [Flags]
  6. public enum SkillFeaturesType
  7. {
  8. Null = 0,
  9. // 金
  10. Gold = 1,
  11. // 木
  12. Wood = 2,
  13. // 水
  14. Water = 4,
  15. // 火
  16. Fire = 8,
  17. // 土
  18. Earth = 16,
  19. }
  20. public class SkillFeaturesData : CObject
  21. {
  22. /// <summary>
  23. /// 防御值
  24. /// </summary>
  25. public int def;
  26. /// <summary>
  27. /// 生命值
  28. /// </summary>
  29. public int hp;
  30. public SkillFeaturesType SkillFeaturesType;
  31. public int GetRestrained(SkillFeaturesType targetSkillFeaturesType)
  32. {
  33. int c = 0;
  34. if (SkillFeaturesType.HasFlag(SkillFeaturesType.Gold))
  35. {
  36. if (targetSkillFeaturesType.HasFlag(SkillFeaturesType.Wood))
  37. {
  38. c++;
  39. }
  40. }
  41. if (SkillFeaturesType.HasFlag(SkillFeaturesType.Wood))
  42. {
  43. if (targetSkillFeaturesType.HasFlag(SkillFeaturesType.Earth))
  44. {
  45. c++;
  46. }
  47. }
  48. if (SkillFeaturesType.HasFlag(SkillFeaturesType.Water))
  49. {
  50. if (targetSkillFeaturesType.HasFlag(SkillFeaturesType.Fire))
  51. {
  52. c++;
  53. }
  54. }
  55. if (SkillFeaturesType.HasFlag(SkillFeaturesType.Fire))
  56. {
  57. if (targetSkillFeaturesType.HasFlag(SkillFeaturesType.Gold))
  58. {
  59. c++;
  60. }
  61. }
  62. if (SkillFeaturesType.HasFlag(SkillFeaturesType.Earth))
  63. {
  64. if (targetSkillFeaturesType.HasFlag(SkillFeaturesType.Wood))
  65. {
  66. c++;
  67. }
  68. }
  69. return c;
  70. }
  71. public SkillFeaturesData CapyFeaturesData()
  72. {
  73. SkillFeaturesData skillFeaturesData = CObjectPool.Instance.Fetch<SkillFeaturesData>();
  74. skillFeaturesData.hp = hp;
  75. skillFeaturesData.def = def;
  76. skillFeaturesData.SkillFeaturesType = SkillFeaturesType;
  77. return skillFeaturesData;
  78. }
  79. public override void ActiveObj()
  80. {
  81. }
  82. public override void DormancyObj()
  83. {
  84. }
  85. }
  86. }