SCFC 1 год назад
Родитель
Сommit
76a39abde9
2 измененных файлов с 70 добавлено и 62 удалено
  1. 1 1
      script/module/drawCard/Proto.lua
  2. 69 61
      script/module/drawCard/RecommendLineup.lua

+ 1 - 1
script/module/drawCard/Proto.lua

@@ -61,7 +61,7 @@ CG_DRAWCARD_SKIP_HEROSHOW = {
 RecommendLineup = 
 {
 	{"data", 	7, 	HeroSimple},
-	{"nPower", 	1, 	"int"},
+	{"name", 	1, 	"string"},
 }
 
 -- 请求推荐阵容

+ 69 - 61
script/module/drawCard/RecommendLineup.lua

@@ -13,6 +13,7 @@ local Msg = require("core.Msg")
 local CombatPosLogic = require("combat.CombatPosLogic")
 local CombatDefine = require("combat.CombatDefine")
 local HeroExcel = require("excel.hero")
+local tTuiJian = require("excel.tuijian")
 
 
 local nRecommendLineupLen = 30		 -- 阵容记录推荐数量
@@ -182,88 +183,95 @@ end
 
 ---------------------------------------- 客户端请求 ------------------------------------
 function GetRecommendLineUp(human)
-    local tData = RecommendLineup_GetData()
+    local tData = tTuiJian.Sheet1
+    -- table.print_lua_table(tData)
 
     local tMsgData = Msg.gc.GC_DRAWCARD_GET_RECOMMEND_LINEUP
     tMsgData.list[0] = 0 
-    tMsgData.bIsEnd = 0
+    tMsgData.bIsEnd = 1
 
-    for i, value in ipairs(tData) do
+    for _, v in ipairs(tData) do
         tMsgData.list[0] = tMsgData.list[0] + 1
+        -- print("[GetRecommendLineUp] i = "..tMsgData.list[0])
         local tHeroData = tMsgData.list[tMsgData.list[0]]
+        tHeroData.name = v.name
         tHeroData.data[0] = 0
-        tHeroData.nPower = value.nPower
-        print("[GetRecommendLineUp] nPower = "..value.nPower.." i = "..i)
-        for _, v in pairs(value.data) do
-            
+
+        for i, tHero in ipairs(v.list) do
             tHeroData.data[0] = tHeroData.data[0] + 1
-            RecommendLineup_MakeSimpleData(tHeroData.data[tHeroData.data[0]], v)
-        end
-        
-        if i >= nSendLen then
-            Msg.send(tMsgData, human.fd)
-            tMsgData.list[0] = 0
+            local tHeroSimple = tHeroData.data[tHeroData.data[0]]
+            local nHeroID = tHero[1]
+            local nHeroStar = tHero[2]
+
+            HeroGrid.makeHeroSimpleByID(tHeroSimple, nHeroID)
+            tHeroSimple.star = nHeroStar
+            -- print("[GetRecommendLineUp] 封装 英雄数据结束 nHeroID = "..nHeroID.." nHeroStar = "..nHeroStar.." i = "..i)
         end
+        -- table.print_lua_table(tHeroData)
     end
 	
-    tMsgData.bIsEnd = 1
     Msg.send(tMsgData, human.fd)
 	print("[GetRecommendLineUp] 发送成功 ")
 end
 
 
 function RecommendLineup_UpDate(human)
-    if 5 >= human.db.lv then
-        return
-    end
-
-    local combatHero,helpList = CombatPosLogic.getCombatHeros(human, CombatDefine.COMBAT_TYPE1)
-    if not combatHero then
+    if human then
         return
     end
 
-    local nNewPower = CombatPosLogic.getCombatHeroZDL(human, CombatDefine.COMBAT_TYPE1, true)
-
-    local nIndex = RecommendLineup_GetIndex(nNewPower, human)
-    if -1 >= nIndex then
-        return
-    end
-
-    print("[RecommendLineup_UpDate] 获取到的下表 nIndex = "..nIndex)
-
-    local tHeroData = {
-        key = human.db._id,
-        nPower = nNewPower,
-        data = {},
-    }
-
-    local nLen = 1
-    for _, v in pairs(combatHero) do
-        local heroGrid = HeroLogic.getHeroGridByUuid(human, v)
-        if heroGrid then
-              tHeroData.data[nLen] = {
-                general = {},
-                gemData = {},
-                relic = {},
-            }
-            HeroGrid.makeHeroSimple(tHeroData.data[nLen], heroGrid, heroGrid.bagIndex, human)
-            nLen = nLen + 1
-        end
-    end
+    return
+    -- if 5 >= human.db.lv then
+    --     return
+    -- end
+
+    -- local combatHero,helpList = CombatPosLogic.getCombatHeros(human, CombatDefine.COMBAT_TYPE1)
+    -- if not combatHero then
+    --     return
+    -- end
+
+    -- local nNewPower = CombatPosLogic.getCombatHeroZDL(human, CombatDefine.COMBAT_TYPE1, true)
+
+    -- local nIndex = RecommendLineup_GetIndex(nNewPower, human)
+    -- if -1 >= nIndex then
+    --     return
+    -- end
+
+    -- print("[RecommendLineup_UpDate] 获取到的下表 nIndex = "..nIndex)
+
+    -- local tHeroData = {
+    --     key = human.db._id,
+    --     nPower = nNewPower,
+    --     data = {},
+    -- }
+
+    -- local nLen = 1
+    -- for _, v in pairs(combatHero) do
+    --     local heroGrid = HeroLogic.getHeroGridByUuid(human, v)
+    --     if heroGrid then
+    --           tHeroData.data[nLen] = {
+    --             general = {},
+    --             gemData = {},
+    --             relic = {},
+    --         }
+    --         HeroGrid.makeHeroSimple(tHeroData.data[nLen], heroGrid, heroGrid.bagIndex, human)
+    --         nLen = nLen + 1
+    --     end
+    -- end
     
-    for _,v in pairs(helpList) do
-        local heroGrid = HeroLogic.getHeroGridByUuid(human, v)
-        if heroGrid then
-            tHeroData.data[nLen] = {
-                general = {},
-                gemData = {},
-            }
-            HeroGrid.makeHeroSimple(tHeroData.data[nLen], heroGrid, heroGrid.bagIndex, human)
-            nLen = nLen + 1
-        end
-    end
-
-    RecommendLineup_UpDateData(human, nIndex, tHeroData)
+    -- for _,v in pairs(helpList) do
+    --     local heroGrid = HeroLogic.getHeroGridByUuid(human, v)
+    --     if heroGrid then
+    --         tHeroData.data[nLen] = {
+    --             general = {},
+    --             gemData = {},
+    --         }
+    --         HeroGrid.makeHeroSimple(tHeroData.data[nLen], heroGrid, heroGrid.bagIndex, human)
+    --         nLen = nLen + 1
+    --     end
+    -- end
+
+    -- RecommendLineup_UpDateData(human, nIndex, tHeroData)
 end
 
 function RecommendLineup_GMClear()