| | |
| | | { |
| | | |
| | | public int heroStar |
| | | { |
| | | get |
| | | { |
| | | if (itemHero == null) |
| | | return 0; |
| | | return itemHero.GetUseDataFirstValue(72); |
| | | } |
| | | } |
| | | |
| | | public List<HeroTalentInfo> talentList = new List<HeroTalentInfo>(); |
| | | { |
| | | get |
| | | { |
| | | if (itemHero == null) |
| | | return 0; |
| | | return itemHero.GetUseDataFirstValue(72); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 71 # 英雄天赋ID列表 |
| | | public List<int> talentIDList |
| | | { |
| | | get |
| | | { |
| | | if (itemHero == null) |
| | | return new List<int>(); |
| | | return itemHero.GetUseData(71); |
| | | } |
| | | } |
| | | |
| | | // 73 # 英雄天赋ID等级列表,对应71天赋ID的等级 |
| | | public List<int> talentLvList |
| | | { |
| | | get |
| | | { |
| | | if (itemHero == null) |
| | | return new List<int>(); |
| | | return itemHero.GetUseData(73); |
| | | } |
| | | } |
| | | |
| | | // 75 # 英雄天赋洗炼锁定索引列表,对应71天赋ID索引 |
| | | // 洗炼锁定客户端缓存为准,重登会清除,如果需要重登显示锁定则再处理 |
| | | // 存储的是索引不是 是否锁定 |
| | | public List<int> talentLockList = new List<int>(); |
| | | |
| | | // 77 # 英雄天赋洗炼随机ID列表 |
| | | public List<int> talentRandomIDList |
| | | { |
| | | get |
| | | { |
| | | if (itemHero == null) |
| | | 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 : 天赋属性值 |
| | | // 71 # 英雄天赋ID列表 |
| | | // 73 # 英雄天赋ID等级列表,对应71天赋ID的等级 |
| | | // 75 # 英雄天赋洗炼锁定索引列表,对应71天赋ID索引 |
| | | // 77 # 英雄天赋洗炼随机ID列表 |
| | | // 79 # 英雄觉醒时随机天赋选项ID列表 |
| | | |
| | | protected void RefreshTalentAttr() |
| | | { |
| | | // 71 # 英雄天赋ID列表 |
| | | List<int> talentIDList = itemHero.GetUseData(71); |
| | | // // 73 # 英雄天赋ID等级列表,对应71天赋ID的等级 |
| | | List<int> talentLvList = itemHero.GetUseData(73); |
| | | talentAttrDic.Clear(); |
| | | |
| | | for (int i = 0; i < talentIDList.Count; i++) |
| | |
| | | talentAttrDic[config.AttrID] = config.AttrValue * talentLvList[i]; |
| | | } |
| | | else |
| | | { |
| | | { |
| | | talentAttrDic[config.AttrID] += config.AttrValue * talentLvList[i]; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | public int GetTalentAttrPer(int attrType) |
| | | { |
| | | if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType)) |
| | | { |
| | | var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType]; |
| | | return talentAttrDic.ContainsKey(pertype) ? talentAttrDic[pertype] : 0; |
| | | } |
| | | return 0; |
| | | { |
| | | if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType)) |
| | | { |
| | | var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType]; |
| | | return talentAttrDic.ContainsKey(pertype) ? talentAttrDic[pertype] : 0; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | //天赋会更快到达满级;觉醒可以提升星上限,如初始时40满星,觉醒X级后50满星 |
| | | //判断当前是否满星 |
| | | public bool IsFullStar() |
| | | { |
| | | if (HeroAwakeConfig.GetHeroAwakeConfig(heroId, 1) == null) |
| | | { |
| | | 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; |
| | | } |
| | | |
| | | public bool IsFullGift() |
| | | { |
| | | //检查talentLvList 所有元素都大于等于10 |
| | | return talentLvList.All(x => x >= HeroUIManager.Instance.maxGiftLevel); |
| | | } |
| | | |
| | | |
| | | |
| | | public int GetTalentLockCount() |
| | | { |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |