Browse Source

秘宝新效果

gitxsm 2 months ago
parent
commit
0e99150816

+ 29 - 11
script/module/hero/HeroArtifacts.lua

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

+ 19 - 3
script/module/hero/HeroExclusiveWeapon.lua

@@ -13,6 +13,7 @@ local RoleDefine = require("role.RoleDefine")
 local ObjHuman = require("core.ObjHuman")
 local Config = require("excel.weapon").weapon
 local HeroExcel = require("excel.hero").hero
+local TalismanLogic = require("talisman.TalismanLogic")
 
 local GiftLogic
 
@@ -22,6 +23,14 @@ local LOGTAG = "HeroExclusiveWeapon" --日志标识
 local SSRGRADE = 4          -- SSR英雄的grade值
 
 
+-- 获取来自秘宝的属性倍数加成
+local function getAttrMulFromTalisman(human)
+    local attrMul = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.HeroExclusiveWeapon_Attr_Mul)
+    attrMul = attrMul / 100
+    return attrMul
+end
+
+
 --获取英雄的专属武器配置
 local function getHeroWeaponCfg(heroID)
     for _, cfg in pairs(Config) do
@@ -113,7 +122,7 @@ end
 
 
 --专属武器加成
-function doCalcHero(heroGrid, addAttrs)
+function doCalcHero(human, heroGrid, addAttrs)
     if not heroGrid or not heroGrid.weaponLv then
         return
     end
@@ -124,8 +133,12 @@ function doCalcHero(heroGrid, addAttrs)
     end
 
     local nowWeaponLv = heroGrid.weaponLv
+
+    local attrMul = getAttrMulFromTalisman(human)
+    attrMul = 1 + attrMul
+
     for _, v in ipairs(cfg.normalAttrs) do
-        RoleAttr.updateValue(v[1], v[2] * nowWeaponLv, addAttrs)
+        RoleAttr.updateValue(v[1], v[2] * nowWeaponLv * attrMul, addAttrs)
     end
 end
 
@@ -248,6 +261,9 @@ function Query(human, heroID, heroIndex)
             costInfo[0] = len
         end
 
+        local attrMul = getAttrMulFromTalisman(human)
+        attrMul = 1 + attrMul
+
         --普通属性加成
         local normalAttrs = msgRet.normalAttrs
         local normalAttrsCfg = cfg.normalAttrs
@@ -255,7 +271,7 @@ function Query(human, heroID, heroIndex)
         for k, v in ipairs(normalAttrsCfg) do
             normalAttrs[k] = {}
             normalAttrs[k].key = v[1] or 0
-            normalAttrs[k].value = v[2] * nowWeaponLv
+            normalAttrs[k].value = v[2] * nowWeaponLv * attrMul
         end
 
         --特殊效果

+ 16 - 2
script/module/hero/HeroPubLogic.lua

@@ -25,6 +25,7 @@ local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
 local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
 local Grid = require("bag.Grid")
 local BagLogic = require("bag.BagLogic")
+local TalismanLogic = require("talisman.TalismanLogic")
 
 
 HERO_OP_UPSTAR      = 1     -- 升星/合成
@@ -34,6 +35,14 @@ HERO_OP_ADD         = 4     -- 获得
 
 local LOGTAG = "HeroPub"
 
+-- 获取来自秘宝的属性倍数加成
+local function getAttrMulFromTalisman(human)
+    local attrMul = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.HeroPubLogic_Attr_Mul)
+    attrMul = attrMul / 100
+    return attrMul
+end
+
+
 local function initPubData(human)
     human.db.heroPubData = human.db.heroPubData or {}
     human.db.heroPubData.activateIdxList = human.db.heroPubData.activateIdxList or {}
@@ -345,6 +354,9 @@ local function respndAttrInfo(human)
     local heroPubData = getPubData(human)
     local nowMaxStar = calcAllHeroStar(human.pubHeroList)
 
+    local attrMul = getAttrMulFromTalisman(human)
+    attrMul = 1 + attrMul
+
     local msgRet = Msg.gc.GC_HEROPUB_ATTR_QUERY
     msgRet.star = nowMaxStar
     local attrList = msgRet.attrList
@@ -363,7 +375,7 @@ local function respndAttrInfo(human)
         local attrInfo = attrList[len].attrInfo
         for k ,v in ipairs(cfg.attrs) do
             attrInfo[k].key = v[1]
-            attrInfo[k].value = v[2]
+            attrInfo[k].value = v[2] * attrMul
 
             attrInfo[0] = k
         end
@@ -433,12 +445,14 @@ function doCalcHero(human, attrs)
         return
     end
 
+    local attrMul = getAttrMulFromTalisman(human)
+    attrMul = 1 + attrMul
 
     local activateIdxList = heroPubData.activateIdxList
     for k, v in ipairs(HeroPubCfg) do
         if activateIdxList[k] then
             for _, attrInfo in ipairs(v.attrs) do
-                RoleAttr.updateValue(attrInfo[1], attrInfo[2], attrs)
+                RoleAttr.updateValue(attrInfo[1], attrInfo[2] * attrMul, attrs)
             end
         end
     end

+ 18 - 3
script/module/hero/HeroTianYuan.lua

@@ -10,12 +10,21 @@ local RoleAttr = require("role.RoleAttr")
 local HeroTianYuanCfg = require("excel.heroTianYuan")
 local Broadcast = require("broadcast.Broadcast")
 local RoleDefine = require("role.RoleDefine")
+local TalismanLogic = require("talisman.TalismanLogic")
 
 local GiftLogic
 
 local LOGTAG = "HeroTianYuan" --日志标识
 
 
+-- 获取来自秘宝的属性倍数加成
+local function getAttrMulFromTalisman(human)
+    local attrMul = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.HeroTianYuan_Attr_Mul)
+    attrMul = attrMul / 100
+    return attrMul
+end
+
+
 local function initData(heroGrid)
     heroGrid.tianYuanData = {
         pointIdx = 0,
@@ -221,8 +230,11 @@ function doCalcHero(human, heroGrid, tatgetAttrs)
     local nowPointIdx = heroGrid.tianYuanData.pointIdx or 0
     local sourceAttrs = calcData(nowStage, nowPointIdx, 1)
 
+    local attrMul = getAttrMulFromTalisman(human)
+    attrMul = 1 + attrMul
+
     for attrId, attrVal in pairs(sourceAttrs or {}) do
-        RoleAttr.updateValue(attrId, attrVal, tatgetAttrs)
+        RoleAttr.updateValue(attrId, attrVal * attrMul, tatgetAttrs)
     end
 end
 
@@ -268,6 +280,9 @@ function HeroTianYuan_Query(human, heroID, heroIndex)
     --     Grid.makeItem(msgRet.cost[i], itemId, itemCnt)
     -- end
 
+    local attrMul = getAttrMulFromTalisman(human)
+    attrMul = 1 + attrMul
+
     -- 总加成属性
     msgRet.attrs[0] = 0
     local attrs = calcData(nowStage, nowPointIdx, 1)
@@ -277,7 +292,7 @@ function HeroTianYuan_Query(human, heroID, heroIndex)
             len = len + 1
             msgRet.attrs[0] = len
             msgRet.attrs[len].key = attrId
-            msgRet.attrs[len].value = attrVal
+            msgRet.attrs[len].value = attrVal * attrMul
         end
     end
 
@@ -289,7 +304,7 @@ function HeroTianYuan_Query(human, heroID, heroIndex)
             msgRet.nextAttrs[0] = #nextAttrs
             for i, attrTb in ipairs(nextAttrs) do
                 msgRet.nextAttrs[i].key = attrTb[1]
-                msgRet.nextAttrs[i].value = attrTb[2]
+                msgRet.nextAttrs[i].value = attrTb[2] * attrMul
             end
         end
     end

+ 1 - 1
script/module/role/RoleAttr.lua

@@ -178,7 +178,7 @@ function calcHeroGrid(heroGrid, index, human)
 
 	TalismanLogic.doCalcHero(human, heroGrid, HERO_OTHER_ATTRS) --秘宝
 
-	HeroExclusiveWeapon.doCalcHero(heroGrid, HERO_OTHER_ATTRS) -- 专属武器
+	HeroExclusiveWeapon.doCalcHero(human, heroGrid, HERO_OTHER_ATTRS) -- 专属武器
 	WinnerRelicLogic.doCalcHero(human, heroGrid, HERO_OTHER_ATTRS) --圣者遗物
 
 	HeroPubLogic.doCalcHero(human, HERO_OTHER_ATTRS) --英雄酒馆

+ 17 - 0
script/module/talisman/TalismanLogic.lua

@@ -60,6 +60,11 @@ OTHER_EFFECT_TBL = {
     ["WinnerRelic_Attr_Mul"] = "WinnerRelic_Attr_Mul", -- 圣遗物系统通用属性加成
     ["Elf_Attr_Mul"] = "Elf_Attr_Mul",              -- 精灵系统通用属性加成
     ["Moshou_LvAttr_Mul"] = "Moshou_LvAttr_Mul",    -- 守护凤凰系统等级加成属性的加成
+
+    ["HeroExclusiveWeapon_Attr_Mul"] = "HeroExclusiveWeapon_Attr_Mul",    -- 英雄专属武器系统加成
+    ["HeroTianYuan_Attr_Mul"] = "HeroTianYuan_Attr_Mul",                  -- 英雄天元系统加成
+    ["HeroArtifacts_LvAttr_Mul"] = "HeroArtifacts_LvAttr_Mul",            -- 英雄神威灵装系统加成
+    ["HeroPubLogic_Attr_Mul"] = "HeroPubLogic_Attr_Mul",                  -- 英雄酒馆系统加成
 }
 
 --是否开启本系统
@@ -189,6 +194,18 @@ function doCalcHero(human, heroGrid, addAttrs)
                 if singleAttr[1] == heroCfg.camp then
                     RoleAttr.updateValue(singleAttr[2], singleAttr[3], addAttrs)
                 end
+            elseif #singleAttr == 4 then
+                local bl = false
+                local tp = singleAttr[1]
+                if tp == 1 then -- 职业
+                    if heroCfg.job == singleAttr[2] then
+                        bl = true
+                    end
+                end
+
+                if bl then
+                    RoleAttr.updateValue(singleAttr[3], singleAttr[4], addAttrs)
+                end
             end
         end
     end