From b0a5d4688f1af73b5ad03ccc2df11c9aac1523a9 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期二, 29 七月 2025 16:56:23 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/Hero/HeroInfo.cs |  181 ++++++++++++++++-----------------------------
 1 files changed, 64 insertions(+), 117 deletions(-)

diff --git a/Main/System/Hero/HeroInfo.cs b/Main/System/Hero/HeroInfo.cs
index 9e36344..a480fbf 100644
--- a/Main/System/Hero/HeroInfo.cs
+++ b/Main/System/Hero/HeroInfo.cs
@@ -2,39 +2,15 @@
 using UnityEngine;
 using LitJson;
 
+//  姝﹀皢淇℃伅锛氬疄闄呰幏寰楃殑姝﹀皢锛屼笉鍖呭惈鍥鹃壌鏁版嵁
 public partial class HeroInfo
 {
-    //  姝﹀皢鏈嶅姟鍣ㄥ敮涓�ID
-    public long sid;
-
     //  姝﹀皢閰嶇疆琛↖D
-    public int heroId
-    {
-        get
-        {
-            #if UNITY_EDITOR
-            if (null == itemHero)
-            {
-                return 520001;
-            }
-            #endif
+    public int heroId;
 
-            return itemHero.config.ID;
-        }
-    }
-
-    //  姝﹀皢绛夌骇
-    public int heroLevel;
-
-    //  姝﹀皢鏄熺骇
-    public int heroStar;
-
-    //  姝﹀皢绐佺牬绛夌骇
-    public int breakLevel;
-
-    //  姝﹀皢瑙夐啋绛夌骇
-    public int awakeLevel;
-
+    //  姝﹀皢閰嶇疆
+    public HeroConfig heroConfig;
+    public ItemModel itemHero;  //寮曠敤鑳屽寘閲岀殑 鏁版嵁鍚屾
 
     public HeroCountry heroCountry
     {
@@ -44,120 +20,87 @@
         }
     }
 
-    public int Quality
+
+    // 浼樺厛鍔熻兘鎻愰啋绫诲瀷锛�1瑙夐啋 2鍗囩骇 3绐佺牬 4鍗囨槦
+    // 浼樺厛椤哄簭锛�
+    public int funcState
     {
         get
         {
-            return heroConfig.Quality;
+            return 0;
         }
     }
 
-    public ItemModel itemHero;
+    public bool isLock
+    {
+        get
+        {
+            return itemHero.itemInfo.isLock;
+        }
+    }
 
-    // public readonly CB122_tagSCHeroInfo.tagSCHero scHeroInfo;
 
-    //  姝﹀皢閰嶇疆
-    public HeroConfig heroConfig;
-    //  瑙夐啋閰嶇疆
-    public HeroAwakeConfig awakeConfig;
-    //  绐佺牬閰嶇疆
-    public HeroBreakConfig breakConfig;
-    //  缇佺粖閰嶇疆
-    public HeroFetterConfig fetterConfig;
-    //  鍝佽川瑙夐啋閰嶇疆
-    public HeroQualityAwakeConfig qualityAwakeConfig;
-    //  鍝佽川閰嶇疆
-    public HeroQualityConfig qualityConfig;
-    //  鍝佽川绐佺牬閰嶇疆
-    public HeroQualityBreakConfig qualityBreakConfig;
 
     public List<HeroFetterInfo> fetterInfoList = new List<HeroFetterInfo>();
     public List<HeroTalentInfo> talentList = new List<HeroTalentInfo>();
 
 
-    public HeroInfo(/*CB122_tagSCHeroInfo.tagSCHero _scHeroInfo, */ItemModel _itemHero)
+    public HeroInfo(ItemModel _itemHero)
     {
-        // scHeroInfo = _scHeroInfo;
         UpdateHero(_itemHero);
-        
-
-        
     }
 
-    #if UNITY_EDITOR
+#if UNITY_EDITOR
     public HeroInfo()
     {
-        heroLevel = 1;
-        heroStar = 1;
-        breakLevel = 1;
-        awakeLevel = 1;
-        SkinIndex = 0;
+        heroId = 520001; // 榛樿鑻遍泟ID
+
         heroConfig = HeroConfig.Get(heroId);
-        awakeConfig = HeroAwakeConfig.GetHeroAwakeConfig(heroId, awakeLevel);
-        breakConfig = HeroBreakConfig.GetHeroBreakConfig(heroId, breakLevel);
-        qualityAwakeConfig = HeroQualityAwakeConfig.GetQualityAwakeConfig(Quality, awakeLevel);
         qualityConfig = HeroQualityConfig.Get(Quality);
         qualityBreakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(Quality, awakeLevel);
         CalculateProperties();
     }
-    #endif
+#endif
 
-    // public HeroInfo Clone() => JsonMapper.ToObject<HeroInfo>(JsonMapper.ToJson(this));
-
-    //  鍥鹃壌淇℃伅
-    public void UpdateSCHero(CB122_tagSCHeroInfo.tagSCHero _scHeroInfo)
-    {
-
-    }
 
     public void UpdateHero(ItemModel _itemHero)
     {
         itemHero = _itemHero;
         // HeroConfigUtility
+        heroId = itemHero.config.ID;
 
-        // 70 # 鑻遍泟绛夌骇
-        heroLevel = itemHero.GetUseData(70)[0];
-        // 72 # 鑻遍泟鏄熺骇
-        heroStar = itemHero.GetUseData(72)[0];
-        // 74 # 鑻遍泟绐佺牬绛夌骇
-        breakLevel = itemHero.GetUseData(74)[0];
-        // 76 # 鑻遍泟瑙夐啋绛夌骇
-        awakeLevel = itemHero.GetUseData(76)[0];
-        // 78 # 鑻遍泟浣跨敤鐨勭毊鑲ょ储寮�
-        SkinIndex = itemHero.GetUseData(78)[0];
-
-
-        // 71 # 鑻遍泟澶╄祴ID鍒楄〃
-        List<int> talentSkillList = itemHero.GetUseData(71);
-        // 73 # 鑻遍泟澶╄祴ID绛夌骇鍒楄〃锛屽搴�71澶╄祴ID鐨勭瓑绾�
-        List<int> talentLvList = itemHero.GetUseData(73);
-        // 75 # 鑻遍泟澶╄祴娲楃偧閿佸畾绱㈠紩鍒楄〃锛屽搴�71澶╄祴ID绱㈠紩
-        List<int> talentLockList = itemHero.GetUseData(75);
 
         InitConfigs();
+        // 71 # 鑻遍泟澶╄祴ID鍒楄〃
+        // List<int> talentSkillList = itemHero.GetUseData(71);
+        // // 73 # 鑻遍泟澶╄祴ID绛夌骇鍒楄〃锛屽搴�71澶╄祴ID鐨勭瓑绾�
+        // List<int> talentLvList = itemHero.GetUseData(73);
+        // // 75 # 鑻遍泟澶╄祴娲楃偧閿佸畾绱㈠紩鍒楄〃锛屽搴�71澶╄祴ID绱㈠紩
+        // List<int> talentLockList = itemHero.GetUseData(75);
 
-        if (talentLockList.Count != talentLvList.Count || talentLvList.Count != talentSkillList.Count)
-        {
-            Debug.LogError("澶╄祴ID鍒楄〃鍙婂悗缁殑鏁版嵁鏁伴噺娌″涓�");
-        }
 
-        //  澶╄祴
-        talentList.Clear();
-        for (int i = 0; i < talentSkillList.Count; i++)
-        {
-            talentList.Add(new HeroTalentInfo(this, talentSkillList[i], talentLvList[i], talentLockList[i]));
-        }
+        // if (talentLockList.Count != talentLvList.Count || talentLvList.Count != talentSkillList.Count)
+        // {
+        //     Debug.LogError("澶╄祴ID鍒楄〃鍙婂悗缁殑鏁版嵁鏁伴噺娌″涓�");
+        // }
 
-        //  缇佺粖
-        fetterInfoList.Clear();
-        for (int i = 0; i < heroConfig.FetterIDList.Length; i++)
-        {
-            fetterInfoList.Add(new HeroFetterInfo(this, heroConfig.FetterIDList[i]));
-        }
+        // //  澶╄祴
+        // talentList.Clear();
+        // for (int i = 0; i < talentSkillList.Count; i++)
+        // {
+        //     talentList.Add(new HeroTalentInfo(this, talentSkillList[i], talentLvList[i], talentLockList[i]));
+        // }
 
-// 77 # 鑻遍泟澶╄祴娲楃偧闅忔満ID鍒楄〃
-// 79 # 鑻遍泟瑙夐啋鏃堕殢鏈哄ぉ璧嬮�夐」ID鍒楄〃
-// 80 # 涓婚樀鍨嬩笂闃典綅缃�
+        // //  缇佺粖
+        // fetterInfoList.Clear();
+        // for (int i = 0; i < heroConfig.FetterIDList.Length; i++)
+        // {
+        //     fetterInfoList.Add(new HeroFetterInfo(this, heroConfig.FetterIDList[i]));
+        // }
+
+        // 77 # 鑻遍泟澶╄祴娲楃偧闅忔満ID鍒楄〃
+        // 79 # 鑻遍泟瑙夐啋鏃堕殢鏈哄ぉ璧嬮�夐」ID鍒楄〃
+        // 80 # 涓婚樀鍨嬩笂闃典綅缃�
     }
 
     protected void InitConfigs()
@@ -165,17 +108,6 @@
         //  姝﹀皢閰嶇疆
         heroConfig = HeroConfig.Get(heroId);
 
-        //  瑙夐啋閰嶇疆 (婊$骇涓虹┖)
-        awakeConfig = HeroAwakeConfig.GetHeroAwakeConfig(heroId, awakeLevel);
-
-        //  绐佺牬閰嶇疆
-        breakConfig = HeroBreakConfig.GetHeroBreakConfig(heroId, breakLevel);
-
-        //  缇佺粖閰嶇疆 鍙兘闇�瑕乫etterid 鍘绘绱㈡晥鐜囧お浣�
-        // fetterConfig;
-
-        //  鍝佽川瑙夐啋閰嶇疆
-        qualityAwakeConfig = HeroQualityAwakeConfig.GetQualityAwakeConfig(Quality, awakeLevel);
 
         //  鍝佽川閰嶇疆
         qualityConfig = HeroQualityConfig.Get(Quality);
@@ -189,4 +121,19 @@
     {
         return heroConfig.GetInheritPercent(attrType);
     }
+    
+    //鏄惁涓妜闃� 81 # 鎵�鍦ㄩ樀瀹逛俊鎭垪琛� [闃靛绫诲瀷*10000+闃靛瀷绫诲瀷*100+浣嶇疆缂栧彿, ...]
+    public bool IsInTeamByTeamType(TeamType teamType)
+    {
+        var list = itemHero.GetUseData(81);
+        if (list != null && list.Count > 0)
+        {
+            var index = list.FindIndex((item) => item / 10000 == (int)teamType);
+            if (index >= 0)
+            {
+                return true;
+            }
+        }
+        return false;
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0