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 |  183 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 179 insertions(+), 4 deletions(-)

diff --git a/Main/System/Hero/HeroInfo.Talent.cs b/Main/System/Hero/HeroInfo.Talent.cs
index f66f6b7..95e3128 100644
--- a/Main/System/Hero/HeroInfo.Talent.cs
+++ b/Main/System/Hero/HeroInfo.Talent.cs
@@ -1,12 +1,187 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
 
-
-
+//姝﹀皢澶╄祴锛氬崌鏄熻幏寰楀ぉ璧嬶紝鍙礂缁�
 public partial class HeroInfo
 {
-	protected int GetIFByInheritTalentPercent(HeroAttrType attrType)
+
+	public int heroStar
 	{
-		//	YYL TODO
+		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 : 澶╄祴灞炴�у��
+
+	protected void RefreshTalentAttr()
+	{
+		talentAttrDic.Clear();
+
+		for (int i = 0; i < talentIDList.Count; i++)
+		{
+			if (talentIDList[i] == 0)
+			{
+				continue;
+			}
+			var config = HeroTalentConfig.Get(talentIDList[i]);
+			if (!talentAttrDic.ContainsKey(config.AttrID))
+			{
+				//澶╄祴灞炴�э紝鍊�*澶╄祴绛夌骇
+				talentAttrDic[config.AttrID] = config.AttrValue * talentLvList[i];
+			}
+			else
+			{
+				talentAttrDic[config.AttrID] += config.AttrValue * talentLvList[i];
+			}
+		}
+
+	}
+
+	public int GetTalentAttrValue(int attrType)
+	{
+		int value = 0;
+		talentAttrDic.TryGetValue(attrType, out value);
+		return value;
+	}
+
+	public int GetTalentAttrPer(int attrType)
+	{
+		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