SkillInfo.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using Core.Utility;
  3. using Excel2Json;
  4. using Fort23.UTool;
  5. namespace GameLogic.Hero
  6. {
  7. public class SkillInfo
  8. {
  9. public long qiangDu;
  10. public SkillConfig skillConfig;
  11. public SkillPowerupConfig SkillPowerupConfig;
  12. public int index;
  13. public float[] effectValue;
  14. public AccountFileInfo.SkillData SkillData;
  15. public SkillInfo(int skill, int skillPowerup)
  16. {
  17. skillConfig = ConfigComponent.Instance.Get<SkillConfig>(skill);
  18. SkillPowerupConfig = ConfigComponent.Instance.Get<SkillPowerupConfig>(skillPowerup);
  19. if (skillConfig.ID != 0)
  20. {
  21. if (skillConfig.effectValue == null)
  22. {
  23. skillConfig.effectValue = new float[1];
  24. }
  25. effectValue = new float[skillConfig.effectValue.Length];
  26. Array.Copy(skillConfig.effectValue, effectValue, skillConfig.effectValue.Length);
  27. if (skillConfig.intensifierIndex != null)
  28. {
  29. for (int i = 0; i < skillConfig.intensifierIndex.Length; i++)
  30. {
  31. int index = skillConfig.intensifierIndex[i] - 1;
  32. if (index >= 0 && index < effectValue.Length)
  33. {
  34. effectValue[index] = effectValue[index] * SkillPowerupConfig.SkillPower1 * 0.01f;
  35. }
  36. }
  37. }
  38. }
  39. qiangDu = (long)(SkillPowerupConfig.MainPower * skillConfig.power);
  40. index = 0;
  41. }
  42. public void CustomInt(AccountFileInfo.SkillData skillId)
  43. {
  44. SkillData = skillId;
  45. skillConfig = ConfigComponent.Instance.Get<SkillConfig>(skillId.id * 10 + skillId.star - 1);
  46. SkillPowerupConfig = ConfigComponent.Instance.Get<SkillPowerupConfig>(skillId.level);
  47. if (skillConfig.effectValue != null)
  48. {
  49. effectValue = new float[skillConfig.effectValue.Length];
  50. Array.Copy(skillConfig.effectValue, effectValue, skillConfig.effectValue.Length);
  51. }
  52. else
  53. {
  54. LogTool.Error("找不到技能id:" + (skillId.id * 10 + skillId.star - 1));
  55. }
  56. if (skillConfig.intensifierIndex != null)
  57. {
  58. for (int i = 0; i < skillConfig.intensifierIndex.Length; i++)
  59. {
  60. int index = skillConfig.intensifierIndex[i] - 1;
  61. if (index >= 0 && index < effectValue.Length)
  62. {
  63. effectValue[index] = effectValue[index] * SkillPowerupConfig.SkillPower1 * 0.01f;
  64. }
  65. }
  66. }
  67. qiangDu = (long)(SkillPowerupConfig.MainPower * skillConfig.power);
  68. }
  69. public SkillInfo(AccountFileInfo.SkillData skillId)
  70. {
  71. CustomInt(skillId);
  72. index = 0;
  73. }
  74. }
  75. }