From 860fc1e3401f3eb581d8b8db3f3b4f43f83c55ed Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 10 九月 2025 12:23:32 +0800
Subject: [PATCH] 117 【武将】武将系统 - 觉醒后重生的逻辑
---
Main/System/Hero/HeroInfo.Talent.cs | 11 ++++++-----
Main/System/HeroUI/HeroUIManager.Talent.cs | 5 ++---
Main/System/HeroUI/HeroGiftWashWin.cs | 2 +-
Main/System/HeroUI/GiftBaseCell.cs | 41 ++++++++++++++++++++++++++++++++++++++---
4 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/Main/System/Hero/HeroInfo.Talent.cs b/Main/System/Hero/HeroInfo.Talent.cs
index 563e47d..95e3128 100644
--- a/Main/System/Hero/HeroInfo.Talent.cs
+++ b/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);
}
}
diff --git a/Main/System/HeroUI/GiftBaseCell.cs b/Main/System/HeroUI/GiftBaseCell.cs
index c7fcd0a..2e6eee9 100644
--- a/Main/System/HeroUI/GiftBaseCell.cs
+++ b/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 :浠h〃鐏拌壊闇�鍗囨槦婵�娲� -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>();
}
diff --git a/Main/System/HeroUI/HeroGiftWashWin.cs b/Main/System/HeroUI/HeroGiftWashWin.cs
index 0fe90d1..2df32d7 100644
--- a/Main/System/HeroUI/HeroGiftWashWin.cs
+++ b/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])
diff --git a/Main/System/HeroUI/HeroUIManager.Talent.cs b/Main/System/HeroUI/HeroUIManager.Talent.cs
index ba8af02..8302b51 100644
--- a/Main/System/HeroUI/HeroUIManager.Talent.cs
+++ b/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);
}
}
--
Gitblit v1.8.0