hch
2025-09-06 9216ab7322fa164abaa6f9089058746b34bd690a
Main/System/Hero/HeroInfo.Talent.cs
@@ -16,16 +16,14 @@
      }
   }
   // 75 # 英雄天赋洗炼锁定索引列表,对应71天赋ID索引
   // 77 # 英雄天赋洗炼随机ID列表
   // 79 # 英雄觉醒时随机天赋选项ID列表
   // 71 # 英雄天赋ID列表
   public List<int> talentIDList
   {
      get
      {
         if (itemHero == null)
            return null;
            return new List<int>();
         return itemHero.GetUseData(71);
      }
   }
@@ -36,22 +34,37 @@
      get
      {
         if (itemHero == null)
            return null;
            return new List<int>();
         return itemHero.GetUseData(73);
      }
   }
   // 75 # 英雄天赋洗炼锁定索引列表,对应71天赋ID索引
   public List<int> talentLockList
   // 洗炼锁定客户端缓存为准,重登会清除,如果需要重登显示锁定则再处理
   // 存储的是索引不是 是否锁定
   public List<int> talentLockList = new List<int>();
   // 77 # 英雄天赋洗炼随机ID列表
   public List<int> talentRandomIDList
   {
      get
      {
         if (itemHero == null)
            return null;
         return itemHero.GetUseData(75);
            return new List<int>();
         return itemHero.GetUseData(77);
      }
   }
   // 79 # 英雄觉醒时随机天赋选项ID列表
   public List<int> talentAwakeRandomIDList
   {
      get
      {
         if (itemHero == null)
            return new List<int>();
         return itemHero.GetUseData(79);
      }
   }
   Dictionary<int, int> talentAttrDic = new Dictionary<int, int>();   //属性ID : 天赋属性值
@@ -102,17 +115,17 @@
   public bool IsFullStar()
   {
      if (HeroAwakeConfig.GetHeroAwakeConfig(heroId, 1) == null)
        {
            return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper;
        }
      {
         return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper;
      }
        //根据觉醒累计提升星上限
        int addStarCount = 0;
        for (int i = 1; i <= awakeLevel; i++)
        {
            addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroId, i).AddStarUpper;
        }
        return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount;
      //根据觉醒累计提升星上限
      int addStarCount = 0;
      for (int i = 1; i <= awakeLevel; i++)
      {
         addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroId, i).AddStarUpper;
      }
      return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount;
   }
   public bool IsFullGift()
@@ -125,8 +138,33 @@
   public int GetTalentLockCount()
   {
      //talentLockList里的元素全部相加 1代表锁定 0代表未锁定
      return talentLockList.Sum();
      return talentLockList.Count;
   }
   //设置是否锁定,只存储锁定的索引
   public void SetTalentLockState(int lockIndex, int state)
   {
      var index = talentLockList.IndexOf(lockIndex);
      if (state == 1)
      {
         if (index < 0)
         {
            talentLockList.Add(lockIndex);
         }
         return;
      }
      if (state == 0)
      {
         if (index >= 0)
         {
            talentLockList.RemoveAt(index);
         }
         return;
      }
   }
}