| | |
| | | |
| | | |
| | | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | |
| | | public partial class HeroInfo |
| | | { |
| | | // 羁绊配置 |
| | | public HeroFetterConfig fetterConfig; |
| | | public HeroFetterConfig fetterConfig; |
| | | |
| | | protected int GetIFByInheritFetterPercent(HeroAttrType attrType) |
| | | |
| | | public List<int> GetActiveFetter(HeroConfig config, TeamBase teamBase) |
| | | { |
| | | // YYL TODO |
| | | int total = 0; |
| | | for (int i = 0; i < fetterInfoList.Count; i++) |
| | | { |
| | | HeroFetterInfo fetterInfo = fetterInfoList[i]; |
| | | total += fetterInfo.GetFetterAttr(attrType); |
| | | } |
| | | return total; |
| | | } |
| | | List<int> list = new List<int>(); |
| | | if (config.FetterIDList.Length == 0) |
| | | return list; |
| | | |
| | | foreach (var fetterID in config.FetterIDList) |
| | | { |
| | | HeroFetterConfig fetterConfig = HeroFetterConfig.Get(fetterID); |
| | | int count = 0; |
| | | for (int i = 0; i < teamBase.tempHeroes.Length; i++) |
| | | { |
| | | TeamHero teamHero = teamBase.tempHeroes[i]; |
| | | |
| | | if (null == teamHero) |
| | | continue; |
| | | |
| | | if (fetterConfig.HeroIDList.Contains(teamHero.heroId)) |
| | | { |
| | | count++; |
| | | } |
| | | if (count >= fetterConfig.HeroIDList.Length) |
| | | { |
| | | list.Add(fetterID); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | } |