From 0e86945c5324882ec9847cbf39936ea1f3f3c6df Mon Sep 17 00:00:00 2001 From: gaoxin Date: Sat, 18 Sep 2021 10:56:55 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A3=85=E5=A4=87=E7=95=8C=E9=9D=A2=E5=8D=A1?= =?UTF-8?q?=E9=A1=BF=EF=BC=8C=E4=B8=80=E9=94=AE=E5=8D=B8=E4=B8=8B/?= =?UTF-8?q?=E8=A3=85=E5=A4=87=E5=8D=A1=E9=A1=BF=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cb4c81b42071119b9f16f4f8b09a9a85dac51814. --- .../~Lua/Modules/Net/NetManager.lua | 2 - .../Modules/RoleInfo/EquipTreasureManager.lua | 71 ++++--------------- 2 files changed, 13 insertions(+), 60 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 1b56379a40..04217055c0 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -599,8 +599,6 @@ function this.EquipTreasureBuildRequest(_IdDyn, _type,_mats,func) if func then func(msg) end - -- 宝物属性改变需要重新计算战斗力 - EquipTreasureManager.SetTreasureDirty(_IdDyn, true) end) end diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureManager.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureManager.lua index 2fa4343018..9ff76e992b 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureManager.lua @@ -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)