Kaynağa Gözat

更新星降

zhanwencai 1 yıl önce
ebeveyn
işleme
43be72abbe

BIN
script/file3.tar.gz


+ 3 - 0
script/module/hero/HeroLogic.lua

@@ -475,6 +475,9 @@ function addHeroByGrid(human, heroGrid, logType, noSend, heroAttrs)
     end
 
     local emptyIndex = getEmptyIndex(human)
+
+    Log.write(Log.LOGID_TEST, "emptyIndex " .. emptyIndex)
+
     if not emptyIndex then return end
 
     heroGrid.bagIndex = emptyIndex

+ 16 - 6
script/module/role/NewLogic.lua

@@ -15,6 +15,8 @@ local HeroGrid = require("hero.HeroGrid")
 local Json = require("common.Json")
 local FenjieLogic = require("hecheng.FenjieLogic")
 local HeroBook = require("hero.HeroBook")
+local FuwenLogic = require("fuwen.FuwenLogic")
+local HeroEquip = require("hero.HeroEquip")
 
 AD_DRAW_REWARD_TYPE = 10          --观看广告领取召唤券
 QUERY_MERGE_INFO_TYPE = 11        --获取融合信息
@@ -193,6 +195,7 @@ function NewProto(human, type, param)
             local xLv = getxLv(fatherHeroGrid, motherHeroGrid)
             local cnt = math.floor(xLv / 2) + 1
             local heroSimple = {}
+            local isHatch = 1
 
             Log.write(Log.LOGID_TEST, "xLv: " .. xLv)
             Log.write(Log.LOGID_TEST, "cnt: " .. cnt)
@@ -210,6 +213,8 @@ function NewProto(human, type, param)
             local delHeroList = { [1] = fatherHeroBagIndex, [2] = motherHeroBagIndex }
             for heroIndex in pairs(delHeroList) do
                 local heroID = HeroLogic.getHeroIdByIndex(human, heroIndex)
+                HeroEquip.putOffQuick(human, heroID, heroIndex, true)
+                FuwenLogic.putOffQuick(human, heroID, heroIndex, true)
                 local inputIDList = { [0] = 1, [1] = heroID }
                 local inputIndexList = { [0] = 1, [1] = heroIndex }
                 outItems[#outItems + 1] = FenjieLogic.fenjie(human, FenjieLogic.FENJIE_DO_MERGE, inputIDList,
@@ -235,10 +240,14 @@ function NewProto(human, type, param)
             if cf.grade >= 6 then
                 heroSimple.name = "?????"
             end
+
+            if getHatchTime(xLv) == 0 then
+                isHatch = 3
+            end
             mergeInfo.mergeTime        = getHatchTime(xLv)
             mergeInfo.xLv              = xLv
             mergeInfo.heroData         = heroSimple
-            mergeInfo.isHatch          = 1
+            mergeInfo.isHatch          = isHatch
             mergeInfo.adHatchRewardCnt = getResetAdHatchCnt(human)
             mergeInfo.isTip            = getTodayIsTip(human)
 
@@ -280,7 +289,7 @@ function NewProto(human, type, param)
 
         local mergeTime = human.db.mergeInfo.endTime - os.time()
 
-        if mergeTime < 0 then
+        if mergeTime <= 0 then
             -- 孵化成功
             mergeTime = 0
             isHatch = 3
@@ -330,11 +339,10 @@ function NewProto(human, type, param)
             HeroGrid.makeHeroSimple(heroSimple, heroGrid, heroIndex, human)
 
             for i = 1, 1 do
-                local heroID = sonHeroID
-                local index = heroIndex
-                local heroConfig = HeroExcel[heroID]
+                local heroID = heroGrid.id or heroGrid.heroID
+                local heroConfig = heroID or HeroExcel.hero[heroID]
                 local isNew = not HeroBook.isGet(human, heroConfig.id, heroConfig.star)
-                HeroGrid.makeHeroNice(heroNiceNet, heroID, nil, isNew, index)
+                HeroGrid.makeHeroNice(heroNiceNet, heroID, nil, isNew, heroIndex)
             end
         else
             local cf        = sonHeroID and HeroExcel.hero[sonHeroID]
@@ -479,6 +487,8 @@ end
 
 -- 孵化英雄
 function hatchHero(human)
+    Log.write(Log.LOGID_TEST, "孵化英雄id " .. human.db.mergeInfo.heroInfo.heroID)
+
     --添加英雄
     local heroIndex, fjlist = HeroLogic.addHero(human, human.db.mergeInfo.heroInfo.heroID, nil, 1,
         "hero_merge")