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