diff --git a/Assets/ManagedResources/~Lua/Modules/Equip/TalismanManager.lua b/Assets/ManagedResources/~Lua/Modules/Equip/TalismanManager.lua index 407be348b0..af269427f9 100644 --- a/Assets/ManagedResources/~Lua/Modules/Equip/TalismanManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Equip/TalismanManager.lua @@ -128,24 +128,8 @@ function this.CalculateWarForceBase(curTalismanConFigData,heroPos) end end end - local heroPropertyScore={} - for i, v in ConfigPairs(propertyConfig) do - heroPropertyScore[i]=v.Score - end - local powerEndVal=0 - for i, v in pairs(addAllProVal) do - if v > 0 then - local curProConfigData = ConfigManager.GetConfigData(ConfigName.PropertyConfig,i) - if curProConfigData then - if curProConfigData.Style == 1 then - powerEndVal=powerEndVal+v*heroPropertyScore[i] - else - powerEndVal=powerEndVal+v/100*heroPropertyScore[i] - end - end - end - end - return math.floor(powerEndVal) + local powerEndVal = HeroPowerManager.CalPower(addAllProVal) + return powerEndVal end end function this.GetAllTalismanByCondition(curTalismanData,upStarConFigData) diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroPowerManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroPowerManager.lua index b7e1022de1..4c5153fe8b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroPowerManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroPowerManager.lua @@ -29,20 +29,20 @@ local function CalculateWarForce2(powerVal) if v > 0 and i < HeroProType.WarPower then if propertyConfig[i].IfShow == 1 then if propertyConfig[i].TargetPropertyId == 0 then - basePower = basePower + v * propertyConfig[i].Score + basePower = basePower + v*propertyConfig[i].Score end elseif propertyConfig[i].IfShow == 2 then -- 这里百分比数要转换成小数,用于计算战斗力 - HighPower = HighPower + v/100 + HighPower = HighPower + v/100*propertyConfig[i].Score end - elseif v > 0 and i >= HeroProType.WarPower then + elseif v > 0 and i == HeroProType.WarPower then extPower = extPower + v end end LogBlue_Prop("basePower: "..basePower) LogBlue_Prop("HighPower: "..HighPower) LogBlue_Prop("extPower: "..extPower) - powerEndVal = basePower * (1 + HighPower / 2) + extPower + powerEndVal = basePower * (1 + HighPower) + extPower return math.floor(powerEndVal) end @@ -89,8 +89,7 @@ function this.InitAllPower() end -function this.CalPower(heroData, propList) - -- return CalculateWarForce(propList) +function this.CalPower(propList) return CalculateWarForce2(propList) end @@ -108,7 +107,7 @@ function this.GetHeroPower(dId, formationId, NoFuncProp) -- 重新计算人物属性 local propList = HeroPropManager.GetHeroProp(dId, formationId, NoFuncProp) -- 计算战斗力 - local allPower = this.CalPower(heroData, propList) + local allPower = this.CalPower(propList) -- 旧战斗力 if HeroPropManager.IsDebug() and not NoFuncProp then -- local curHeroData = HeroManager.GetSingleHeroData(dId) diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureManager.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureManager.lua index f431245a95..868d314cd7 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureManager.lua @@ -660,24 +660,8 @@ function this.CalculateWarForceBase(sId, lv, rlv, tlv,curTreasure) end end end - local heroPropertyScore = {} - for i, v in ConfigPairs(ConfigManager.GetConfig(ConfigName.PropertyConfig)) do - heroPropertyScore[i] = v.Score - end - local powerEndVal = 0 - for i, v in pairs(addAllProVal) do - if v > 0 then - local curProConfigData = ConfigManager.GetConfigData(ConfigName.PropertyConfig, i) - if curProConfigData then - if curProConfigData.Style == 1 then - powerEndVal = powerEndVal + v * heroPropertyScore[i] - else - powerEndVal = powerEndVal + v / 100 * heroPropertyScore[i] - end - end - end - end - return math.floor(powerEndVal) + local powerEndVal = HeroPowerManager.CalPower(addAllProVal) + return powerEndVal end end --获取宝物升级消耗