From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/Hero/HeroInfo.Talent.cs |  168 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 141 insertions(+), 27 deletions(-)

diff --git a/Main/System/Hero/HeroInfo.Talent.cs b/Main/System/Hero/HeroInfo.Talent.cs
index 4e5108d..95e3128 100644
--- a/Main/System/Hero/HeroInfo.Talent.cs
+++ b/Main/System/Hero/HeroInfo.Talent.cs
@@ -7,30 +7,81 @@
 {
 
 	public int heroStar
-    {
-        get
-        {
-            if (itemHero == null)
-                return 0;
-            return itemHero.GetUseDataFirstValue(72);
-        }
-    }
-	
-	public List<HeroTalentInfo> talentList = new List<HeroTalentInfo>();
+	{
+		get
+		{
+			// 鍥犱负瑙夐啋闄嶄綆浜嗘槦绾э紝瀹㈡埛绔嚜宸遍檷浣庢槦绾�
+			if (itemHero == null)
+				return 0;
 
+			return Math.Min(GetCurMaxStar(), heroStarMaxBefore);
+		}
+	}
+
+	// 鍥犱负瑙夐啋闄嶄綆浜嗘槦绾э紝淇濈暀鍘嗗彶鏈�澶ф槦绾�
+	public int heroStarMaxBefore
+	{
+		get
+		{
+			if (itemHero == null)
+				return 0;
+			return itemHero.GetUseDataFirstValue(72);
+		}
+	}
+
+	// 71 # 鑻遍泟澶╄祴ID鍒楄〃
+	public List<int> talentIDList
+	{
+		get
+		{
+			if (itemHero == null)
+				return new List<int>();
+			return itemHero.GetUseData(71);
+		}
+	}
+
+	// 73 # 鑻遍泟澶╄祴ID绛夌骇鍒楄〃锛屽搴�71澶╄祴ID鐨勭瓑绾�
+	public List<int> talentLvList
+	{
+		get
+		{
+			if (itemHero == null)
+				return new List<int>();
+			return itemHero.GetUseData(73);
+		}
+	}
+
+	// 75 # 鑻遍泟澶╄祴娲楃偧閿佸畾绱㈠紩鍒楄〃锛屽搴�71澶╄祴ID绱㈠紩
+	// 娲楃偧閿佸畾瀹㈡埛绔紦瀛樹负鍑嗭紝閲嶇櫥浼氭竻闄わ紝濡傛灉闇�瑕侀噸鐧绘樉绀洪攣瀹氬垯鍐嶅鐞�
+	// 瀛樺偍鐨勬槸绱㈠紩涓嶆槸 鏄惁閿佸畾
+	public List<int> talentLockList = new List<int>();
+
+	// 77 # 鑻遍泟澶╄祴娲楃偧闅忔満ID鍒楄〃
+	public List<int> talentRandomIDList
+	{
+		get
+		{
+			if (itemHero == null)
+				return new List<int>();
+			return itemHero.GetUseData(77);
+		}
+	}
+
+	// 79 # 鑻遍泟瑙夐啋鏃堕殢鏈哄ぉ璧嬮�夐」ID鍒楄〃
+	public List<int> talentAwakeRandomIDList
+	{
+		get
+		{
+			if (itemHero == null)
+				return new List<int>();
+			return itemHero.GetUseData(79);
+		}
+	}
 
 	Dictionary<int, int> talentAttrDic = new Dictionary<int, int>();   //灞炴�D : 澶╄祴灞炴�у��
-																	   // 71 # 鑻遍泟澶╄祴ID鍒楄〃
-																	   // 73 # 鑻遍泟澶╄祴ID绛夌骇鍒楄〃锛屽搴�71澶╄祴ID鐨勭瓑绾�
-																	   // 75 # 鑻遍泟澶╄祴娲楃偧閿佸畾绱㈠紩鍒楄〃锛屽搴�71澶╄祴ID绱㈠紩
-																	   // 77 # 鑻遍泟澶╄祴娲楃偧闅忔満ID鍒楄〃
-																	   // 79 # 鑻遍泟瑙夐啋鏃堕殢鏈哄ぉ璧嬮�夐」ID鍒楄〃
+
 	protected void RefreshTalentAttr()
 	{
-		// 71 # 鑻遍泟澶╄祴ID鍒楄〃
-		List<int> talentIDList = itemHero.GetUseData(71);
-		// // 73 # 鑻遍泟澶╄祴ID绛夌骇鍒楄〃锛屽搴�71澶╄祴ID鐨勭瓑绾�
-		List<int> talentLvList = itemHero.GetUseData(73);
 		talentAttrDic.Clear();
 
 		for (int i = 0; i < talentIDList.Count; i++)
@@ -46,7 +97,7 @@
 				talentAttrDic[config.AttrID] = config.AttrValue * talentLvList[i];
 			}
 			else
-			{ 
+			{
 				talentAttrDic[config.AttrID] += config.AttrValue * talentLvList[i];
 			}
 		}
@@ -61,13 +112,76 @@
 	}
 
 	public int GetTalentAttrPer(int attrType)
-	{ 
-        if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
-        {
-            var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType];
-            return talentAttrDic.ContainsKey(pertype) ? talentAttrDic[pertype] : 0;
-        }
-        return 0;
+	{
+		if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
+		{
+			var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType];
+			return talentAttrDic.ContainsKey(pertype) ? talentAttrDic[pertype] : 0;
+		}
+		return 0;
+	}
+
+
+	//澶╄祴浼氭洿蹇埌杈炬弧绾э紱瑙夐啋鍙互鎻愬崌鏄熶笂闄�,濡傚垵濮嬫椂40婊℃槦锛岃閱扻绾у悗50婊℃槦
+	//鍒ゆ柇褰撳墠鏄惁婊℃槦
+	public bool IsFullStar()
+	{
+		return heroStar >= GetCurMaxStar();
+	}
+
+	//褰撳墠鑳借揪鍒扮殑鏈�澶ф槦绾�
+	public int GetCurMaxStar()
+	{
+		if (HeroAwakeConfig.GetHeroAwakeConfig(heroId, 1) == null)
+		{
+			return HeroQualityConfig.Get(Quality).InitStarUpper;
+		}
+		//鏍规嵁瑙夐啋绱鎻愬崌鏄熶笂闄�
+		int addStarCount = 0;
+		for (int i = 1; i <= awakeLevel; i++)
+		{
+			addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroId, i).AddStarUpper;
+		}
+		return HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount;
+	}
+
+	public bool IsFullGift()
+	{
+		//妫�鏌alentLvList 鎵�鏈夊厓绱犻兘澶т簬绛変簬10
+		return talentLvList.All(x => x >= HeroUIManager.Instance.maxGiftLevel);
+	}
+
+
+
+	public int GetTalentLockCount()
+	{
+		return talentLockList.Count;
+	}
+
+	//璁剧疆鏄惁閿佸畾锛屽彧瀛樺偍閿佸畾鐨勭储寮�
+	public void SetTalentLockState(int lockIndex, int state)
+	{
+		var index = talentLockList.IndexOf(lockIndex);
+
+		if (state == 1)
+		{
+			if (index < 0)
+			{
+				talentLockList.Add(lockIndex);
+			}
+			return;
+		}
+
+		if (state == 0)
+		{ 
+			if (index >= 0)
+			{
+				talentLockList.RemoveAt(index);
+			}
+			return;
+		}
+
+
 	}
 
 }

--
Gitblit v1.8.0