hch
2025-11-25 f9f2711f44e45021b4d69ca701bd25704578eef4
121 【武将】武将系统 - 同步武将升级增加固定属性
5个文件已修改
89 ■■■■■ 已修改文件
Main/Config/Configs/HeroQualityLVConfig.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroTrainAddAttrCell.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroTrainWin.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/FightPowerManager.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/HeroQualityLVConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           2025年8月5日
//    [  Date ]:           Tuesday, November 25, 2025
//--------------------------------------------------------
using System.Collections.Generic;
@@ -20,6 +20,8 @@
    public int Quality;
    public int HeroLV;
    public int[] UPCostItem;
    public int[] AttrIDList;
    public int[] AttrValueList;
    public override int LoadKey(string _key)
    {
@@ -50,6 +52,34 @@
                     int.TryParse(UPCostItemStringArray[i],out UPCostItem[i]);
                }
            }
            if (tables[4].Contains("["))
            {
                AttrIDList = JsonMapper.ToObject<int[]>(tables[4]);
            }
            else
            {
                string[] AttrIDListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                AttrIDList = new int[AttrIDListStringArray.Length];
                for (int i=0;i<AttrIDListStringArray.Length;i++)
                {
                     int.TryParse(AttrIDListStringArray[i],out AttrIDList[i]);
                }
            }
            if (tables[5].Contains("["))
            {
                AttrValueList = JsonMapper.ToObject<int[]>(tables[5]);
            }
            else
            {
                string[] AttrValueListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                AttrValueList = new int[AttrValueListStringArray.Length];
                for (int i=0;i<AttrValueListStringArray.Length;i++)
                {
                     int.TryParse(AttrValueListStringArray[i],out AttrValueList[i]);
                }
            }
        }
        catch (Exception exception)
        {
Main/System/Hero/HeroInfo.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using UnityEngine;
using LitJson;
using System;
//  武将信息:实际获得的武将,不包含图鉴数据
public partial class HeroInfo
@@ -169,4 +170,29 @@
        GameNetSystem.Instance.SendInfo(pack);
    }
    public int GetHeroLVValue(int attrType)
    {
        var lvConfig = HeroQualityLVConfig.GetQualityLVConfig(Quality, heroLevel);
        var index = Array.IndexOf(lvConfig.AttrIDList, attrType);
        if (index == -1)
            return 0;
        return lvConfig.AttrValueList[index];
    }
    public int GetHeroLVPer(int attrType)
    {
        var _type = 0;
        if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
        {
            _type = PlayerPropertyConfig.baseAttr2perDict[attrType];
        }
        var lvConfig = HeroQualityLVConfig.GetQualityLVConfig(Quality, heroLevel);
        var index = Array.IndexOf(lvConfig.AttrIDList, _type);
        if (index == -1)
            return 0;
        return lvConfig.AttrValueList[index];
    }
}
Main/System/HeroUI/HeroTrainAddAttrCell.cs
@@ -14,12 +14,21 @@
    [SerializeField] PositionTween addPerObject;
    
    public void Display(int value, Action func)
    public void Display(HeroInfo hero, Action func)
    {
        int value = hero.qualityConfig.LVAddPer;
        addPerObject.SetActive(true);
        var lvConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel + 1);
        var beforeLVConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel);
        for (int i = 0; i < addPerText.Length; i++)
        {
            addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], value);
            var addValue = lvConfig.AttrValueList[i] - beforeLVConfig.AttrValueList[i];
            string addString = "";
            if (addValue != 0)
            {
                addString = $"+{addValue}\n";
            }
            addPerText[i].text = addString + "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], value);
        }
        addPerObject.Play(() =>
        {
Main/System/HeroUI/HeroTrainWin.cs
@@ -196,6 +196,8 @@
        HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent;
        UIManager.Instance.OnCloseWindow += OnCloseWindow;
        TeamManager.Instance.OnTeamChange += TeamPosChangeEvent;
        PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
        guid = HeroUIManager.Instance.selectHeroGuid;
        hero = HeroManager.Instance.GetHero(guid);
        unfoldState = false;
@@ -211,6 +213,7 @@
        HeroManager.Instance.onHeroChangeEvent -= RefreshHeroEvent;
        UIManager.Instance.OnCloseWindow -= OnCloseWindow;
        TeamManager.Instance.OnTeamChange -= TeamPosChangeEvent;
        PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
    }
    private void OnCloseWindow(UIBase closeUI)
@@ -293,6 +296,17 @@
            return;
        lockImg.SetActive(hero.isLock);
        unLockImg.SetActive(!hero.isLock);
    }
    void RefreshItemEvent(PackType type, int index, int itemID)
    {
        if (type != PackType.Item)
            return;
        if (itemID != 7 && itemID != 8)
        {
            return;
        }
        RefreshAttr();
    }
    void RefreshHeroEvent(HeroInfo hero)
@@ -494,7 +508,7 @@
                lvupEffect.Play();
                var cell = RequestCell();
                cell.transform.localPosition = new Vector3(0, 0, 0);
                cell.Display(hero.qualityConfig.LVAddPer, () =>
                cell.Display(hero, () =>
                {
                    cell.SetActive(false);
                    ReturnCell(cell);
Main/System/Main/FightPowerManager.cs
@@ -311,6 +311,8 @@
        propertyVariables["awakeTalentPer"] = hero.GetAwakeAttrPer(attrType) / 10000.0f;
        propertyVariables["fetterValue"] = hero.GetFetterAttrValue(attrType);
        propertyVariables["fetterPer"] = hero.GetFetterAttrPer(attrType) / 10000.0f;
        propertyVariables["heroLVValue"] = hero.GetHeroLVValue(attrType);
        propertyVariables["heroLVPer"] = hero.GetHeroLVPer(attrType) / 10000.0f;
#if UNITY_EDITOR
        //排除值为0的属性输出