|
|
@@ -35,12 +35,21 @@ local HeroArtifactsConfig = require("excel.heroArtifacts")
|
|
|
local Util = require("common.Util")
|
|
|
local Lang = require("common.Lang")
|
|
|
local Broadcast = require("broadcast.Broadcast")
|
|
|
+local TalismanLogic = require("talisman.TalismanLogic")
|
|
|
|
|
|
local GiftLogic
|
|
|
|
|
|
local LOGTAG = "Artifacts" --日志标识
|
|
|
|
|
|
|
|
|
+-- 获取来自秘宝的属性倍数加成
|
|
|
+local function getAttrMulFromTalisman(human)
|
|
|
+ local attrMul = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.HeroArtifacts_LvAttr_Mul)
|
|
|
+ attrMul = attrMul / 100
|
|
|
+ return attrMul
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
local function initArtifactsData(heroGrid)
|
|
|
heroGrid.artifacts = {
|
|
|
level = 0,
|
|
|
@@ -187,10 +196,13 @@ local function populateActivateCostMsg(net)
|
|
|
end
|
|
|
|
|
|
-- 填充灵装当前等级/星级总加成属性协议结构数据
|
|
|
-local function populateTotalAttrMsg(net, n, tp)
|
|
|
+local function populateTotalAttrMsg(human, net, n, tp)
|
|
|
local t
|
|
|
+ local attrMul = 1
|
|
|
if tp == 1 then
|
|
|
t = HeroArtifactsConfig.UpGradeLv
|
|
|
+ attrMul = getAttrMulFromTalisman(human)
|
|
|
+ attrMul = 1 + attrMul
|
|
|
else
|
|
|
t = HeroArtifactsConfig.UpGradeStar
|
|
|
end
|
|
|
@@ -208,15 +220,18 @@ local function populateTotalAttrMsg(net, n, tp)
|
|
|
len = len + 1
|
|
|
net[0] = len
|
|
|
net[len].key = attrId
|
|
|
- net[len].value = n <= 0 and 0 or attrVal
|
|
|
+ net[len].value = (n <= 0 and 0 or attrVal) * attrMul
|
|
|
end
|
|
|
end
|
|
|
|
|
|
-- 填充灵装下一等级/星级加成属性协议结构数据
|
|
|
-local function populateNextAttrMsg(net, n, tp, isMax)
|
|
|
+local function populateNextAttrMsg(human, net, n, tp, isMax)
|
|
|
local t
|
|
|
+ local attrMul = 1
|
|
|
if tp == 1 then
|
|
|
t = HeroArtifactsConfig.UpGradeLv
|
|
|
+ attrMul = getAttrMulFromTalisman(human)
|
|
|
+ attrMul = 1 + attrMul
|
|
|
else
|
|
|
t = HeroArtifactsConfig.UpGradeStar
|
|
|
end
|
|
|
@@ -227,7 +242,7 @@ local function populateNextAttrMsg(net, n, tp, isMax)
|
|
|
for k,v in ipairs(attrArrCfg or {}) do
|
|
|
net[0] = k
|
|
|
net[k].key = v[1]
|
|
|
- net[k].value = isMax and 0 or v[2]
|
|
|
+ net[k].value = (isMax and 0 or v[2]) * attrMul
|
|
|
end
|
|
|
end
|
|
|
|
|
|
@@ -529,9 +544,12 @@ function doCalcHero(human, heroGrid, addAttrs)
|
|
|
local artifactsData = heroGrid.artifacts
|
|
|
|
|
|
if artifactsData.level > 0 then
|
|
|
+ local attrMul = getAttrMulFromTalisman(human)
|
|
|
+ attrMul = 1 + attrMul
|
|
|
+
|
|
|
local attrList = calcAttrs(HeroArtifactsConfig.UpGradeLv, artifactsData.level)
|
|
|
for attrId, attrVal in pairs(attrList) do
|
|
|
- RoleAttr.updateValue(attrId, attrVal, addAttrs)
|
|
|
+ RoleAttr.updateValue(attrId, attrVal * attrMul, addAttrs)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
@@ -657,8 +675,8 @@ function HeroArtifacts_Base_Query(human, heroID, heroIndex)
|
|
|
msgRet.redDotArr[2] = 0
|
|
|
|
|
|
populateActivateCostMsg(msgRet.ActivateCost)
|
|
|
- populateTotalAttrMsg(msgRet.nowLevelAttrs, currentLevel, 1)
|
|
|
- populateTotalAttrMsg(msgRet.nowStarAttrs, currentStar, 2)
|
|
|
+ populateTotalAttrMsg(human, msgRet.nowLevelAttrs, currentLevel, 1)
|
|
|
+ populateTotalAttrMsg(human, msgRet.nowStarAttrs, currentStar, 2)
|
|
|
|
|
|
if artifactsData and artifactsData.effectArr then
|
|
|
populateEffectMsg(msgRet.effectArr, artifactsData.effectArr)
|
|
|
@@ -740,8 +758,8 @@ function HeroArtifacts_Lv_Query(human, heroID, heroIndex)
|
|
|
local msgRet = Msg.gc.GC_HEROARTIFACTS_LV_QUERY
|
|
|
msgRet.artifactsLv = currentLevel
|
|
|
msgRet.artifactsLvMax = maxLevel
|
|
|
- populateTotalAttrMsg(msgRet.nowLevelAttrs, currentLevel, 1)
|
|
|
- populateNextAttrMsg(msgRet.nextLevelAttrs, nextLevel, 1, isMax)
|
|
|
+ populateTotalAttrMsg(human, msgRet.nowLevelAttrs, currentLevel, 1)
|
|
|
+ populateNextAttrMsg(human, msgRet.nextLevelAttrs, nextLevel, 1, isMax)
|
|
|
|
|
|
local itemId, itemCnt = getNextStageCost(currentLevel, 1, isMax)
|
|
|
Grid.makeItem(msgRet.cost, itemId, itemCnt)
|
|
|
@@ -815,8 +833,8 @@ function HeroArtifacts_Star_Query(human, heroID, heroIndex)
|
|
|
local msgRet = Msg.gc.GC_HEROARTIFACTS_STAR_QUERY
|
|
|
msgRet.artifactsStar = currentStar
|
|
|
msgRet.artifactsStarMax = maxStar
|
|
|
- populateTotalAttrMsg(msgRet.nowStarAttrs, currentStar, 2)
|
|
|
- populateNextAttrMsg(msgRet.nextStarAttrs, nextStar, 2, isMax)
|
|
|
+ populateTotalAttrMsg(human, msgRet.nowStarAttrs, currentStar, 2)
|
|
|
+ populateNextAttrMsg(human, msgRet.nextStarAttrs, nextStar, 2, isMax)
|
|
|
|
|
|
local itemId, itemCnt = getNextStageCost(currentStar, 2, isMax)
|
|
|
Grid.makeItem(msgRet.cost, itemId, itemCnt)
|