【战斗力】界面展示优化
parent
247d9a85d0
commit
e3f11c86ed
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
||||||
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
|
||||||
|
|
||||||
HeroPowerManager = {}
|
HeroPowerManager = {}
|
||||||
local this = HeroPowerManager
|
local this = HeroPowerManager
|
||||||
|
|
@ -88,36 +87,6 @@ end
|
||||||
|
|
||||||
|
|
||||||
function this.CalPower(heroData, propList)
|
function this.CalPower(heroData, propList)
|
||||||
-- body
|
|
||||||
local config = heroConfig[heroData.tId]
|
|
||||||
local subProp = config.SecondaryFactor
|
|
||||||
if subProp then
|
|
||||||
for i = 1, #subProp do
|
|
||||||
local propType = subProp[i][1]
|
|
||||||
local propValue = subProp[i][2]/100 -- 百分比数
|
|
||||||
if propList[propType] then
|
|
||||||
propList[propType] = propList[propType] - propValue
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 将百分比加成计算到人物身上
|
|
||||||
for k, v in pairs(propList) do
|
|
||||||
if k < HeroProType.WarPower then
|
|
||||||
local tpId = propertyConfig[k].TargetPropertyId
|
|
||||||
if propList[k] > 0 and tpId > 0 then
|
|
||||||
if k ~= 69 and k ~= 70 then--PVP 增减伤 没有处理
|
|
||||||
if not propList[tpId] then
|
|
||||||
propList[tpId] = 0
|
|
||||||
end
|
|
||||||
propList[tpId] = math.floor( propList[tpId] + propList[tpId] * propList[k] / 100)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
propList[k] = v
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- return CalculateWarForce(propList)
|
-- return CalculateWarForce(propList)
|
||||||
return CalculateWarForce2(propList)
|
return CalculateWarForce2(propList)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ LogGreenTable_Prop = _IsDebug and noZeroFunc(LogGreenTable) or emptyFunc
|
||||||
LogPinkTable_Prop = _IsDebug and noZeroFunc(LogPinkTable) or emptyFunc
|
LogPinkTable_Prop = _IsDebug and noZeroFunc(LogPinkTable) or emptyFunc
|
||||||
|
|
||||||
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
||||||
|
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||||
--
|
--
|
||||||
require("Modules.Hero.PropHero")
|
require("Modules.Hero.PropHero")
|
||||||
require("Modules.Hero.PropFunc")
|
require("Modules.Hero.PropFunc")
|
||||||
|
|
@ -191,6 +192,49 @@ function this.CreateHeroCountData(dId)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this.FinalShowDeal(heroData, propList)
|
||||||
|
|
||||||
|
-- 万分比转为百分比,这里处理用于兼容显示
|
||||||
|
for i, v in pairs(propList) do
|
||||||
|
if v > 0 and i < HeroProType.WarPower then
|
||||||
|
if propertyConfig[i].Style == 2 then
|
||||||
|
propList[i] = propList[i] / 100
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- 减去默认属性
|
||||||
|
local config = heroConfig[heroData.tId]
|
||||||
|
local subProp = config.SecondaryFactor
|
||||||
|
if subProp then
|
||||||
|
for i = 1, #subProp do
|
||||||
|
local propType = subProp[i][1]
|
||||||
|
local propValue = subProp[i][2]/100 -- 百分比数
|
||||||
|
if propList[propType] then
|
||||||
|
propList[propType] = propList[propType] - propValue
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 将百分比加成计算到人物基础数值上
|
||||||
|
for k, v in pairs(propList) do
|
||||||
|
if k < HeroProType.WarPower then
|
||||||
|
local tpId = propertyConfig[k].TargetPropertyId
|
||||||
|
if propList[k] > 0 and tpId > 0 then
|
||||||
|
if k ~= 69 and k ~= 70 then--PVP 增减伤 没有处理
|
||||||
|
if not propList[tpId] then
|
||||||
|
propList[tpId] = 0
|
||||||
|
end
|
||||||
|
propList[tpId] = math.floor( propList[tpId] + propList[tpId] * propList[k] / 100)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
propList[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return propList
|
||||||
|
end
|
||||||
|
|
||||||
-- 获取神将属性
|
-- 获取神将属性
|
||||||
function this.GetHeroProp(dId, formationId, NoFuncProp)
|
function this.GetHeroProp(dId, formationId, NoFuncProp)
|
||||||
-- 清空数据
|
-- 清空数据
|
||||||
|
|
@ -262,18 +306,14 @@ function this.GetHeroProp(dId, formationId, NoFuncProp)
|
||||||
DoubleTableCompound(allPropList, conTeamProp)
|
DoubleTableCompound(allPropList, conTeamProp)
|
||||||
-- 没有元素共鸣
|
-- 没有元素共鸣
|
||||||
end
|
end
|
||||||
|
-- 处理前属性
|
||||||
-- 万分比转为百分比,这里处理用于兼容显示
|
|
||||||
for i, v in pairs(allPropList) do
|
|
||||||
if v > 0 and i < HeroProType.WarPower then
|
|
||||||
if propertyConfig[i].Style == 2 then
|
|
||||||
allPropList[i] = allPropList[i] / 100
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Log_Prop("总属性")
|
Log_Prop("总属性")
|
||||||
LogGreenTable_Prop(allPropList)
|
LogGreenTable_Prop(allPropList)
|
||||||
|
-- 用于显示和战斗计算的处理
|
||||||
|
allPropList = this.FinalShowDeal(this.HeroDataList[dId], allPropList)
|
||||||
|
-- 处理后属性
|
||||||
|
Log_Prop("处理后属性")
|
||||||
|
LogGreenTable_Prop(allPropList)
|
||||||
return allPropList
|
return allPropList
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue