diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/Skill/FaLingManager.lua b/Assets/ManagedResources/~Lua/Modules/Guild/Skill/FaLingManager.lua index db9bc2d105..961fd22bbe 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/Skill/FaLingManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/Skill/FaLingManager.lua @@ -216,6 +216,51 @@ function this.GetEquipAddPropByDid(_did) return addProp end +function this.GetEquipAddSkill(_did) + if not this.allEquipData[_did] then + return {} + end + local staticId=this.allEquipData[_did].staticId + local lvList=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.EquipTalismana,"TalismanaId",staticId) + local lv=this.allEquipData[_did].lv + local skillList={} + local curHeroData=nil + if this.allEquipData[_did].belongHero then + curHeroData=HeroManager.GetSingleHeroData(this.allEquipData[_did].belongHero) + end + local curStar=0 + for i=1,#lvList do + if lvList[i].ShowSkill and #lvList[i].ShowSkill>0 and tonumber(lvList[i].ShowSkill[1])~=nil then + + + local type=lvList[i].ShowSkill[1] + if type==0 then + if lv>=lvList[i].Level then + table.insert(skillList,lvList[i].ShowSkill[3]) + end + elseif type==1 then + if lv>=lvList[i].Level and curHeroData and curHeroData.heroConfig.Profession==lvList[i].ShowSkill[2] then + table.insert(skillList,lvList[i].ShowSkill[3]) + end + + elseif type==2 then + --LogError("lv=========="..lv.." lvList[i].Level=="..lvList[i].Level.." self.curHeroData.staticId=="..self.curHeroData.staticId.." lvList[i].ShowSkill[2]=="..lvList[i].ShowSkill[2]) + if lv>=lvList[i].Level and curHeroData and curHeroData.heroConfig.Id==lvList[i].ShowSkill[2] then + table.insert(skillList,lvList[i].ShowSkill[3]) + end + + end + + end + + end + return skillList +end + + + + + function this.SetEquipBelongHero(_did,_heroId) diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua index b130ac6923..f85dfab6be 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua @@ -261,7 +261,32 @@ function this.SetHeroTraining(dyn,data) heroDatas[dyn].HeroTraining=data end end - +function this.GetHeroTrainPassiveSkill(_idDyn) + + if heroDatas[_idDyn] then + local hero=heroDatas[_idDyn] + local trainLv=hero.HeroTraining.trainingLv + if trainLv>0 then + local list=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.Train,"HeroID",hero.heroConfig.Id) + local skillId={} + if list then + local unlockList=hero.HeroTraining.unlockIds + for k, v in pairs(list) do + if CheckListIsContainValue1(unlockList,v.Id) and trainLv>=v.Level and v.PassiveSkill and #v.PassiveSkill>=1 and type(v.PassiveSkill[1])~="userdata" then + for i=1,#v.PassiveSkill do + table.insert(skillId,v.PassiveSkill[i]) + end + end + end + return skillId + -- for i, v in ConfigPairs(list) do + + -- end + end + end + end + return {} +end function this.SetPotentialData(msg,dyn) @@ -4307,7 +4332,7 @@ function this.GetHeroPotencyAddByType(_dyn,_type) if heroDatas[_dyn] and heroDatas[_dyn].potential and heroDatas[_dyn].potential[_type] then local poten=heroDatas[_dyn].potential[_type] local allLv=poten.lv+poten.giftLv --+TianShuMiJuanManger.GetAddPotentialLV() - LogError("poten.lv====="..poten.lv.." poten.giftLv=="..poten.giftLv.." TianShuMiJuanManger.GetAddPotentialLV()=="..TianShuMiJuanManger.GetAddPotentialLV()) + --LogError("poten.lv====="..poten.lv.." poten.giftLv=="..poten.giftLv.." TianShuMiJuanManger.GetAddPotentialLV()=="..TianShuMiJuanManger.GetAddPotentialLV()) local config=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PotentialNew,"Type",_type,"Level",allLv) if config then local pro=config.Attribute/10000 diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/PropHero.lua b/Assets/ManagedResources/~Lua/Modules/Hero/PropHero.lua index 067764bfde..1c1d1bea8d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/PropHero.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/PropHero.lua @@ -451,7 +451,33 @@ Hero_Prop_Func = { [Hero_Prop_Type.Talisman] = function(_heroData) local addAllProVal = {} --LogError("get 法灵添加的属性========================================") - addAllProVal = FaLingManager.GetEquipAddPropByDid(_heroData.baublesId) + + + + local allAddPro={} + local propList, conPropList, teamPropList, conTeamPropList, dePropList + --LogError("计算英雄法相 属性 被动属性") + allAddPro=FaLingManager.GetEquipAddPropByDid(_heroData.baublesId) + local skills=FaLingManager.GetEquipAddSkill(_heroData.baublesId) + -- for i=1,#skills do + -- LogError("法宝 skillid============================================="..skills[i]) + -- end + --被动技能计算 + if skills and #skills > 0 then --talismanConFig.OpenSkillRules and #talismanConFig.OpenSkillRules > 0 then + --单体加成 --单体等级限制加成 --团体加成 --减乘 + propList, conPropList, teamPropList, conTeamPropList, dePropList = PassiveListToPropList(skills) + end + + if propList and LengthOfTable(propList) > 0 then + for i,v in pairs(propList) do + if allAddPro[i] then + allAddPro[i] = allAddPro[i] + v + else + allAddPro[i] = v + end + end + end + return allAddPro, conPropList, teamPropList, conTeamPropList, dePropList -- local propList, conPropList, teamPropList, conTeamPropList, dePropList -- local star = _heroData.star -- local profession = heroConfig[_heroData.tId].Profession @@ -515,7 +541,7 @@ Hero_Prop_Func = { -- for k, v in pairs(addAllProVal) do -- LogError("法宝 k==================="..k.." v==="..v) -- end - return addAllProVal--, conPropList, teamPropList, conTeamPropList, dePropList + --return addAllProVal--, conPropList, teamPropList, conTeamPropList, dePropList end, -- 魂印 @@ -733,13 +759,41 @@ Hero_Prop_Func = { return allAddPro, conPropList, teamPropList, conTeamPropList, dePropList end, [Hero_Prop_Type.Training] = function(_heroData) - local addPro=HeroManager.GetHeroTrainingAddPro(_heroData.dId) - if addPro==nil or #addPro==0 then - return nil - end - -- for key, value in pairs(addPro) do - -- LogError("Training key==="..key.." value=="..value) + -- local addPro=HeroManager.GetHeroTrainingAddPro(_heroData.dId) + -- if addPro==nil or #addPro==0 then + -- return nil -- end - return addPro + -- local data=HeroManager.GetSingleHeroData(_heroData.dId) + -- local skillList=HeroManager.GetHeroTrainPassiveSkill(_heroData.dId) + -- for key, value in pairs(addPro) do + -- LogError("Training key==="..key.." value=="..value.." _heroData.h"..data.heroConfig.ReadingName) + -- end + --return {} + + local allAddPro={} + local propList, conPropList, teamPropList, conTeamPropList, dePropList + --LogError("计算英雄法相 属性 被动属性") + allAddPro=HeroManager.GetHeroTrainingAddPro(_heroData.dId) + local skills=HeroManager.GetHeroTrainPassiveSkill(_heroData.dId) + -- for i=1,#skills do + -- LogError("train skillid============================================="..skills[i]) + -- end + --被动技能计算 + if skills and #skills > 0 then --talismanConFig.OpenSkillRules and #talismanConFig.OpenSkillRules > 0 then + --单体加成 --单体等级限制加成 --团体加成 --减乘 + propList, conPropList, teamPropList, conTeamPropList, dePropList = PassiveListToPropList(skills) + + end + + if propList and LengthOfTable(propList) > 0 then + for i,v in pairs(propList) do + if allAddPro[i] then + allAddPro[i] = allAddPro[i] + v + else + allAddPro[i] = v + end + end + end + return allAddPro, conPropList, teamPropList, conTeamPropList, dePropList end, } \ No newline at end of file