zhanwencai 1 год назад
Родитель
Сommit
724ea80b7f
3 измененных файлов с 35 добавлено и 13 удалено
  1. BIN
      script/file3.tar.gz
  2. 1 0
      script/module/hecheng/FenjieLogic.lua
  3. 34 13
      script/module/role/NewLogic.lua

BIN
script/file3.tar.gz


+ 1 - 0
script/module/hecheng/FenjieLogic.lua

@@ -31,6 +31,7 @@ FENJIE_DO_HECHENG = 3	--合成导致的分解
 FENJIE_DO_JUEXING = 4	--觉醒导致的分解
 FENJIE_DO_SHELTER = 5   --庇护所导致的分解
 FENJIE_DO_TENSTAR  = 7  --十星置换导致分解
+FENJIE_DO_MERGE  = 7  --融合导致分解
 
 -------------------------------------------------------------------------------------
 

+ 34 - 13
script/module/role/NewLogic.lua

@@ -13,6 +13,8 @@ local RoleDefine = require("role.RoleDefine")
 local ObjHuman = require("core.ObjHuman")
 local HeroGrid = require("hero.HeroGrid")
 local Json = require("common.Json")
+local FenjieLogic = require("hecheng.FenjieLogic")
+local HeroBook = require("hero.HeroBook")
 
 AD_DRAW_REWARD_TYPE = 10          --观看广告领取召唤券
 QUERY_MERGE_INFO_TYPE = 11        --获取融合信息
@@ -204,9 +206,20 @@ function NewProto(human, type, param)
             --使用道具
             ItemLogic.use(human, itemId, cnt)
 
+            local outItems = {}
+            local delHeroList = { [1] = fatherHeroBagIndex, [2] = motherHeroBagIndex }
+            for heroIndex in pairs(delHeroList) do
+                local heroID = HeroLogic.getHeroIdByIndex(human, heroIndex)
+                local inputIDList = { [0] = 1, [1] = heroID }
+                local inputIndexList = { [0] = 1, [1] = heroIndex }
+                outItems[#outItems + 1] = FenjieLogic.fenjie(human, FenjieLogic.FENJIE_DO_MERGE, inputIDList,
+                    inputIndexList, nil, "hero_merge")
+            end
+            BagLogic.sendItemGetList3(human, outItems, "tenStar_displace")
+
             -- 删除英雄
-            HeroLogic.delHeroByIndex(human, fatherHeroBagIndex, "hero_merge")
-            HeroLogic.delHeroByIndex(human, motherHeroBagIndex, "hero_merge")
+            -- HeroLogic.delHeroByIndex(human, fatherHeroBagIndex, "hero_merge")
+            -- HeroLogic.delHeroByIndex(human, motherHeroBagIndex, "hero_merge")
 
             -- 记录融合英雄
             human.db.mergeInfo.heroInfo.heroID             = sonHeroID
@@ -297,16 +310,16 @@ function NewProto(human, type, param)
 
     -- 获取融合英雄
     if type == GET_MERGE_HERO_TYPE then
-        local nowTime    = os.time()
-        local mergeInfo  = {}
-        local heroSimple = {}
-        local xLv        = human.db.mergeInfo.heroInfo.xLv or 0
-        local sonHeroID  = human.db.mergeInfo.heroInfo.heroID or 0
-        local hatchTime  = human.db.mergeInfo.endTime - nowTime
-        local isHatch    = 2
-        local heroIndex  = 0
-        local msgTyep    = GET_MERGE_HERO_TYPE
-
+        local nowTime     = os.time()
+        local mergeInfo   = {}
+        local heroSimple  = {}
+        local xLv         = human.db.mergeInfo.heroInfo.xLv or 0
+        local sonHeroID   = human.db.mergeInfo.heroInfo.heroID or 0
+        local hatchTime   = human.db.mergeInfo.endTime - nowTime
+        local isHatch     = 2
+        local heroIndex   = 0
+        local msgTyep     = GET_MERGE_HERO_TYPE
+        local heroNiceNet = {}
         if hatchTime <= 0 then
             -- 孵化成功
             hatchTime = 0
@@ -315,6 +328,14 @@ function NewProto(human, type, param)
             if not heroGrid then return end
             heroSimple.general = heroSimple.general or {}
             HeroGrid.makeHeroSimple(heroSimple, heroGrid, heroIndex, human)
+
+            for i = 1, 1 do
+                local heroID = sonHeroID
+                local index = heroIndex
+                local heroConfig = HeroExcel[heroID]
+                local isNew = not HeroBook.isGet(human, heroConfig.id, heroConfig.star)
+                HeroGrid.makeHeroNice(heroNiceNet, heroID, nil, isNew, index)
+            end
         else
             local cf        = sonHeroID and HeroExcel.hero[sonHeroID]
             heroSimple.name = cf and cf.name or ""
@@ -331,10 +352,10 @@ function NewProto(human, type, param)
         mergeInfo.isHatch          = isHatch
         mergeInfo.adHatchRewardCnt = getResetAdHatchCnt(human)
         mergeInfo.isTip            = getTodayIsTip(human)
+        mergeInfo.heroNiceNet      = heroNiceNet
 
         msgRet.ret                 = msgTyep
         msgRet.tip                 = Json.Encode(mergeInfo)
-
         Log.write(Log.LOGID_TEST, "获取英雄 ret: " .. Json.Encode(msgRet))
         Msg.send(msgRet, human.fd)
         return