|
|
@@ -262,6 +262,66 @@ function makeHeroSimple(net, grid, index, human, others, tuJian)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+-- 封装英雄信息 额外处理
|
|
|
+function makeHeroSimpleToJson(net, grid, index, human, others, tuJian)
|
|
|
+ local id = grid and (grid.id or grid.heroID)
|
|
|
+ local cf = id and HeroExcel.hero[id]
|
|
|
+ local star = grid and grid.star or (cf and cf.star or 1)
|
|
|
+ local upStarConfig = HeroDefine.getNextAttrConfig(id, star)
|
|
|
+ local jobConfig = cf and cf.job and HeroExcel.job[cf.job]
|
|
|
+ local isGongMing = XingYaoGongMing.isGongMing(human, index)
|
|
|
+
|
|
|
+ net.id = id or 0
|
|
|
+ net.index = index or 0
|
|
|
+ net.uuid = grid and grid.uuid or ""
|
|
|
+ net.gl = cf and cf.gl or 0
|
|
|
+ net.camp = cf and cf.camp or 0
|
|
|
+ net.job = cf and cf.job or 0
|
|
|
+ net.star = others and others.star or star --cf and cf.star or 0 星级调整 dxzeng
|
|
|
+ net.icon = grid and grid.head or (cf and cf.head or 0)
|
|
|
+ net.body = grid and grid.body or (cf and cf.body or 0)
|
|
|
+ if grid and human and index then -- todo 皮肤这个以后可能还是需要继续整理
|
|
|
+ local skinConf = SkinLogic.getHeroSkin(human, index)
|
|
|
+ if skinConf then
|
|
|
+ net.icon = skinConf.head
|
|
|
+ net.body = skinConf.body
|
|
|
+ end
|
|
|
+ end
|
|
|
+ net.up = upStarConfig == nil and 0 or 1 --是否能够升星
|
|
|
+
|
|
|
+ net.lv = others and others.lv or (grid and grid.lv or 1)
|
|
|
+ net.xLv = others and others.xLv or (grid and grid.xLv or 0)
|
|
|
+ net.zhandouli = grid and grid.zhandouli or 0
|
|
|
+ net.quality = grid and grid.quality or 0
|
|
|
+ net.isLock = (grid and grid.isLock) and 1 or 0
|
|
|
+ net.hp = others and others.hp or 0
|
|
|
+ net.hpMax = others and others.hpMax or 0
|
|
|
+ net.cnt = others and others.cnt or 1
|
|
|
+ net.isget = HeroBook.isGetHero(human, id) or 0
|
|
|
+ net.weightLv = cf and cf.grade or 0
|
|
|
+ net.name = cf and cf.name or ""
|
|
|
+ net.grade = cf and cf.grade or 0
|
|
|
+ net.jobDesc = jobConfig and jobConfig.desc or ""
|
|
|
+ net.label = cf and cf.label or ""
|
|
|
+ net.order = cf and cf.order or 0
|
|
|
+ net.isGongMing = isGongMing or 0
|
|
|
+
|
|
|
+
|
|
|
+ --是否发送图鉴信息
|
|
|
+ if tuJian then
|
|
|
+ local tj = HeroExcel.tujian[id]
|
|
|
+ if tj ~= nil then
|
|
|
+ net.general[1].cm = tj.cm or 0
|
|
|
+ net.general[1].kg = tj.kg or 0
|
|
|
+ net.general[1].age = tj.age or 0
|
|
|
+ net.general[1].cup = tj.cup or ""
|
|
|
+ net.general[1].character = tj.character or ""
|
|
|
+ net.general[1].interest = tj.interest or ""
|
|
|
+ net.general[1].desc = tj.desc or ""
|
|
|
+ end
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
-- 封装英雄信息装备符文
|
|
|
function fontHeroDetailInfo(net, grid, index, human, others, tuJian)
|
|
|
makeHeroSimple(net,grid, index, human, others, tuJian)
|
|
|
@@ -296,6 +356,13 @@ function makeHeroSimpleByID(net, id, index, others, human, tujian)
|
|
|
makeHeroSimple(net, grid, index, human, others,tujian)
|
|
|
end
|
|
|
|
|
|
+-- 根据英雄id封装英雄信息heroSimple 额外处理
|
|
|
+function makeHeroSimpleByIDToJson(net, id, index, others, human, tujian)
|
|
|
+ local star = others and others.star or nil
|
|
|
+ local grid = getCacheHeroGrid(id, star, others)
|
|
|
+ makeHeroSimpleToJson(net, grid, index, human, others,tujian)
|
|
|
+end
|
|
|
+
|
|
|
-- 根据怪物id封装英雄信息
|
|
|
function makeHeroSimpleByMonsterID(net, id, others)
|
|
|
makeHeroSimpleByID(net, nil, nil, others)
|
|
|
@@ -368,6 +435,41 @@ function makeHeroNice(net, id, cnt, isNew, index)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+function makeHeroNiceToJson(net, id, cnt, isNew, index)
|
|
|
+ if cnt then
|
|
|
+ Grid.makeItem(net.itemData[1], id, cnt)
|
|
|
+ end
|
|
|
+ local heroConfig = HeroExcel.hero[id]
|
|
|
+ local specialConfig = HeroExcel.specialHero[id]
|
|
|
+ if heroConfig then
|
|
|
+ makeHeroSimpleByIDToJson(net.heroSimple[1], id, index)
|
|
|
+ makeHeroStaticToJson(net.heroStatic[1], id)
|
|
|
+ end
|
|
|
+
|
|
|
+ net.body = specialConfig and (heroConfig and heroConfig.body or 0) or 0
|
|
|
+ net.isNew = isNew and 1 or 0
|
|
|
+ net.weightLv = heroConfig and heroConfig.grade or 0
|
|
|
+
|
|
|
+ net.bubble = ""
|
|
|
+ local attrsNum = 0
|
|
|
+ local attrsMaxNum = 0
|
|
|
+ if heroConfig then
|
|
|
+ local bubble = PaomaExcel.bubble[heroConfig.id]
|
|
|
+ net.bubble = bubble and bubble.drawCard or ""
|
|
|
+ local heroGrid = getCacheHeroGridTujian(id)
|
|
|
+ for key = RoleDefine.ATK, RoleDefine.SPEED do
|
|
|
+ local value = heroGrid.attrs[key]
|
|
|
+ attrsNum = attrsNum + 1
|
|
|
+ net.attrs[attrsNum].key = key
|
|
|
+ net.attrs[attrsNum].value = value
|
|
|
+
|
|
|
+ attrsMaxNum = attrsMaxNum + 1
|
|
|
+ net.attrsMax[attrsMaxNum].key = key
|
|
|
+ net.attrsMax[attrsMaxNum].value = HeroDefine.getTujianMaxValue(key)
|
|
|
+ end
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
-- 填充英雄详细信息:静态
|
|
|
function makeHeroStatic(net, id, tuJian)
|
|
|
local cf = id and HeroExcel.hero[id]
|
|
|
@@ -414,6 +516,50 @@ function makeHeroStatic(net, id, tuJian)
|
|
|
net.skin = #cf.skin > 0 and 1 or 0
|
|
|
end
|
|
|
|
|
|
+-- 填充英雄详细信息:静态 额外格式
|
|
|
+function makeHeroStaticToJson(net, id, tuJian)
|
|
|
+ local cf = id and HeroExcel.hero[id]
|
|
|
+ if not cf then
|
|
|
+ net.id=0
|
|
|
+ net.name =""
|
|
|
+ net.body =0
|
|
|
+ net.job = 0
|
|
|
+ net.weightLv=0
|
|
|
+ net.normalAtkID=0
|
|
|
+ net.skillList[0]=0
|
|
|
+ net.beSkill[0]=0
|
|
|
+ net.skin=0
|
|
|
+ return
|
|
|
+ end
|
|
|
+ local star = cf.star
|
|
|
+ if tuJian and tuJian == 1 then
|
|
|
+ local tuJianConfig = HeroExcel.tujian[id]
|
|
|
+ if tuJianConfig then
|
|
|
+ local maxStarIndex = #tuJianConfig.star
|
|
|
+ star = tuJianConfig.star[maxStarIndex]
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ net.id = id
|
|
|
+ net.name = cf.name
|
|
|
+ net.body = cf.body
|
|
|
+ net.job = cf.job
|
|
|
+ net.weightLv = cf.grade
|
|
|
+
|
|
|
+ local attrConfig = HeroDefine.getAttrConfig(id, star)
|
|
|
+ net.normalAtkID = attrConfig.normalAtkID
|
|
|
+
|
|
|
+ for i = 1, #attrConfig.skillList do
|
|
|
+ HeroLogic.makeSkillNetToJson(net.skillList[i], attrConfig.skillList[i])
|
|
|
+ end
|
|
|
+
|
|
|
+ for i = 1, #attrConfig.beSkillList do
|
|
|
+ HeroLogic.makeSkillNetToJson(net.beSkill[i], attrConfig.beSkillList[i])
|
|
|
+ end
|
|
|
+ net.skin = #cf.skin > 0 and 1 or 0
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
-- 最多连续升x级
|
|
|
function getLevelUpCnt(human, nowLv, maxLv)
|
|
|
local cnt = 0
|