FaBaoInfo.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Collections.Generic;
  3. using Excel2Json;
  4. using Fort23.UTool;
  5. namespace GameLogic.Hero
  6. {
  7. public class FaBaoInfo
  8. {
  9. /// <summary>
  10. /// 星级
  11. /// </summary>
  12. public int star;
  13. public FabaoConfig FabaoConfig;
  14. public FabaoPowerupConfig FabaoPowerupConfig;
  15. public SkillConfig SkillConfig;
  16. public float[] effectValue;
  17. public long qiangDu;
  18. public Dictionary<int, long> attriButedIC = new Dictionary<int, long>();
  19. public FaBaoInfo(int id, int powerupId, int start = 1)
  20. {
  21. star = 1;
  22. FabaoConfig = ConfigComponent.Instance.Get<FabaoConfig>(id);
  23. FabaoPowerupConfig = ConfigComponent.Instance.Get<FabaoPowerupConfig>(powerupId);
  24. SkillConfig = ConfigComponent.Instance.Get<SkillConfig>(FabaoConfig.SkillGroupID * 10 + start - 1);
  25. effectValue = new float[SkillConfig.effectValue.Length];
  26. Array.Copy(SkillConfig.effectValue, effectValue, SkillConfig.effectValue.Length);
  27. attriButedIC.Clear();
  28. //计算加得属性
  29. for (var i = 0; i < FabaoConfig.ShuxingIDs.Length; i++)
  30. {
  31. long attribute = GetAttriBute(FabaoConfig.ShuxingIDs[i]);
  32. long value = (long)(attribute * FabaoConfig.ShuxingPara[0] * 0.01f);
  33. attriButedIC.Add(FabaoConfig.ShuxingIDs[i], value);
  34. }
  35. qiangDu = (long)(FabaoPowerupConfig.Power * SkillConfig.power * 0.01f);
  36. }
  37. private long GetAttriBute(int type)
  38. {
  39. switch (type)
  40. {
  41. case 1:
  42. return FabaoPowerupConfig.HP;
  43. case 2:
  44. return FabaoPowerupConfig.HP;
  45. case 3:
  46. return FabaoPowerupConfig.HP;
  47. }
  48. return 0;
  49. }
  50. }
  51. }