parent
9da6a42947
commit
0e86945c53
|
@ -599,8 +599,6 @@ function this.EquipTreasureBuildRequest(_IdDyn, _type,_mats,func)
|
|||
if func then
|
||||
func(msg)
|
||||
end
|
||||
-- 宝物属性改变需要重新计算战斗力
|
||||
EquipTreasureManager.SetTreasureDirty(_IdDyn, true)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ local jewerLevelUpConfig = ConfigManager.GetConfig(ConfigName.JewelRankupConfig)
|
|||
|
||||
local EquipTreasureData = require("Modules.RoleInfo.EquipTreasureData")
|
||||
function this.Initialize()
|
||||
this.TreasurePowerData = {}
|
||||
end
|
||||
--初始化所有宝器数据
|
||||
function this.InitAllEquipTreasure(_equipData)
|
||||
|
@ -525,65 +524,21 @@ end
|
|||
|
||||
--计算战斗力
|
||||
function this.CalculateWarForce(Did)
|
||||
-- Log("CalculateWarForce "..Did)
|
||||
local power = 0
|
||||
if this.IsTreasureDirty(Did) then
|
||||
local curTreasure = allTreasures[Did]
|
||||
if not curTreasure then
|
||||
curTreasure = MonsterCampManager.GetSingleTreasureByIdDyn(Did)
|
||||
end
|
||||
if not curTreasure then
|
||||
curTreasure = ExpeditionManager.GetSingleTreasureByIdDyn(Did)
|
||||
end
|
||||
if not curTreasure then
|
||||
curTreasure = GoodFriendManager.GetSingleTreasureByIdDyn(Did)
|
||||
end
|
||||
if curTreasure then
|
||||
power = this.CalculateWarForceBase(curTreasure.id, curTreasure.lv, curTreasure.refineLv, curTreasure.treeLv,curTreasure)
|
||||
end
|
||||
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
|
||||
local curTreasure = allTreasures[Did]
|
||||
if not curTreasure then
|
||||
curTreasure = MonsterCampManager.GetSingleTreasureByIdDyn(Did)
|
||||
end
|
||||
return power
|
||||
if not curTreasure then
|
||||
curTreasure = ExpeditionManager.GetSingleTreasureByIdDyn(Did)
|
||||
end
|
||||
if not curTreasure then
|
||||
curTreasure = GoodFriendManager.GetSingleTreasureByIdDyn(Did)
|
||||
end
|
||||
if curTreasure then
|
||||
return this.CalculateWarForceBase(curTreasure.id, curTreasure.lv, curTreasure.refineLv, curTreasure.treeLv,curTreasure)
|
||||
end
|
||||
return 0
|
||||
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)
|
||||
-- LogGreen("sId:"..sId.." lv:"..lv.." rlv:"..rlv.." tlv:"..tlv)
|
||||
local curEuipTreaSureConfig = ConfigManager.GetConfigData(ConfigName.JewelConfig, sId)
|
||||
|
|
Loading…
Reference in New Issue