hch
2025-09-10 860fc1e3401f3eb581d8b8db3f3b4f43f83c55ed
117 【武将】武将系统 - 觉醒后重生的逻辑
4个文件已修改
59 ■■■■ 已修改文件
Main/System/Hero/HeroInfo.Talent.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/GiftBaseCell.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroGiftWashWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.Talent.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Talent.cs
@@ -10,9 +10,11 @@
    {
        get
        {
            // 因为觉醒降低了星级,客户端自己降低星级
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(72);
            return Math.Min(GetCurMaxStar(), heroStarMaxBefore);
        }
    }
@@ -21,10 +23,9 @@
    {
        get
        {
            return heroStar;
            // if (itemHero == null)
            //     return 0;
            // return itemHero.GetUseDataFirstValue(74);
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(72);
        }
    }
Main/System/HeroUI/GiftBaseCell.cs
@@ -97,6 +97,19 @@
        }
    }
    Image m_AwakeLockImg;   //重生降低觉醒等级锁定的图片
    Image awakeLockImg
    {
        get
        {
            if (m_AwakeLockImg == null)
            {
                m_AwakeLockImg = this.transform.GetComponent<Image>("Container_GiftCell/lock");
            }
            return m_AwakeLockImg;
        }
    }
    void Awake()
@@ -106,7 +119,7 @@
    //showState 0:不显示 1:新增 2:提升
    //giftID 0 :代表灰色需升星激活 -1:代表棕色需觉醒激活,其他根据配表,没有天赋的外层控制显隐
    public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0, int heroID = 0, int index = 0)
    public void Init(int giftID, int lv, int showState = 0, int heroID = 0, int index = 0, int awakeLevel = 0)
    {
        LoadPrefab();   //存在被卸载的可能,重新加载
        if (HeroTalentConfig.HasKey(giftID))
@@ -121,6 +134,16 @@
            stateImg.SetActive(showState > 0);
            stateImg.SetSprite("GiftState" + showState);
            stateImg.SetNativeSize();
            //特殊处理重生降低觉醒等级锁定的天赋
            if (index >= HeroUIManager.Instance.normalGiftMaxCnt)
            {
                awakeLockImg.SetActive(HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index) > awakeLevel);
            }
            else
            {
                awakeLockImg.SetActive(false);
            }
        }
        else
        {
@@ -128,11 +151,12 @@
            giftName.text = string.Empty;
            lvRect.SetActive(false);
            stateImg.SetActive(false);
            awakeLockImg.SetActive(false);
        }
        giftBtn.AddListener(onclick != null ? onclick : () => { ShowSmallTip(giftID, lv, heroID, index); });
        giftBtn.AddListener(() => { ShowSmallTip(giftID, lv, heroID, index, awakeLevel); });
    }
    void ShowSmallTip(int giftID, int giftLV, int heroID, int index)
    void ShowSmallTip(int giftID, int giftLV, int heroID, int index, int awakeLevel)
    {
        SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
        if (giftID > 0)
@@ -140,6 +164,17 @@
            var giftConfig = HeroTalentConfig.Get(giftID);
            SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
            Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue*giftLV)));
            if (index >= HeroUIManager.Instance.normalGiftMaxCnt)
            {
                int needAwakeLV = HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index);
                if (needAwakeLV > awakeLevel)
                {
                    SmallTipWin.showText += "\n" + Language.Get("HeroAwake18", needAwakeLV);
                }
            }
            UIManager.Instance.OpenWindow<SmallTipWin>();
        }
Main/System/HeroUI/HeroGiftWashWin.cs
@@ -174,7 +174,7 @@
            afterGiftCells[i].SetActive(true);
            afterGiftCells[i].Init(hero.talentRandomIDList[i], hero.talentLvList[i]);
            afterGiftCells[i].Init(hero.talentRandomIDList[i], hero.talentLvList[i], 0, hero.heroId, i, hero.awakeLevel);
            //对比变化的天赋显示特效
            if (hero.talentRandomIDList[i] != hero.talentIDList[i])
Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -148,7 +148,7 @@
                    }
                }
                giftBaseCells[i].Init(giftID, giftLV, null, state);
                giftBaseCells[i].Init(giftID, giftLV, state, hero.heroId, i, hero.awakeLevel);
            }
            else
            {
@@ -166,8 +166,7 @@
                }
                else
                {
                    int index = i;
                    giftBaseCells[i].Init(-1, 0, null, 0, hero.heroId, index);
                    giftBaseCells[i].Init(-1, 0, 0, hero.heroId, i);
                }
            }