HeroHerlp.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. using System.Collections.Generic;
  2. using Fort23.Core;
  3. using GameLogic.Hero;
  4. using Utility;
  5. namespace Fort23.Mono
  6. {
  7. public static class HeroHerlp
  8. {
  9. public static List<HeroAttributeData> GetHeroChageHeroAttributeData(HeroInfo currentHero, HeroInfo newHero)
  10. {
  11. List<HeroAttributeData> heroAttributeDataList = new List<HeroAttributeData>();
  12. if (currentHero.powerUpConfig.ShenshiMax != newHero.powerUpConfig.ShenshiMax)
  13. {
  14. HeroAttributeData heroAttributeData = new HeroAttributeData("神识上限",
  15. currentHero.powerUpConfig.ShenshiMax.ToStringEx(),
  16. "" + newHero.powerUpConfig.ShenshiMax.ToStringEx());
  17. heroAttributeDataList.Add(heroAttributeData);
  18. }
  19. if (currentHero.hp != newHero.hp)
  20. {
  21. HeroAttributeData heroAttributeData = new HeroAttributeData("生命", currentHero.hp.Value.ToStringEx(),
  22. "" + newHero.hp.Value.ToStringEx());
  23. heroAttributeDataList.Add(heroAttributeData);
  24. }
  25. if (currentHero.attack != newHero.attack)
  26. {
  27. HeroAttributeData heroAttributeData = new HeroAttributeData("攻击", currentHero.attack.Value.ToStringEx(),
  28. "" + newHero.attack.Value.ToStringEx());
  29. heroAttributeDataList.Add(heroAttributeData);
  30. }
  31. if (currentHero.defense != newHero.defense)
  32. {
  33. HeroAttributeData heroAttributeData = new HeroAttributeData("防御",
  34. currentHero.defense.Value.ToStringEx(), "" + newHero.defense.Value.ToStringEx());
  35. heroAttributeDataList.Add(heroAttributeData);
  36. }
  37. if (currentHero.powerUpConfig.MPFactor != newHero.powerUpConfig.MPFactor)
  38. {
  39. HeroAttributeData heroAttributeData = new HeroAttributeData("法宝倍率",
  40. currentHero.powerUpConfig.MPFactor.ToString(), "" + currentHero.powerUpConfig.MPFactor.ToString());
  41. heroAttributeDataList.Add(heroAttributeData);
  42. }
  43. if (currentHero.powerUpConfig.MPFactor != newHero.powerUpConfig.MPFactor)
  44. {
  45. HeroAttributeData heroAttributeData = new HeroAttributeData("护盾倍率",
  46. currentHero.powerUpConfig.HudunFactor.ToString(),
  47. "" + currentHero.powerUpConfig.HudunFactor.ToString());
  48. heroAttributeDataList.Add(heroAttributeData);
  49. }
  50. if (currentHero.powerUpConfig.MPFactor != newHero.powerUpConfig.MPFactor)
  51. {
  52. HeroAttributeData heroAttributeData = new HeroAttributeData("防御系数K",
  53. currentHero.powerUpConfig.defK.ToStringEx(), "" + currentHero.powerUpConfig.defK.ToStringEx());
  54. heroAttributeDataList.Add(heroAttributeData);
  55. }
  56. if (currentHero.powerUpConfig.MPFactor != newHero.powerUpConfig.MPFactor)
  57. {
  58. HeroAttributeData heroAttributeData = new HeroAttributeData("神识上限",
  59. currentHero.powerUpConfig.ShenshiMax.ToStringEx(),
  60. "" + currentHero.powerUpConfig.ShenshiMax.ToStringEx());
  61. heroAttributeDataList.Add(heroAttributeData);
  62. }
  63. return heroAttributeDataList;
  64. }
  65. public static List<HeroAttributeData> GetHeroChageHeroAttributeData1(HeroInfo currentHero, HeroInfo newHero)
  66. {
  67. List<HeroAttributeData> heroAttributeDataList = new List<HeroAttributeData>();
  68. if (currentHero.powerUpConfig.ShenshiMax != newHero.powerUpConfig.ShenshiMax)
  69. {
  70. HeroAttributeData heroAttributeData = new HeroAttributeData("神识上限",
  71. currentHero.powerUpConfig.ShenshiMax.ToStringEx(),
  72. newHero.powerUpConfig.ShenshiMax - currentHero.powerUpConfig.ShenshiMax + "");
  73. heroAttributeDataList.Add(heroAttributeData);
  74. }
  75. if (currentHero.hp != newHero.hp)
  76. {
  77. HeroAttributeData heroAttributeData = new HeroAttributeData("生命", currentHero.hp.Value.ToStringEx(),
  78. (newHero.hp.Value - currentHero.hp.Value).ToStringEx() + "");
  79. heroAttributeDataList.Add(heroAttributeData);
  80. }
  81. if (currentHero.attack != newHero.attack)
  82. {
  83. HeroAttributeData heroAttributeData = new HeroAttributeData("攻击", currentHero.attack.Value.ToStringEx(),
  84. (newHero.attack.Value - currentHero.attack.Value).ToStringEx());
  85. heroAttributeDataList.Add(heroAttributeData);
  86. }
  87. if (currentHero.defense != newHero.defense)
  88. {
  89. HeroAttributeData heroAttributeData = new HeroAttributeData("防御",
  90. currentHero.defense.Value.ToStringEx(),
  91. (newHero.defense.Value - currentHero.defense.Value).ToStringEx() + "");
  92. heroAttributeDataList.Add(heroAttributeData);
  93. }
  94. if (currentHero.powerUpConfig.MPFactor != newHero.powerUpConfig.MPFactor)
  95. {
  96. HeroAttributeData heroAttributeData = new HeroAttributeData("法宝倍率",
  97. currentHero.powerUpConfig.MPFactor.ToString(),
  98. currentHero.powerUpConfig.MPFactor - currentHero.powerUpConfig.MPFactor + "");
  99. heroAttributeDataList.Add(heroAttributeData);
  100. }
  101. if (currentHero.powerUpConfig.MPFactor != newHero.powerUpConfig.MPFactor)
  102. {
  103. HeroAttributeData heroAttributeData = new HeroAttributeData("护盾倍率",
  104. currentHero.powerUpConfig.HudunFactor.ToString(),
  105. currentHero.powerUpConfig.HudunFactor - currentHero.powerUpConfig.HudunFactor + "");
  106. heroAttributeDataList.Add(heroAttributeData);
  107. }
  108. if (currentHero.powerUpConfig.MPFactor != newHero.powerUpConfig.MPFactor)
  109. {
  110. HeroAttributeData heroAttributeData = new HeroAttributeData("防御系数K",
  111. currentHero.powerUpConfig.defK.ToStringEx(),
  112. (currentHero.powerUpConfig.defK - currentHero.powerUpConfig.defK).ToStringEx() + "");
  113. heroAttributeDataList.Add(heroAttributeData);
  114. }
  115. if (currentHero.powerUpConfig.MPFactor != newHero.powerUpConfig.MPFactor)
  116. {
  117. HeroAttributeData heroAttributeData = new HeroAttributeData("神识上限",
  118. currentHero.powerUpConfig.ShenshiMax.ToStringEx(),
  119. (currentHero.powerUpConfig.ShenshiMax - currentHero.powerUpConfig.ShenshiMax).ToStringEx() + "");
  120. heroAttributeDataList.Add(heroAttributeData);
  121. }
  122. return heroAttributeDataList;
  123. }
  124. public static float GetHeroExp()
  125. {
  126. int currentMiao = (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime) / 1000);
  127. float allexp = currentMiao * PlayerManager.Instance.myHero.powerUpConfig.AutoXiuwei;
  128. return allexp;
  129. }
  130. }
  131. }