hch
2026-04-13 0aa7286a3b6329e43b6183c768a28a055974300b
614 子 【武将】升星优化 / 【武将】升星优化-客户端
13个文件已修改
166 ■■■■ 已修改文件
Main/Config/Configs/HeroConfig.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/HeroQualityBreakConfig.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/PartialConfigs/PlayerPropertyConfig.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/FirstCharge/FirstChargeHeroInfoWin.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.InheritPer.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroBestWin.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroGiftEatSuccessWin.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroGiftEatWin.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroLVBreakCell.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroTrainWin.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.Talent.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/FightPowerManager.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/HeroConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           2026年3月16日
//    [  Date ]:           2026年4月10日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -42,6 +42,9 @@
    public int[] TalentList;
    public int OpenCollectionDay;
    public int IsActLimit;
    public int AtkInheritPerStar;
    public int DefInheritPerStar;
    public int HPInheritPerStar;
    public override int LoadKey(string _key)
    {
@@ -152,6 +155,12 @@
            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)
        {
Main/Config/Configs/HeroQualityBreakConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           Tuesday, December 9, 2025
//    [  Date ]:           2026年4月10日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -21,6 +21,7 @@
    public int BreakLV;
    public int UPLVNeed;
    public int[][] UPCostItemList;
    public int UPLVNeedStar;
    public override int LoadKey(string _key)
    {
@@ -41,6 +42,8 @@
            int.TryParse(tables[3],out UPLVNeed); 
            UPCostItemList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]")); 
            int.TryParse(tables[5],out UPLVNeedStar);
        }
        catch (Exception exception)
        {
Main/Config/PartialConfigs/PlayerPropertyConfig.cs
@@ -107,6 +107,30 @@
        }
    }
    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}")
    {
Main/System/FirstCharge/FirstChargeHeroInfoWin.cs
@@ -37,9 +37,12 @@
        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++)
Main/System/Hero/HeroInfo.InheritPer.cs
@@ -12,17 +12,49 @@
            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;
    }
}
Main/System/HeroUI/HeroBestWin.cs
@@ -313,9 +313,12 @@
    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();
Main/System/HeroUI/HeroGiftEatSuccessWin.cs
@@ -12,6 +12,9 @@
    [SerializeField] Image[] beforeStars;
    [SerializeField] Image[] afterStars;
    [SerializeField] Text[] attrInheritPerNameArr;  //新增继承属性成长
    [SerializeField] Text[] attrInheritPerTextArr;
    [SerializeField] Text[] nextAttrInheritPerTextArr;
    [SerializeField] Text[] attrPerNameArr;
    [SerializeField] Text[] attrPerTextArr;
    [SerializeField] Text[] nextAttrPerTextArr;
@@ -49,7 +52,8 @@
        HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin);
        if (hero == null)
            return;
        hero.RefreshInheritPer();   //强制重刷
        int beforeStarCount = HeroUIManager.Instance.eatBeforeStar;
        int afterStarCount = hero.heroStar;
@@ -64,7 +68,18 @@
            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));
        }
        //天赋
Main/System/HeroUI/HeroGiftEatWin.cs
@@ -16,6 +16,7 @@
    [SerializeField] GiftBaseCell[] addGiftCells;
    [SerializeField] GameObject addTip;
    [SerializeField] GameObject addAttrGo;
    [SerializeField] Text[] addInheritAttrTexts;
    [SerializeField] Text[] addAttrTexts;
    [SerializeField] Text addGiftTip;
    [SerializeField] GameObject addNumGo;
@@ -82,10 +83,18 @@
            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())
@@ -157,7 +166,7 @@
        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()
        {
Main/System/HeroUI/HeroLVBreakCell.cs
@@ -144,7 +144,10 @@
        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()
Main/System/HeroUI/HeroTrainWin.cs
@@ -513,9 +513,12 @@
    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();
Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -97,7 +97,15 @@
        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)
Main/System/HeroUI/HeroUIManager.cs
@@ -238,6 +238,15 @@
            }
            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))
        {
            //突破等级已达最高级
Main/System/Main/FightPowerManager.cs
@@ -541,6 +541,7 @@
    public long CalculateTeamHeroPower(HeroInfo hero)
    {
        hero.RefreshFetterAttrsWhenCalcPower(teamTypeCalc); //羁绊属性要实时算
        hero.RefreshInheritPer();
        var Atk = GetPropertyVaule(6, hero);
        var Def = GetPropertyVaule(7, hero);