From f1a296ec06861fd583ddc67c6b838f7e721503ce Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Mon, 25 Jan 2021 18:14:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E6=88=98=E5=8A=9B=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E3=80=91=20=E9=AD=82=E5=8D=B0=20=E5=85=AC=E4=BC=9A?= =?UTF-8?q?=E6=8A=80=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Guild/Skill/GuildSkillManager.lua | 2 + .../Guild/Skill/GuildSkillUpLvPopup.lua | 6 +- .../~Lua/Modules/Hero/HeroManager.lua | 6 +- .../~Lua/Modules/Hero/HeroPowerManager.lua | 22 +++++--- .../~Lua/Modules/Hero/PropHero.lua | 55 ++++++++++++++++++- .../~Lua/Modules/Net/NetManager.lua | 18 +++++- 6 files changed, 90 insertions(+), 19 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/Skill/GuildSkillManager.lua b/Assets/ManagedResources/~Lua/Modules/Guild/Skill/GuildSkillManager.lua index 40e66b4136..71a602d9e4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/Skill/GuildSkillManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/Skill/GuildSkillManager.lua @@ -28,6 +28,8 @@ function this.InitData(msg) this.InitSingleData(msg.skill[i].type,j,curLv) end end + --设置战斗力脏数据 + HeroPropManager.SetFuncPropDirty(Func_Prop_Type.GuildSkill) end --连续升级后端回复 更新前端等级 function this.LongLvUpClickBackFun(msg) diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/Skill/GuildSkillUpLvPopup.lua b/Assets/ManagedResources/~Lua/Modules/Guild/Skill/GuildSkillUpLvPopup.lua index 6babdc073e..f0268f1291 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/Skill/GuildSkillUpLvPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/Skill/GuildSkillUpLvPopup.lua @@ -118,7 +118,6 @@ function GuildSkillUpLvPopup:BindEvent() GuildSkillManager.ResetGuildSkillData(curIndexChangeFun[curIndex]) this.OnClickTabBtn(curIndex,true) this.RefreshTabRedPoint() - Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) oldWarPowerValue = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL) end) end) @@ -303,10 +302,8 @@ function this.LongLvUpClick(oldLv) newWarPowerValue = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL) if oldWarPowerValue ~= newWarPowerValue then UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPowerValue,newValue = newWarPowerValue}) - Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) oldWarPowerValue = newWarPowerValue end - Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) end) end --升级按钮点击事件处理 @@ -344,10 +341,9 @@ function this.LvUpClick(isSingleLvUp) newWarPowerValue = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL) if oldWarPowerValue ~= newWarPowerValue then UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPowerValue,newValue = newWarPowerValue}) - Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) oldWarPowerValue = newWarPowerValue end - Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) + Game.GlobalEvent:DispatchEvent() -- CheckRedPointStatus(RedPointType.Guild_Skill) end) else diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua index e0c2cc6209..1cb1290c43 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua @@ -514,7 +514,7 @@ function this.UpdateSingleHeroDatas(heroDId, heroLv, heroStar, breakId, upStarId ) PlayerManager.SetHeroHandBookListData(heroDatas[heroDId].id, heroDatas[heroDId].star) end - + --设置战斗力脏数据 -- 英雄基础数据变化 HeroPropManager.SetDirtyByType(heroDId, Hero_Prop_Type.Base) HeroPropManager.SetDirtyByType(heroDId, Hero_Prop_Type.PassiveSkill) @@ -2573,6 +2573,8 @@ function this.AddSoulPrintUpHeroDynamicId(heroDid, soulPrintSid, soulPrintPos) local singleSoulPrint = {equipId = soulPrintSid, position = soulPrintPos} table.insert(heroDatas[heroDid].soulPrintList, singleSoulPrint) SoulPrintManager.AddSoulPrintUpHeroDynamicId(soulPrintSid, heroDid) + --设置战斗力脏数据 + HeroPropManager.SetDirtyByType(heroDid, Hero_Prop_Type.SoulPrint) end end --删除魂印装备的英雄did @@ -2582,6 +2584,8 @@ function this.DelSoulPrintUpHeroDynamicId(heroDid, soulPrintSid) if heroDatas[heroDid].soulPrintList[i] and heroDatas[heroDid].soulPrintList[i].equipId == soulPrintSid then table.remove(heroDatas[heroDid].soulPrintList, i) SoulPrintManager.DelSoulPrintUpHeroDynamicId(soulPrintSid, heroDid) + --设置战斗力脏数据 + HeroPropManager.SetDirtyByType(heroDid, Hero_Prop_Type.SoulPrint) end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroPowerManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroPowerManager.lua index 9aef8675cb..4f7eb7d1f5 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroPowerManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroPowerManager.lua @@ -10,7 +10,7 @@ local propToSS = {} local function CalculateWarForce(powerVal) local powerEndVal = 0 for i, v in pairs(powerVal) do - if v > 0 then + if v > 0 and i < HeroProType.WarPower then if not propToSS[i] then propToSS[i] = {Style = propertyConfig[i].Style, Score = propertyConfig[i].Score, TargetPropertyId = propertyConfig[i].TargetPropertyId} end @@ -21,6 +21,8 @@ local function CalculateWarForce(powerVal) power = power / 100 end powerEndVal = powerEndVal + power + elseif v > 0 and i >= HeroProType.WarPower then + powerEndVal = powerEndVal + v end end return math.floor(powerEndVal) @@ -85,13 +87,17 @@ function this.CalPower(heroData, propList) -- 将百分比加成计算到人物身上 for k, v in pairs(propList) do - if not propToSS[k] then - local config = propertyConfig[k] - propToSS[k] = {Style = config.Style, Score = config.Score, TargetPropertyId = config.TargetPropertyId} - end - local tpId = propToSS[k].TargetPropertyId - if propList[k] > 0 and tpId > 0 then - propList[tpId] = math.floor( propList[tpId] + propList[tpId] * propList[k] / 10000) + if k < HeroProType.WarPower then + if not propToSS[k] then + local config = propertyConfig[k] + propToSS[k] = {Style = config.Style, Score = config.Score, TargetPropertyId = config.TargetPropertyId} + end + local tpId = propToSS[k].TargetPropertyId + if propList[k] > 0 and tpId > 0 then + propList[tpId] = math.floor( propList[tpId] + propList[tpId] * propList[k] / 10000) + end + else + propList[k] = v end end LogPinkTable(propList) diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/PropHero.lua b/Assets/ManagedResources/~Lua/Modules/Hero/PropHero.lua index 7f10888cf0..3ef6e81a81 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/PropHero.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/PropHero.lua @@ -410,9 +410,58 @@ Hero_Prop_Func = { end end end - local allAddProVal = {} - allAddProVal[HeroProType.WarPower] = allSoulPrintAddWarPowerVal - return allAddProVal + -- local allAddProVal = {} + -- allAddProVal[HeroProType.WarPower] = allSoulPrintAddWarPowerVal + -- return allAddProVal + + + local addAllProVal = {} + local propList, conPropList, teamPropList, conTeamPropList, dePropList + local allPassiveSkill = {} + local curHeroData =_heroData + if curHeroData then + if(table.nums(curHeroData.soulPrintList) >= 1) then + for i = 1, #curHeroData.soulPrintList do + local cursoulPrintConfig = equipConfig[curHeroData.soulPrintList[i].equipId] + if cursoulPrintConfig then + --基础属性计算 + local soulPrintPropertyList = cursoulPrintConfig.Property + if soulPrintPropertyList and #soulPrintPropertyList > 0 then + for i,v in pairs(soulPrintPropertyList) do + if(addAllProVal[v[1]]) then + addAllProVal[v[1]]=v[2]+addAllProVal[v[1]] + else + addAllProVal[v[1]]=v[2] + end + end + end + --被动技能计算 + if cursoulPrintConfig.PassiveSkill and #cursoulPrintConfig.PassiveSkill > 0 then + for j = 1, #cursoulPrintConfig.PassiveSkill do + table.insert(allPassiveSkill,cursoulPrintConfig.PassiveSkill[j]) + end + end + end + end + end + end + --被动技能计算 + if allPassiveSkill and #allPassiveSkill > 0 then --talismanConFig.OpenSkillRules and #talismanConFig.OpenSkillRules > 0 then + --单体加成 --单体等级限制加成 --团体加成 --减乘 + propList, conPropList, teamPropList, conTeamPropList, dePropList = PassiveListToPropList(allPassiveSkill) + end + + if propList and LengthOfTable(propList) > 0 then + for i,v in pairs(propList) do + if addAllProVal[i] then + addAllProVal[i] = addAllProVal[i] + v + else + addAllProVal[i] = v + end + end + end + addAllProVal[HeroProType.WarPower] = allSoulPrintAddWarPowerVal + return addAllProVal, conPropList, teamPropList, conTeamPropList, dePropList end, diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 6628a14b1c..4916b000bf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -528,7 +528,11 @@ function this.EquipWearRequest(_heroId, _equipIds,_type, func) --local msg = HeroInfoProto_pb.GetAllEquipResponse() --msg:ParseFromString(data) --设置战斗力脏数据 - HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip) + if _type == 1 then + HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip) + else + HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.EquipTreasure) + end if func then func(msg) end @@ -548,7 +552,11 @@ function this.EquipUnLoadOptRequest(_heroId, _equipIds, _type,func) --local msg = HeroInfoProto_pb.GetAllEquipResponse() --msg:ParseFromString(data) --设置战斗力脏数据 - HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip) + if _type == 1 then + HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip) + else + HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.EquipTreasure) + end if func then func(msg) end @@ -3871,6 +3879,9 @@ function NetManager.SinGleGuildSkillUpLv(profession,beforeLevel,afterLevel,func) if func then func(msg) end + --设置战斗力脏数据 + HeroPropManager.SetFuncPropDirty(Func_Prop_Type.GuildSkill) + Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) end) end --公会技能重置 @@ -3885,6 +3896,9 @@ function NetManager.ResetGuildSkillRequest(type,func) if func then func(msg) end + --设置战斗力脏数据 + HeroPropManager.SetFuncPropDirty(Func_Prop_Type.GuildSkill) + Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName) end) end