战斗力修改

ShaoNv
wangzhenxing 2024-07-18 11:55:57 +08:00 committed by PC-202302260912\Administrator
parent d25cab0c5f
commit 1e1b819b78
3 changed files with 205 additions and 39 deletions

View File

@ -253,6 +253,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)

View File

@ -187,6 +187,7 @@ function this.UpdateHeroDatas(_msgHeroData, isFindHandBook)
heroData.name = GetLanguageStrById(_configData.ReadingName)
heroData.property = heroData.changeProId
heroData.sortId = #heroDatas + 1
---↓↓↓↓↓↓↓↓↓↓↓摘星阁
heroData.equipStrong={}
for i = 1, #_msgHeroData.equipStrong do
@ -260,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)
@ -373,7 +399,7 @@ function this.ResetHeroPotentialData(_did)
heroDatas[_did].potential={}
heroDatas[_did].potential[1]={}
heroDatas[_did].potential[1].lv=1
heroDatas[_did].potential[1].giftLv=0
heroDatas[_did].potential[1].giftLv=TianShuMiJuanManger.GetAddPotentialLV()
end
end
@ -561,6 +587,32 @@ function this.GetAllHeroDatas(_lvLimit)
)
return heros
end
--获取所有英雄信息
function this.GetHeroDatasByNaturalAndProfession(_qua,_pro)
local heros = {}
for i, v in pairs(heroDatas) do
if v.heroConfig.Natural == _qua and v.heroConfig.PropertyName==_pro and CheckListIsContainValue1(HelpFightManager.upHeroList,v.dynamicId)==false then
table.insert(heros, v)
end
end
table.sort(
heros,
function(a, b)
if a.star == b.star then
return a.lv>b.lv
else
return a.star > b.star
end
end
)
return heros
end
--获取该静态id sortid最小的英雄信息
function this.GetHeroDataByHeroSIdAndMinSortId(_heroSId)
local heroData = {}
@ -731,7 +783,15 @@ function this.GetHeroFormationStr(teamId)
elseif teamId == FormationTypeDef.ARENA_TOM_MATCH then
return Language[11104]
elseif teamId == FormationTypeDef.JUMPSERVER_HIGHTLADDER then
return"该英雄在罗浮争锋阵容中已上阵"
return"该神将在罗浮争锋阵容中已上阵"
elseif teamId == FormationTypeDef.LuoFuZhengFeng1 then
return"该神将在罗浮争锋阵容中已上阵"
elseif teamId == FormationTypeDef.LuoFuZhengFeng2 then
return"该神将在罗浮争锋阵容中已上阵"
elseif teamId == FormationTypeDef.LuoFuZhengFeng3 then
return"该神将在罗浮争锋阵容中已上阵"
elseif teamId == FormationTypeDef.LuoFuZhengFeng4 then
return"该神将在罗浮争锋阵容中已上阵"
end
end
return ""
@ -757,7 +817,15 @@ function this.GetHeroFormationStr2(teamId)
elseif teamId == FormationTypeDef.ARENA_TOM_MATCH then
return Language[11110], FormationTypeDef.ARENA_TOM_MATCH
elseif teamId == FormationTypeDef.JUMPSERVER_HIGHTLADDER then
return "鸟笼竞技场", FormationTypeDef.JUMPSERVER_HIGHTLADDER
return "罗浮争锋", FormationTypeDef.JUMPSERVER_HIGHTLADDER
elseif teamId == FormationTypeDef.LuoFuZhengFeng1 then
return "罗浮争锋", FormationTypeDef.LuoFuZhengFeng1
elseif teamId == FormationTypeDef.LuoFuZhengFeng2 then
return "罗浮争锋", FormationTypeDef.LuoFuZhengFeng2
elseif teamId == FormationTypeDef.LuoFuZhengFeng3 then
return "罗浮争锋", FormationTypeDef.LuoFuZhengFeng3
elseif teamId == FormationTypeDef.LuoFuZhengFeng4 then
return "罗浮争锋", FormationTypeDef.LuoFuZhengFeng4
end
end
return ""
@ -1230,7 +1298,6 @@ function this.UpdateHeroLvEnd()
if heroEndStar == nil then
heroEndStar = v.Star
end
-- LogError("heroEndStar================="..heroEndStar)
for i, v2 in ConfigPairs(heroRankUpConfig) do
if v2.Star == v.Star then
if v2.OpenStar == heroEndStar then
@ -1379,6 +1446,7 @@ local function CalculateHeroUpEquipsProAddVal(_heroId)
addAllProVal[curProId] = curProVal
end
end
end
end
end
@ -1674,6 +1742,7 @@ local function CalculateEquipTreaSureAddVal(_heroId)
else
mainRefineLv = curEuipTreaSureData.refineLv
end
LogError("curEuipTreaSureData.refineLv=="..curEuipTreaSureData.refineLv)
end
end
end
@ -1737,7 +1806,7 @@ local function CalculateEquipTreaSureAddVal(_heroId)
end
end
end
return addAllProVal
end
@ -2193,16 +2262,16 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt
LogRedTable_Prop(falismanAllHeroProVal)
--魂印的属性加成
local singleHeroSoulPrintProVal,lvSoulPrintProVal,allHeroSoulPrintProVal,specialSoulPrintProVal = CalculateSoulPrintAddVal(curHeroData.dynamicId)
LogRed_Prop("魂印单体加成")
LogRed_Prop("法术单体加成")
LogRedTable_Prop(singleHeroSoulPrintProVal)
LogRed_Prop("魂印100+加成")
LogRed_Prop("法术100+加成")
LogRedTable_Prop(lvSoulPrintProVal)
LogRed_Prop("魂印团体加成")
LogRed_Prop("法术团体加成")
LogRedTable_Prop(allHeroSoulPrintProVal)
LogRed_Prop("魂印特殊加成")
LogRed_Prop("法术特殊加成")
LogRedTable_Prop(specialSoulPrintProVal)
local allSoulPrintAddWarPowerVal = CalculateSoulPrintAddVal2(curHeroData.dynamicId)
LogRed_Prop("魂印战斗力加成 "..allSoulPrintAddWarPowerVal)
LogRed_Prop("法术战斗力加成 "..allSoulPrintAddWarPowerVal)
--宝器加成 宝器本身属性 + 宝器激活的强化共鸣 和 精炼共鸣
local equipTreasureAddPro = CalculateEquipTreaSureAddVal(curHeroData.dynamicId)
@ -2259,9 +2328,9 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt
local heroFetterAddPro = TianShuMiJuanManger.GetAllFetterAddProsBy(1)
LogRed_Prop("神将羁绊 最终 加成 ")
LogRedTable_Prop(heroFetterAddPro)
--魂印羁绊
--法术羁绊
local hunyinFetterAddPro = TianShuMiJuanManger.GetAllFetterAddProsBy(2)
LogRed_Prop("魂印羁绊 最终 加成 ")
LogRed_Prop("法术羁绊 最终 加成 ")
LogRedTable_Prop(hunyinFetterAddPro)
--灵兽羁绊单加战力 暂时去掉
-- local allPokemonFetterAddWarPowerVal = PokemonManager.GetAllPokemonFetterAddProsSWarPower()--allSoulPrintAddWarPowerVal--
@ -3390,7 +3459,8 @@ function this.GetAllPassiveSkillIds(heroConfig, breakId, upStarId)
--只用于界面升星开放技能提示显示用
local compoundNum = 0
local compoundOPenNum = 0
local OpenPassiveSkillRules = (upStarId and upStarId ~=0 and heroRankUpConfig[upStarId].OpenStar >= this.awakeNextStarIndex) and heroConfig.Awaken or heroConfig.OpenPassiveSkillRules
local OpenPassiveSkillRules = nil
OpenPassiveSkillRules =(upStarId and upStarId ~=0 and heroRankUpConfig[upStarId] and heroRankUpConfig[upStarId].OpenStar >= this.awakeNextStarIndex) and heroConfig.Awaken or heroConfig.OpenPassiveSkillRules
OpenPassiveSkillRules=GetPassiveByMaxStar(heroConfig,OpenPassiveSkillRules)
if OpenPassiveSkillRules then
for i = 1, #OpenPassiveSkillRules do
@ -3400,19 +3470,19 @@ function this.GetAllPassiveSkillIds(heroConfig, breakId, upStarId)
table.insert(allPassiveSkillIds, OpenPassiveSkillRules[i][3])
if allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] then
allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] =
allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] + 1
allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] + 1
else
allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] = 1
end
end
else --升星
allUpStarOpenData[heroRankUpConfig[OpenPassiveSkillRules[i][2]].Phase[2]] =
OpenPassiveSkillRules[i]
OpenPassiveSkillRules[i]
if upStarId >= OpenPassiveSkillRules[i][2] then
table.insert(allPassiveSkillIds, OpenPassiveSkillRules[i][3])
if allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] then
allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] =
allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] + 1
allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] + 1
else
allOpenPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] = 1
end
@ -3420,12 +3490,13 @@ function this.GetAllPassiveSkillIds(heroConfig, breakId, upStarId)
end
if allPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] then
allPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] =
allPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] + 1
allPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] + 1
else
allPassiveSkillIdcompound[OpenPassiveSkillRules[i][2]] = 1
end
end
end
for i, v in pairs(allPassiveSkillIdcompound) do
if v > 1 then
compoundNum = compoundNum + v - 1
@ -3654,10 +3725,10 @@ end
--获取某一个星级的所有英雄
function this.GetAllNumStarData(star)
local heros = {}
local heros2 = {}
local heros2 = FormationManager.GetAllFormationHeroId()
for i, v in pairs(heroDatas) do
if v.star==star then
table.insert(heros, v)
if v.star==star and heros2[i]==nil then
table.insert(heros, v)
end
end
@ -4260,8 +4331,8 @@ end
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
--LogError("poten.lv====="..poten.lv.." poten.giftLv=="..poten.giftLv)
local allLv=poten.lv+poten.giftLv --+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
@ -4275,7 +4346,7 @@ end
function this.GetHeroPotencyAddByTypeAndPotencyData(_data,_type)
if _data and _type and _data[_type] then
local aaa=_data[_type]
local allLv=aaa.lv+aaa.giftLv
local allLv=aaa.lv+aaa.giftLv--+TianShuMiJuanManger.GetAddPotentialLV()
local config=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PotentialNew,"Type",_type,"Level",allLv)
if config then
local pro=config.Attribute/10000
@ -4517,14 +4588,10 @@ end
--根据界面数据加载动态立绘
function this.LoadHerolive(_heroData, _objPoint)
--TODO:动态加载立绘
local t=_heroData.painting
local testLive = poolManager:LoadLive(t, _objPoint.transform,
local testLive = poolManager:LoadLive(_heroData.live, _objPoint.transform,
Vector3.one * _heroData.scale, Vector3.New(_heroData.position[1], _heroData.position[2], 0))
local SkeletonGraphic = testLive:GetComponent("SkeletonGraphic")
local clip="idle"
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, clip, true) end
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle
poolManager:SetLiveClearCall(_heroData.live, testLive, function ()
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete - idle
@ -4536,7 +4603,7 @@ end
--根据界面数据加载动态立绘
function this.LoadHerolive1(data, _objPoint)
--TODO:动态加载立绘
local testLive = poolManager:LoadLive(GetResourcePath(data.Painting), _objPoint.transform,
local testLive = poolManager:LoadLive(GetResourcePath(data.Live), _objPoint.transform,
Vector3.one * data.Scale, Vector3.New(data.Position[1], data.Position[2], 0))
local SkeletonGraphic = testLive:GetComponent("SkeletonGraphic")
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end

View File

@ -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
-- local addPro=HeroManager.GetHeroTrainingAddPro(_heroData.dId)
-- if addPro==nil or #addPro==0 then
-- return nil
-- end
-- 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
for key, value in pairs(addPro) do
-- LogError("Training key==="..key.." value=="..value)
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 addPro
return allAddPro, conPropList, teamPropList, conTeamPropList, dePropList
end,
}