Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev

dev_chengFeng
yuanshuai 2021-09-22 15:13:12 +08:00
commit b145159311
2 changed files with 60 additions and 13 deletions

View File

@ -599,6 +599,8 @@ function this.EquipTreasureBuildRequest(_IdDyn, _type,_mats,func)
if func then if func then
func(msg) func(msg)
end end
-- 宝物属性改变需要重新计算战斗力
EquipTreasureManager.SetTreasureDirty(_IdDyn, true)
end) end)
end end

View File

@ -8,6 +8,7 @@ local jewerLevelUpConfig = ConfigManager.GetConfig(ConfigName.JewelRankupConfig)
local EquipTreasureData = require("Modules.RoleInfo.EquipTreasureData") local EquipTreasureData = require("Modules.RoleInfo.EquipTreasureData")
function this.Initialize() function this.Initialize()
this.TreasurePowerData = {}
end end
--初始化所有宝器数据 --初始化所有宝器数据
function this.InitAllEquipTreasure(_equipData) function this.InitAllEquipTreasure(_equipData)
@ -524,6 +525,9 @@ end
--计算战斗力 --计算战斗力
function this.CalculateWarForce(Did) function this.CalculateWarForce(Did)
-- Log("CalculateWarForce "..Did)
local power = 0
if this.IsTreasureDirty(Did) then
local curTreasure = allTreasures[Did] local curTreasure = allTreasures[Did]
if not curTreasure then if not curTreasure then
curTreasure = MonsterCampManager.GetSingleTreasureByIdDyn(Did) curTreasure = MonsterCampManager.GetSingleTreasureByIdDyn(Did)
@ -535,10 +539,51 @@ function this.CalculateWarForce(Did)
curTreasure = GoodFriendManager.GetSingleTreasureByIdDyn(Did) curTreasure = GoodFriendManager.GetSingleTreasureByIdDyn(Did)
end end
if curTreasure then if curTreasure then
return this.CalculateWarForceBase(curTreasure.id, curTreasure.lv, curTreasure.refineLv, curTreasure.treeLv,curTreasure) power = this.CalculateWarForceBase(curTreasure.id, curTreasure.lv, curTreasure.refineLv, curTreasure.treeLv,curTreasure)
end end
return 0 this.SetTreasurePower(Did, power)
this.SetTreasureDirty(Did, false)
else
if this.TreasurePowerData and this.TreasurePowerData[Did] then
power = this.TreasurePowerData[Did].power or 0
end end
end
return power
end
-- 判断脏数据
function this.IsTreasureDirty(dId)
if not this.TreasurePowerData then
this.TreasurePowerData = {}
end
if not this.TreasurePowerData[dId] then
this.TreasurePowerData[dId] = {}
end
return this.TreasurePowerData[dId].isDirty ~= false
end
-- 设置脏数据
function this.SetTreasureDirty(dId, isDirty)
if not this.TreasurePowerData then
this.TreasurePowerData = {}
end
if not this.TreasurePowerData[dId] then
this.TreasurePowerData[dId] = {}
end
this.TreasurePowerData[dId].isDirty = isDirty ~= false
end
-- 设置宝物战斗力
function this.SetTreasurePower(dId, power)
if not this.TreasurePowerData then
this.TreasurePowerData = {}
end
if not this.TreasurePowerData[dId] then
this.TreasurePowerData[dId] = {}
end
this.TreasurePowerData[dId].power = power or 0
end
function this.CalculateWarForceBase(sId, lv, rlv, tlv,curTreasure) function this.CalculateWarForceBase(sId, lv, rlv, tlv,curTreasure)
-- LogGreen("sId:"..sId.." lv:"..lv.." rlv:"..rlv.." tlv:"..tlv) -- LogGreen("sId:"..sId.." lv:"..lv.." rlv:"..rlv.." tlv:"..tlv)
local curEuipTreaSureConfig = ConfigManager.GetConfigData(ConfigName.JewelConfig, sId) local curEuipTreaSureConfig = ConfigManager.GetConfigData(ConfigName.JewelConfig, sId)