From f4a702e212d1853735f8dae399da69d23bfa510e Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 18:16:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into h5version

---
 Main/System/HappyXB/HappyXBModel.cs |   84 +++++++++++++++++++++++++++++-------------
 1 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/Main/System/HappyXB/HappyXBModel.cs b/Main/System/HappyXB/HappyXBModel.cs
index 6e9ac4e..3a1df6c 100644
--- a/Main/System/HappyXB/HappyXBModel.cs
+++ b/Main/System/HappyXB/HappyXBModel.cs
@@ -19,11 +19,11 @@
     {
         get
         {
-            #if UNITY_EDITOR
+#if UNITY_EDITOR
             if (Time.time - xbLastTime > 1)
-            #else
+#else
             if (Time.time - xbLastTime > 10)
-            #endif
+#endif
             {
                 m_IsWaitServerXB = false;
                 return m_IsWaitServerXB;
@@ -37,7 +37,7 @@
             m_IsWaitServerXB = value;
             xbLastTime = Time.time;
         }
-    }  
+    }
     private Dictionary<int, XBTypeInfo> xbTypeInfoDict = new Dictionary<int, XBTypeInfo>(); //鎶藉鐘舵�佺浉鍏崇殑 鏈嶅姟鍣ㄨ褰�
 
     public int lhQuality;
@@ -134,6 +134,8 @@
     public int addXBScore { get; private set; }
     public int addXBScoreType { get; private set; } //瀵诲疂绉垎璐у竵绫诲瀷
     public int addXBLuckValue { get; private set; }
+    public int addXBAddItemID { get; private set; } // 鏈瀵诲疂棰濆璧犻�佺殑鐗╁搧ID
+    public long addXBItemCount { get; private set; }   // 鏈瀵诲疂棰濆璧犻�佺殑鐗╁搧ID涓暟
     public Dictionary<int, XBGetItem> xbResultDict { get; private set; } = new Dictionary<int, XBGetItem>(); //濂栧搧椤哄簭锛氬鍝�
     public void GetServerXBResult(HA350_tagMCTreasureResult result)
     {
@@ -142,6 +144,8 @@
         addXBScore = result.AddMoneyValue;
         addXBScoreType = result.AddMoneyType;
         addXBLuckValue = result.AddTreasureLuck;
+        addXBAddItemID = (int)result.AddItemID;
+        addXBItemCount = result.AddItemCount;
         JsonData resultData = JsonMapper.ToObject(result.TreasureResult);
         if (resultData.IsArray)
         {
@@ -180,11 +184,19 @@
                 UIManager.Instance.OpenWindowAsync<HeroCallResultWin>().Forget();
             }
         }
+
+        if (ActHeroAppearConfig.GetActTreasureTypeList().Contains(type))
+        {
+            if (!UIManager.Instance.IsOpened<HeroDebutCallResultWin>())
+            {
+                UIManager.Instance.OpenWindow<HeroDebutCallResultWin>();
+            }
+        }
     }
 
 
     public int GetCountInResult(int itemID)
-    { 
+    {
         int count = 0;
         if (xbResultDict != null && xbResultDict.Count > 0)
         {
@@ -205,7 +217,7 @@
         xbResultDict.Clear();
     }
 
-    
+
     public void GetServerXBInfo(HA351_tagMCTreasureInfo info)
     {
         for (int i = 0; i < info.InfoCount; i++)
@@ -218,6 +230,7 @@
                 typeInfo.freeCountToday = info.TreasuerInfoList[i].FreeCountToday;
                 typeInfo.treasureCount = (int)info.TreasuerInfoList[i].TreasureCount;
                 typeInfo.treasureCountToday = (int)info.TreasuerInfoList[i].TreasureCountToday;
+                typeInfo.treasureCountTodayGold = (int)info.TreasuerInfoList[i].TreasureCountTodayGold;
                 typeInfo.treasureCntAward = (int)info.TreasuerInfoList[i].TreasureCntAward;
                 if (typeInfo.gridLimitCntDict == null)
                     typeInfo.gridLimitCntDict = new Dictionary<int, int>();
@@ -256,6 +269,7 @@
                 xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].freeCountToday = info.TreasuerInfoList[i].FreeCountToday;
                 xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].treasureCount = (int)info.TreasuerInfoList[i].TreasureCount;
                 xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].treasureCountToday = (int)info.TreasuerInfoList[i].TreasureCountToday;
+                xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].treasureCountTodayGold = (int)info.TreasuerInfoList[i].TreasureCountTodayGold;
                 xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].treasureCntAward = (int)info.TreasuerInfoList[i].TreasureCntAward;
                 if (xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].gridLimitCntDict == null)
                     xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].gridLimitCntDict = new Dictionary<int, int>();
@@ -265,7 +279,7 @@
                     int cnt = info.TreasuerInfoList[i].GridLimitCntList[j].GridCnt;
                     xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].gridLimitCntDict[num] = cnt;
                 }
-                
+
                 xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].wishCntDict.Clear();
                 for (int j = 0; j < info.TreasuerInfoList[i].WishLibCnt; j++)
                 {
@@ -313,7 +327,7 @@
     public void SendXBQuest(int type, int index, int costType)
     {
         if (isXBCoolTime) return;
-        
+
         isXBCoolTime = true;
         CA568_tagCMRequestTreasure treasure = new CA568_tagCMRequestTreasure();
         treasure.TreasureType = (byte)type;
@@ -326,7 +340,19 @@
         }
     }
 
-
+    public bool CheckIsEmptyGrid(int[] checkPackList, int needGrid = 1)
+    {
+        if (checkPackList.IsNullOrEmpty())
+            return true;
+        for (int i = 0; i < checkPackList.Length; i++)
+        {
+            if (!CheckIsEmptyGrid((PackType)checkPackList[i], needGrid))
+            {
+                return false;
+            }
+        }
+        return true;
+    }
 
     public bool CheckIsEmptyGrid(PackType type, int needGrid = 1)
     {
@@ -369,7 +395,7 @@
         }
 
         var funcSet = TreasureSetConfig.Get(xbType);
-        if (CheckIsEmptyGrid((PackType)config.PackType))
+        if (CheckIsEmptyGrid(config.CheckPackList))
         {
             //閬撳叿瀵诲疂
             if (funcSet.CostItemID != 0 && IsHaveOneXBTool(xbType))
@@ -424,7 +450,7 @@
         }
 
         var funcSet = TreasureSetConfig.Get(xbType);
-        if (CheckIsEmptyGrid((PackType)config.PackType, 10))
+        if (CheckIsEmptyGrid(config.CheckPackList, 10))
         {
             int toolCnt = 0;
             int needToolCnt = 0;
@@ -494,7 +520,7 @@
         {
             return typeInfo.freeCountToday;
         }
-        
+
         return 0;
     }
 
@@ -508,7 +534,7 @@
     {
         qualityList = new List<int>();
 
-        //鏃犻厤缃啓姝�
+        //鏃犻厤缃啓姝诲搧璐�
         if (type == (int)HappXBTitle.Gubao)
         {
             qualityList.Add(3);
@@ -525,10 +551,15 @@
         var xbConfig = GetXBItemConfigByType(type);
         var luckList = xbConfig.LuckyItemRateInfo.Keys.ToList();
         luckList.Sort();
-        //鎸夐樁姊樉绀�
         for (int i = 0; i < luckList.Count; i++)
         {
-            if (typeInfo.luckValue < luckList[i])
+            //寮�鐗规潈鍗′箣鍚庢墠鏈夊垢杩愬鍔�
+            var luckyValue = typeInfo.luckValue;
+            if (type == (int)HappXBTitle.HeroCallAdvanced && !InvestModel.Instance.IsInvested(InvestModel.foreverCardType))
+            {
+                luckyValue = 0;
+            }
+            if (luckyValue < luckList[i])
             {
                 if (type == (int)HappXBTitle.HeroCallAdvanced)
                 {
@@ -536,7 +567,7 @@
                     qualityList = xbConfig.LuckyItemRateInfo[luckList[i]].Select(x => x[1]).ToList();
                     qualityList.Sort();
                 }
-                return luckList[i] - typeInfo.luckValue;
+                return luckList[i] - luckyValue;
             }
         }
         return 0;
@@ -596,12 +627,12 @@
                 needMoney = funcSet.CostMoneyList[0] * (needToolCnt - toolCnt);
             }
             else
-            { 
+            {
                 //鍏ㄩ儴涓嶈冻鐨勬寜澶氭浠锋牸绠� 鍙兘閰嶇疆浜嗘姌鎵�
                 needMoney = funcSet.CostMoneyList[1];
             }
         }
-        
+
         return false;
     }
 
@@ -613,7 +644,7 @@
     }
 
     public int GetCostItemID(int type)
-    { 
+    {
         var funcSet = TreasureSetConfig.Get(type);
         if (funcSet == null) return 0;
         return funcSet.CostItemID;
@@ -632,7 +663,7 @@
     public Redpoint bestXB10Red = new Redpoint(HappyXB_RedKey, XBHeroCall10_RedKey);
     public Redpoint bestXBScoreRed = new Redpoint(HappyXB_RedKey, XBHeroCallScore_RedKey);
 
-    
+
 
     private void UpdateFuncState(int funcId)
     {
@@ -656,7 +687,7 @@
             return;
         }
 
-        
+
     }
 
     void OnDayEvent()
@@ -683,12 +714,12 @@
 
         if (IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced))
         {
-            bestXBFreeRed.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ?RedPointState.GetReward : RedPointState.Simple;
+            bestXBFreeRed.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ? RedPointState.GetReward : RedPointState.Simple;
         }
 
         if (IsHaveManyXBToolEx((int)HappXBTitle.HeroCallAdvanced, out int xbtoolCnt, out int needtoolCnt, out int needMoney))
         {
-            bestXB10Red.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ?RedPointState.GetReward : RedPointState.Simple;
+            bestXB10Red.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ? RedPointState.GetReward : RedPointState.Simple;
             return;
         }
 
@@ -696,8 +727,8 @@
         if ((InvestModel.Instance.IsInvested(InvestModel.monthCardType)
         || GetXBInfoByType((int)HappXBTitle.HeroCallScore)?.treasureCount == 0)
         && UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0])
-        { 
-            bestXBScoreRed.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ?RedPointState.GetReward : RedPointState.Simple;
+        {
+            bestXBScoreRed.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ? RedPointState.GetReward : RedPointState.Simple;
         }
 
     }
@@ -713,7 +744,7 @@
         return itemIDListTemp.Distinct().ToList();
 
     }
-    
+
     #endregion
 }
 
@@ -724,6 +755,7 @@
     public int freeCountToday;      //浠婃棩宸插厤璐瑰瀹濇鏁�
     public int treasureCount;        //宸插瀹濇�绘鏁�
     public int treasureCountToday;        //浠婃棩宸插瀹濇�绘鏁�
+    public int treasureCountTodayGold;  //浠婃棩娑堣�楄揣甯佸凡瀵诲疂鎬绘鏁�
     public int treasureCntAward;        //绱瀵诲疂娆℃暟瀵瑰簲濂栧姳棰嗗鐘舵�侊紝鎸夊鍔辫褰曠储寮曚簩杩涘埗璁板綍鏄惁宸查鍙�
     public Dictionary<int, int> gridLimitCntDict;        //<鏈夐檺鍒舵娊鍙栨鏁扮殑鏍煎瓙缂栧彿,宸叉娊鍒版鏁�> 鏈夐檺鍒舵娊鍙栨鏁扮殑鏍煎瓙娆℃暟淇℃伅
     public Dictionary<int, XBWishInfo> wishCntDict;        //蹇冩効鎶藉彇鎯呭喌 <LIBID锛氬凡鎶藉埌娆℃暟锛屾槸鍚﹀嬀閫夎嚜鍔紝褰撳墠蹇冩効ID>

--
Gitblit v1.8.0