|
|
@@ -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
|