614 子 【武将】升星优化 / 【武将】升星优化-客户端
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2026年3月16日
|
| | | // [ Date ]: 2026年4月10日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int[] TalentList;
|
| | | public int OpenCollectionDay;
|
| | | public int IsActLimit;
|
| | | public int AtkInheritPerStar;
|
| | | public int DefInheritPerStar;
|
| | | public int HPInheritPerStar;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | | int.TryParse(tables[24],out OpenCollectionDay);
|
| | |
|
| | | int.TryParse(tables[25],out IsActLimit);
|
| | |
|
| | | int.TryParse(tables[26],out AtkInheritPerStar); |
| | |
|
| | | int.TryParse(tables[27],out DefInheritPerStar); |
| | |
|
| | | int.TryParse(tables[28],out HPInheritPerStar); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: Tuesday, December 9, 2025
|
| | | // [ Date ]: 2026年4月10日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int BreakLV;
|
| | | public int UPLVNeed;
|
| | | public int[][] UPCostItemList;
|
| | | public int UPLVNeedStar;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | | int.TryParse(tables[3],out UPLVNeed);
|
| | |
|
| | | UPCostItemList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]"));
|
| | |
|
| | | int.TryParse(tables[5],out UPLVNeedStar); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | } |
| | | } |
| | | |
| | | public static string GetFullDescriptionOrgName(int id, long value, string format="{0}+{1}") |
| | | { |
| | | var config = Get(id); |
| | | if (config == null) |
| | | { |
| | | return string.Empty; |
| | | } |
| | | |
| | | if (config.Name.Contains("%s")) |
| | | { |
| | | // if (id == 52) |
| | | // { |
| | | // return Regex.Replace(config.ShowName, "%s", (value * 0.0001f).ToString("f2")); |
| | | // } |
| | | // else |
| | | { |
| | | return Regex.Replace(config.Name, "%s", value.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return string.Format(format, config.Name, GetValueDescription(id, value)); |
| | | } |
| | | } |
| | | //基础属性描述 |
| | | public static string GetBaseFullDescription(int id, long value, string format = "{0}+{1}") |
| | | { |
| | |
| | | ItemInfo itemInfo = new ItemInfo(); |
| | | itemInfo.itemId = FirstChargeManager.Instance.heroItemID; |
| | | HeroInfo heroInfo = new HeroInfo(new ItemModel(PackType.Item, itemInfo)); |
| | | txtInheritAttr[0].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[0], heroInfo.heroConfig.AtkInheritPer)); |
| | | txtInheritAttr[1].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[1], heroInfo.heroConfig.DefInheritPer)); |
| | | txtInheritAttr[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], heroInfo.heroConfig.HPInheritPer)); |
| | | txtInheritAttr[0].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[0], |
| | | HeroUIManager.Instance.GetMaxInheritAttr(PlayerPropertyConfig.inheritAttrs[0], heroInfo.heroId, heroInfo.Quality, heroInfo.heroConfig))); |
| | | txtInheritAttr[1].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[1], |
| | | HeroUIManager.Instance.GetMaxInheritAttr(PlayerPropertyConfig.inheritAttrs[1], heroInfo.heroId, heroInfo.Quality, heroInfo.heroConfig))); |
| | | txtInheritAttr[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], |
| | | HeroUIManager.Instance.GetMaxInheritAttr(PlayerPropertyConfig.inheritAttrs[2], heroInfo.heroId, heroInfo.Quality, heroInfo.heroConfig))); |
| | | |
| | | int valuePer = heroInfo.GetFakeOnBattleAddPer(); |
| | | for (int i = 0; i < txtHeroAddAttrPer.Length; i++) |
| | |
| | | if (_inheritPer == null) |
| | | { |
| | | _inheritPer = new Dictionary<int, int>() { |
| | | { 6, heroConfig.AtkInheritPer }, |
| | | { 7, heroConfig.DefInheritPer }, |
| | | { 8, heroConfig.HPInheritPer }, |
| | | { 6, heroConfig.AtkInheritPer + heroConfig.AtkInheritPerStar * heroStar }, |
| | | { 7, heroConfig.DefInheritPer + heroConfig.DefInheritPerStar * heroStar}, |
| | | { 8, heroConfig.HPInheritPer + heroConfig.HPInheritPerStar * heroStar}, |
| | | }; |
| | | } |
| | | return _inheritPer; |
| | | } |
| | | } |
| | | |
| | | |
| | | public void RefreshInheritPer() |
| | | { |
| | | _inheritPer = null; |
| | | } |
| | | |
| | | //原来继承是按品通用,现在升星也会加继承,通过三维ID获取6,7,8 |
| | | public int GetInheritAttrPer(int attrType) |
| | | { |
| | | return inheritPer.TryGetValue(attrType, out int value) ? value : 0; |
| | | } |
| | | |
| | | //通过继承ID获取对应的万分率 |
| | | public int GetInheritAttrPerByInheritID(int id) |
| | | { |
| | | var baseID = id == 13 ? 6 : id == 14 ? 7 : id == 15 ? 8 : 0; |
| | | return GetInheritAttrPer(baseID); |
| | | } |
| | | // 获取继承ID |
| | | public int GetInheritAttrIDByBaseID(int id) |
| | | { |
| | | if (id == 6) return 13; |
| | | if (id == 7) return 14; |
| | | if (id == 8) return 15; |
| | | return 0; |
| | | } |
| | | |
| | | //获取每星提升属性值 万分率 |
| | | public int GetInheritSingleAttrValue(int id) |
| | | { |
| | | if (id == 13) return heroConfig.AtkInheritPerStar; |
| | | if (id == 14) return heroConfig.DefInheritPerStar; |
| | | if (id == 15) return heroConfig.HPInheritPerStar; |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | void RefreshAttr() |
| | | { |
| | | inheritAttrText[0].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[0], heroConfig.AtkInheritPer)); |
| | | inheritAttrText[1].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[1], heroConfig.DefInheritPer)); |
| | | inheritAttrText[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], heroConfig.HPInheritPer)); |
| | | inheritAttrText[0].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[0], |
| | | HeroUIManager.Instance.GetMaxInheritAttr(PlayerPropertyConfig.inheritAttrs[0], heroConfig.HeroID, heroConfig.Quality, heroConfig))); |
| | | inheritAttrText[1].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[1], |
| | | HeroUIManager.Instance.GetMaxInheritAttr(PlayerPropertyConfig.inheritAttrs[1], heroConfig.HeroID, heroConfig.Quality, heroConfig))); |
| | | inheritAttrText[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], |
| | | HeroUIManager.Instance.GetMaxInheritAttr(PlayerPropertyConfig.inheritAttrs[2], heroConfig.HeroID, heroConfig.Quality, heroConfig))); |
| | | |
| | | //上阵属性 |
| | | int valuePer = GetOnBattleAddPer(); |
| | |
| | | |
| | | [SerializeField] Image[] beforeStars; |
| | | [SerializeField] Image[] afterStars; |
| | | [SerializeField] Text[] attrInheritPerNameArr; //新增继承属性成长 |
| | | [SerializeField] Text[] attrInheritPerTextArr; |
| | | [SerializeField] Text[] nextAttrInheritPerTextArr; |
| | | [SerializeField] Text[] attrPerNameArr; |
| | | [SerializeField] Text[] attrPerTextArr; |
| | | [SerializeField] Text[] nextAttrPerTextArr; |
| | |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin); |
| | | if (hero == null) |
| | | return; |
| | | |
| | | hero.RefreshInheritPer(); //强制重刷 |
| | | |
| | | int beforeStarCount = HeroUIManager.Instance.eatBeforeStar; |
| | | int afterStarCount = hero.heroStar; |
| | | |
| | |
| | | int id = PlayerPropertyConfig.basePerAttrs[i]; |
| | | attrPerNameArr[i].text = PlayerPropertyConfig.Get(id).Name; |
| | | nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(id, valuePer); |
| | | attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(id, valuePer - hero.qualityConfig.StarAddPer*(afterStarCount - beforeStarCount)); |
| | | attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(id, valuePer - hero.qualityConfig.StarAddPer * (afterStarCount - beforeStarCount)); |
| | | } |
| | | |
| | | for (int i = 0; i < attrInheritPerNameArr.Length; i++) |
| | | { |
| | | int id = PlayerPropertyConfig.baseAttrs[i]; |
| | | var curValue = hero.GetInheritAttrPer(id); |
| | | var showID = hero.GetInheritAttrIDByBaseID(id); |
| | | attrInheritPerNameArr[i].text = PlayerPropertyConfig.Get(showID).Name; |
| | | nextAttrInheritPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(showID, curValue); |
| | | var addPer = hero.GetInheritSingleAttrValue(showID); |
| | | attrInheritPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(showID, curValue - addPer * (afterStarCount - beforeStarCount)); |
| | | } |
| | | |
| | | //天赋 |
| | |
| | | [SerializeField] GiftBaseCell[] addGiftCells; |
| | | [SerializeField] GameObject addTip; |
| | | [SerializeField] GameObject addAttrGo; |
| | | [SerializeField] Text[] addInheritAttrTexts; |
| | | [SerializeField] Text[] addAttrTexts; |
| | | [SerializeField] Text addGiftTip; |
| | | [SerializeField] GameObject addNumGo; |
| | |
| | | for (int i = 0; i < addAttrTexts.Length; i++) |
| | | { |
| | | int id = PlayerPropertyConfig.basePerAttrs[i]; |
| | | addAttrTexts[i].text = PlayerPropertyConfig.GetBaseFullDescription(id, hero.qualityConfig.StarAddPer, |
| | | addAttrTexts[i].text = PlayerPropertyConfig.GetBaseFullDescription(id, hero.qualityConfig.StarAddPer * HeroUIManager.Instance.selectEatHeroIndexList.Count, |
| | | "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}", true)); |
| | | } |
| | | addGiftTip.SetActive(!hero.IsFullGift()); |
| | | addGiftTip.text = Language.Get("HeroGift10") + HeroUIManager.Instance.selectEatHeroIndexList.Count; |
| | | |
| | | for (int i = 0; i < addInheritAttrTexts.Length; i++) |
| | | { |
| | | int id = PlayerPropertyConfig.baseAttrs[i]; |
| | | int showID = hero.GetInheritAttrIDByBaseID(id); |
| | | addInheritAttrTexts[i].text = PlayerPropertyConfig.GetFullDescriptionOrgName(showID, hero.GetInheritSingleAttrValue(showID) * HeroUIManager.Instance.selectEatHeroIndexList.Count, |
| | | "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}", true)); |
| | | } |
| | | } |
| | | |
| | | if (HeroUIManager.Instance.selectEatHeroIndexList.IsNullOrEmpty()) |
| | |
| | | HeroUIManager.Instance.heroBeforeGiftLevelList = new List<int>(hero.talentLvList); |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculateFightPower(false)); |
| | | HeroUIManager.Instance.eatBeforeStar = hero.heroStar; |
| | | |
| | | |
| | | //设置个等待回复的标识 显示成功界面 |
| | | HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse() |
| | | { |
| | |
| | | potentialText.text = Language.Get("L1100", Language.Get("herocard56"), string.Join("\n", attrStrArr)); |
| | | |
| | | string needLV = UIHelper.AppendColor(hero.heroLevel < hero.qualityBreakConfig.UPLVNeed ? TextColType.Red : TextColType.Green, $"{hero.heroLevel}/{hero.qualityBreakConfig.UPLVNeed}"); |
| | | needLVText.text = Language.Get("herobreak3", needLV); |
| | | |
| | | string needStar = UIHelper.AppendColor(hero.heroStar < hero.qualityBreakConfig.UPLVNeedStar ? TextColType.Red : TextColType.Green, $"{hero.heroStar}/{hero.qualityBreakConfig.UPLVNeedStar}"); |
| | | |
| | | needLVText.text = Language.Get("herobreak3", needLV) + (hero.qualityBreakConfig.UPLVNeedStar > 0 ? " " + Language.Get("HeroBreakStar") + needStar : string.Empty); |
| | | } |
| | | |
| | | void BreakLV() |
| | |
| | | |
| | | void RefreshAttr() |
| | | { |
| | | inheritAttrText[0].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[0], hero.heroConfig.AtkInheritPer)); |
| | | inheritAttrText[1].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[1], hero.heroConfig.DefInheritPer)); |
| | | inheritAttrText[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], hero.heroConfig.HPInheritPer)); |
| | | inheritAttrText[0].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[0], |
| | | hero.GetInheritAttrPerByInheritID(PlayerPropertyConfig.inheritAttrs[0]))); |
| | | inheritAttrText[1].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[1], |
| | | hero.GetInheritAttrPerByInheritID(PlayerPropertyConfig.inheritAttrs[1]))); |
| | | inheritAttrText[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], |
| | | hero.GetInheritAttrPerByInheritID(PlayerPropertyConfig.inheritAttrs[2]))); |
| | | |
| | | //上阵属性 |
| | | int valuePer = hero.GetAddPer(); |
| | |
| | | return HeroQualityConfig.Get(quality).InitStarUpper + addStarCount; |
| | | } |
| | | |
| | | |
| | | //用继承ID获得最大继承属性 |
| | | public int GetMaxInheritAttr(int id, int heroID, int quality, HeroConfig heroConfig) |
| | | { |
| | | var maxStar = GetMaxStarCount(heroID, quality); |
| | | if (id == 13) return heroConfig.AtkInheritPer + heroConfig.AtkInheritPerStar * maxStar; |
| | | if (id == 14) return heroConfig.DefInheritPer + heroConfig.DefInheritPerStar * maxStar; |
| | | if (id == 15) return heroConfig.HPInheritPer + heroConfig.HPInheritPerStar * maxStar; |
| | | return 0; |
| | | } |
| | | |
| | | //beforeGiftIDList用于对比变化的天赋格子 |
| | | public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero, List<int> beforeGiftIDList = null, List<int> beforeGiftLevelList = null) |
| | |
| | | } |
| | | return false; |
| | | } |
| | | if (hero.heroStar < HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel).UPLVNeedStar) |
| | | { |
| | | //星级未达标 |
| | | if (showTip != 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroStarNotEnough"); |
| | | } |
| | | return false; |
| | | } |
| | | if (hero.breakLevel >= HeroBreakConfig.GetMaxBreakLv(hero.heroId)) |
| | | { |
| | | //突破等级已达最高级 |
| | |
| | | public long CalculateTeamHeroPower(HeroInfo hero) |
| | | { |
| | | hero.RefreshFetterAttrsWhenCalcPower(teamTypeCalc); //羁绊属性要实时算 |
| | | hero.RefreshInheritPer(); |
| | | |
| | | var Atk = GetPropertyVaule(6, hero); |
| | | var Def = GetPropertyVaule(7, hero); |