diff --git a/Assets/ManagedResources/~Lua/Modules/Gem/GiftManager.lua b/Assets/ManagedResources/~Lua/Modules/Gem/GiftManager.lua index 6f6a7911e..907c7e68f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Gem/GiftManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Gem/GiftManager.lua @@ -53,10 +53,10 @@ end --获取收取等级和最大数量 function this.GetHeroGiftBoxNum(dynamicId) - local list = GiftManager.GetHeroGifts(dynamicId) - local maxNum = #list + LogError("ffffffffffffffff"..tostring(#HeroManager.GetAllHeroDatasByStar(13))) + local maxNum = 0 for k, v in ConfigPairs(giftConfig) do - if v.Harmony <= PowerCenterManager.allData.level and v.Box > maxNum then + if v.Harmony <= #HeroManager.GetAllHeroDatasByStar(13) and v.Box > maxNum then maxNum = v.Box end end diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua index bcfaff82d..2d5383944 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua @@ -27,7 +27,7 @@ local SpecialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig) local heroDatas = {} this.backupLimit = 0 -this.heroSortedDatas = {}--排序后的英雄数据 +this.heroSortedDatas = {} --排序后的英雄数据 this.heroDataLists = {} this.heroLvEnd = {} --3星=60,4=200,5=250 星级对应等级上限 @@ -85,6 +85,7 @@ function this.Initialize() this.GetSingleProScoreVal() end + --初始化英雄数据 function this.InitHeroData(_msgHeroList) local hero_resolve_licence = string.split(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 36).Value, "#") @@ -119,8 +120,8 @@ function this.UpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) heroData.createTime = _msgHeroData.createTimelocal heroData.lockState = _msgHeroData.lockState heroData.createtype = _msgHeroData.createtype - heroData.changeId = _msgHeroData.changeId--置换id - heroData.formationList = {}--所在编队list + heroData.changeId = _msgHeroData.changeId --置换id + heroData.formationList = {} --所在编队list -- 能力 heroData.warWaySlot1Id = _msgHeroData.warWaySlot1 or 0 heroData.warWaySlot2Id = _msgHeroData.warWaySlot2 or 0 @@ -142,21 +143,22 @@ function this.UpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) --英雄穿戴的装备 heroData.equipIdList = _msgHeroData.equipIdList heroData.jewels = _msgHeroData.jewels - heroData.talismanList = _msgHeroData.especialEquipLevel --法宝等级 - heroData.planList = {} -- 戒指 + heroData.talismanList = _msgHeroData.especialEquipLevel --法宝等级 + heroData.planList = {} -- 戒指 for i = 1, #_msgHeroData.combatPlans do - heroData.planList[i] = {planId = _msgHeroData.combatPlans[i].planId, position = _msgHeroData.combatPlans[i].position} --< 后端的第三个参数confPlanId不用 + heroData.planList[i] = { planId = _msgHeroData.combatPlans[i].planId, position = _msgHeroData.combatPlans[i] + .position } --< 后端的第三个参数confPlanId不用 end - heroData.medal = _msgHeroData.medal -- 勋章 - heroData.suitActive = _msgHeroData.suit -- 勋章套装激活 - heroData.totemId = _msgHeroData.totemId -- 图腾 - heroData.CombatPlanList =_msgHeroData.plan --戒指 + heroData.medal = _msgHeroData.medal -- 勋章 + heroData.suitActive = _msgHeroData.suit -- 勋章套装激活 + heroData.totemId = _msgHeroData.totemId -- 图腾 + heroData.CombatPlanList = _msgHeroData.plan --戒指 GiftManager.InitHeroGift(_msgHeroData.id, _msgHeroData.giftEquipIds) heroData.giftIds = _msgHeroData.giftEquipIds if #_msgHeroData.soulPos >= 1 then local soulPrintList = {} for i, v in ipairs(_msgHeroData.soulPos) do - local soulPrint = {equipId = v.equipId, position = v.position} + local soulPrint = { equipId = v.equipId, position = v.position } SoulPrintManager.AddSoulPrintUpHeroDynamicId(v.equipId, heroData.dynamicId) table.insert(soulPrintList, soulPrint) end @@ -195,15 +197,15 @@ function this.UpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) heroData.position = _configData.Position heroData.property = _configData.PropertyName heroData.sortId = #heroDatas + 1 - + this.SetEquipUpHeroDid(heroData.equipIdList, heroData.dynamicId) -- this.SetEquipTreasureUpHeroDid(heroData.jewels, heroData.dynamicId) -- this.SetTalismanLv(heroData.dynamicId, heroData.talismanList) -- this.SetSoulPrintUpHeroDid(heroData.soulPrintList,heroData.dynamicId) this.SetPlanUpHeroDid(heroData.planList, heroData.dynamicId) - this.SetMedalHeroDid(heroData.medal,heroData.dynamicId) - this.SetTotemHeroDid(heroData.totemId,heroData.dynamicId) - + this.SetMedalHeroDid(heroData.medal, heroData.dynamicId) + this.SetTotemHeroDid(heroData.totemId, heroData.dynamicId) + local isFindHandBook = true if _isFindHandBook ~= nil then isFindHandBook = _isFindHandBook @@ -211,7 +213,8 @@ function this.UpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) if isFindHandBook then --图鉴 PlayerManager.SetHeroHandBookListData(heroData.id, heroData.star) end - heroData.warPower = this.CalculateHeroAllProValList(1, heroData, false)[HeroProType.WarPower] --< 此处算战力 有些会没算进去(被动。。) 不要用warPower 用新cal的 + heroData.warPower = this.CalculateHeroAllProValList(1, heroData, false) + [HeroProType.WarPower] --< 此处算战力 有些会没算进去(被动。。) 不要用warPower 用新cal的 --远征初始化血量 --ExpeditionManager.InitHeroHpValue(heroData) @@ -245,8 +248,8 @@ function this.TrainUpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) heroData.createTime = _msgHeroData.createTimelocal heroData.lockState = _msgHeroData.lockState heroData.createtype = _msgHeroData.createtype - heroData.changeId = _msgHeroData.changeId--置换id - heroData.formationList = {}--所在编队list + heroData.changeId = _msgHeroData.changeId --置换id + heroData.formationList = {} --所在编队list -- 能力 heroData.warWaySlot1Id = _msgHeroData.warWaySlot1 or 0 heroData.warWaySlot2Id = _msgHeroData.warWaySlot2 or 0 @@ -268,21 +271,22 @@ function this.TrainUpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) --英雄穿戴的装备 heroData.equipIdList = _msgHeroData.equipIdList heroData.jewels = _msgHeroData.jewels - heroData.talismanList = _msgHeroData.especialEquipLevel --法宝等级 - heroData.planList = {} -- 戒指 + heroData.talismanList = _msgHeroData.especialEquipLevel --法宝等级 + heroData.planList = {} -- 戒指 for i = 1, #_msgHeroData.combatPlans do - heroData.planList[i] = {planId = _msgHeroData.combatPlans[i].planId, position = _msgHeroData.combatPlans[i].position} --< 后端的第三个参数confPlanId不用 + heroData.planList[i] = { planId = _msgHeroData.combatPlans[i].planId, position = _msgHeroData.combatPlans[i] + .position } --< 后端的第三个参数confPlanId不用 end - heroData.medal = _msgHeroData.medal -- 勋章 - heroData.suitActive = _msgHeroData.suit -- 勋章套装激活 - heroData.totemId = _msgHeroData.totemId -- 图腾 - heroData.CombatPlanList =_msgHeroData.plan --戒指 + heroData.medal = _msgHeroData.medal -- 勋章 + heroData.suitActive = _msgHeroData.suit -- 勋章套装激活 + heroData.totemId = _msgHeroData.totemId -- 图腾 + heroData.CombatPlanList = _msgHeroData.plan --戒指 GiftManager.InitHeroGift(_msgHeroData.id, _msgHeroData.giftEquipIds) heroData.giftIds = _msgHeroData.giftEquipIds if #_msgHeroData.soulPos >= 1 then local soulPrintList = {} for i, v in ipairs(_msgHeroData.soulPos) do - local soulPrint = {equipId = v.equipId, position = v.position} + local soulPrint = { equipId = v.equipId, position = v.position } SoulPrintManager.AddSoulPrintUpHeroDynamicId(v.equipId, heroData.dynamicId) table.insert(soulPrintList, soulPrint) end @@ -321,15 +325,15 @@ function this.TrainUpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) heroData.position = _configData.Position heroData.property = _configData.PropertyName heroData.sortId = #heroDatas + 1 - + this.SetEquipUpHeroDid(heroData.equipIdList, heroData.dynamicId) -- this.SetEquipTreasureUpHeroDid(heroData.jewels, heroData.dynamicId) -- this.SetTalismanLv(heroData.dynamicId, heroData.talismanList) -- this.SetSoulPrintUpHeroDid(heroData.soulPrintList,heroData.dynamicId) -- this.SetPlanUpHeroDid(heroData.planList, heroData.dynamicId) -- this.SetMedalHeroDid(heroData.medal,heroData.dynamicId) - this.SetTotemHeroDid(heroData.totemId,heroData.dynamicId) - + this.SetTotemHeroDid(heroData.totemId, heroData.dynamicId) + local isFindHandBook = true if _isFindHandBook ~= nil then isFindHandBook = _isFindHandBook @@ -337,7 +341,8 @@ function this.TrainUpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) if isFindHandBook then --图鉴 PlayerManager.SetHeroHandBookListData(heroData.id, heroData.star) end - heroData.warPower = this.CalculateHeroAllProValList(1, heroData, false)[HeroProType.WarPower] --< 此处算战力 有些会没算进去(被动。。) 不要用warPower 用新cal的 + heroData.warPower = this.CalculateHeroAllProValList(1, heroData, false) + [HeroProType.WarPower] --< 此处算战力 有些会没算进去(被动。。) 不要用warPower 用新cal的 --远征初始化血量 --ExpeditionManager.InitHeroHpValue(heroData) @@ -350,9 +355,11 @@ function this.TrainUpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern) return heroData end end + function this.GetHeroEquipIdList(heroDid) return heroDatas[heroDid].equipIdList end + function this.GetHeroEquipIdList1(heroDid, id) for i = 1, #heroDatas[heroDid].equipIdList do if equipConfig[tonumber(heroDatas[heroDid].equipIdList[i])].Position == equipConfig[tonumber(id)].Position then @@ -370,6 +377,7 @@ function this.SetEquipUpHeroDid(_equipids, _heroDid) EquipManager.UpdateEquipData(_equipids, _heroDid) end end + function this.SetEquipTreasureUpHeroDid(_equipTreasureDids, _heroDid) for i = 1, #_equipTreasureDids do EquipTreasureManager.SetEquipTreasureUpHeroDid(_equipTreasureDids[i], _heroDid) @@ -387,13 +395,13 @@ end function this.SetMedalHeroDid(_MedalList, _heroDid) if #_MedalList > 0 then for i = 1, #_MedalList do - MedalManager.UpMedalData(_MedalList[i].id,_heroDid) + MedalManager.UpMedalData(_MedalList[i].id, _heroDid) --heroDatas[_heroDid].medal=MedalManager.MedalDaraByHero(_heroDid) end end end -function this.SetMedalHeroList(_heroDid,medalList) +function this.SetMedalHeroList(_heroDid, medalList) heroDatas[_heroDid].medal = medalList end @@ -401,7 +409,7 @@ function this.GetMedalHeroList(_heroDid) return heroDatas[_heroDid].medal end -function this.SetHeroSuitAtive(heroDid,suitRes) +function this.SetHeroSuitAtive(heroDid, suitRes) -- local medalist = {} -- medalist = MedalManager.MedalDaraByHero(heroDid) -- local suitRes = {} @@ -415,14 +423,15 @@ end function this.SetTotemHeroDid(totemid, _heroDid) if totemid ~= 0 then - TotemManager.UpTotemData(totemid,_heroDid) + TotemManager.UpTotemData(totemid, _heroDid) else end end -function this.SetHeroTotemInfo(heroDid,totemId) +function this.SetHeroTotemInfo(heroDid, totemId) heroDatas[heroDid].totemId = totemId end + function this.GetHeroTotemInfo(heroDid) return heroDatas[heroDid].totemId end @@ -431,6 +440,7 @@ end function this.SetTalismanLv(did, lv) heroDatas[did].talismanList = lv end + function this.GetTalismanLv(did) if heroDatas[did] then return heroDatas[did].talismanList @@ -443,6 +453,7 @@ function this.SetSoulPrintUpHeroDid(soulPos, _heroDid) SoulPrintManager.SetSoulPrintUpHeroDid(soulPos, _heroDid) end end + --获取所有英雄信息 function this.GetAllHeroDatas(_lvLimit) local lvLimit = 0 @@ -466,6 +477,24 @@ function this.GetAllHeroDatas(_lvLimit) ) return heros end + +--获取所有英雄信息 +function this.GetAllHeroDatasByStar(_lvLimit) + local lvLimit = 0 + if _lvLimit then + lvLimit = _lvLimit + end + local heros = {} + for i, v in pairs(heroDatas) do + if v.heroConfig.Material ~= 1 then + if v.star >= lvLimit then + table.insert(heros, v) + end + end + end + return heros +end + --获取所有英雄信息(包括万能卡) function this.GetAllHeroDatasAndZero(_lvLimit) local lvLimit = 0 @@ -523,8 +552,9 @@ function this.GetHeroDataByHeroSIdAndMinSortId(_heroSId) end return heroData end + --获取所有英雄信息(分解 回溯用 ) --0全部 1-6属性 7-9 3、4、5星 -function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) +function this.GetAllHeroDataMsinusUpWar(_sortTypeId, type) local heros = {} local heros2 = {} for i, v in pairs(heroDatas) do @@ -548,8 +578,8 @@ function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) isFormationStr, curFormationId = this.GetHeroFormationStr2(n) table.insert(isFormations, curFormationId) else - isFormationStr, curFormationId =this.GetHeroFormationStr2(n) - isFormationStr="、" ..isFormationStr + isFormationStr, curFormationId = this.GetHeroFormationStr2(n) + isFormationStr = "、" .. isFormationStr table.insert(isFormations, curFormationId) end heros[i].isFormation = heros[i].isFormation .. isFormationStr @@ -563,25 +593,24 @@ function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) end --筛选 if heros and LengthOfTable(heros) > 0 then - for i, v in pairs(heros) do - --TODONow - local isLock = false - local teamIdList = HeroManager.GetAllFormationByHeroId(v.dynamicId) - if teamIdList ~= nil and #teamIdList>0 then - for k,v in pairs(teamIdList)do - if v == FormationTypeDef.DEFENSE_TRAINING and DefenseTrainingManager.teamLock==1 then - isLock = true - break - end - -- --防守训练 - -- if v == FormationTypeDef.FORMATION_DREAMLAND or --奥廖尔 - -- v == FormationTypeDef.FORMATION_AoLiaoer then --奥廖尔 - -- isLock = true - -- break - -- end + for i, v in pairs(heros) do + --TODONow + local isLock = false + local teamIdList = HeroManager.GetAllFormationByHeroId(v.dynamicId) + if teamIdList ~= nil and #teamIdList > 0 then + for k, v in pairs(teamIdList) do + if v == FormationTypeDef.DEFENSE_TRAINING and DefenseTrainingManager.teamLock == 1 then + isLock = true + break end - + -- --防守训练 + -- if v == FormationTypeDef.FORMATION_DREAMLAND or --奥廖尔 + -- v == FormationTypeDef.FORMATION_AoLiaoer then --奥廖尔 + -- isLock = true + -- break + -- end end + end -- if isLock==true then -- elseif (v.lv > 1 and type == 1) or (v.lv > 0 and type == 2) then @@ -591,10 +620,10 @@ function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) if not PowerCenterManager.FindHeroIsLinkHeroForDynamicId(v.dynamicId) then table.insert(heros2, v) end - -- elseif _sortTypeId >= 7 then - -- if v.star == _sortTypeId - 4 then - -- table.insert(heros2, v) - -- end + -- elseif _sortTypeId >= 7 then + -- if v.star == _sortTypeId - 4 then + -- table.insert(heros2, v) + -- end else if v.property == _sortTypeId then if not PowerCenterManager.FindHeroIsLinkHeroForDynamicId(v.dynamicId) then @@ -610,7 +639,7 @@ function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) end --获取满足条件的所有英雄信息(改装厂回溯) --0全部 1-6属性 type: 1普通回溯 2高级回溯 -function this.GetAllHeroDataMsinusUpWar1(_sortTypeId,type) +function this.GetAllHeroDataMsinusUpWar1(_sortTypeId, type) local heros = {} local heros2 = {} for i, v in pairs(heroDatas) do @@ -635,7 +664,7 @@ function this.GetAllHeroDataMsinusUpWar1(_sortTypeId,type) table.insert(isFormations, curFormationId) else isFormationStr, curFormationId = this.GetHeroFormationStr2(n) - isFormationStr = "、" ..isFormationStr + isFormationStr = "、" .. isFormationStr table.insert(isFormations, curFormationId) end heros[i].isFormation = heros[i].isFormation .. isFormationStr @@ -649,7 +678,7 @@ function this.GetAllHeroDataMsinusUpWar1(_sortTypeId,type) end --筛选 if heros and LengthOfTable(heros) > 0 then - for i, v in pairs(heros) do + for i, v in pairs(heros) do --TODONow local isLock = false local teamIdList = HeroManager.GetAllFormationByHeroId(v.dynamicId) @@ -668,20 +697,20 @@ function this.GetAllHeroDataMsinusUpWar1(_sortTypeId,type) -- end -- end if v.heroConfig.Material ~= 1 then - if (v.star >= 7 and v.star <= 9 and type == 1) or (v.star >= 10 and type == 2) then + if (v.star >= 7 and v.star <= 9 and type == 1) or (v.star >= 10 and type == 2) then if isLock == true then elseif _sortTypeId == 0 then table.insert(heros2, v) - -- elseif _sortTypeId >= 7 then - -- if v.star == _sortTypeId - 4 then - -- table.insert(heros2, v) - -- end + -- elseif _sortTypeId >= 7 then + -- if v.star == _sortTypeId - 4 then + -- table.insert(heros2, v) + -- end else if v.property == _sortTypeId then table.insert(heros2, v) end - end + end end end end @@ -690,7 +719,7 @@ function this.GetAllHeroDataMsinusUpWar1(_sortTypeId,type) end --获取满足条件的所有英雄信息(改装厂改造) --0全部 1-6属性 type: 1普通回溯 2高级回溯 -function this.GetAllHeroDataMsinusUpWar2(_sortTypeId,ExchangeConfigId) +function this.GetAllHeroDataMsinusUpWar2(_sortTypeId, ExchangeConfigId) local heros = {} local heros2 = {} for i, v in pairs(heroDatas) do @@ -715,8 +744,8 @@ function this.GetAllHeroDataMsinusUpWar2(_sortTypeId,ExchangeConfigId) isFormationStr, curFormationId = this.GetHeroFormationStr2(n) table.insert(isFormations, curFormationId) else - isFormationStr, curFormationId =this.GetHeroFormationStr2(n) - isFormationStr="、" ..isFormationStr + isFormationStr, curFormationId = this.GetHeroFormationStr2(n) + isFormationStr = "、" .. isFormationStr table.insert(isFormations, curFormationId) end heros[i].isFormation = heros[i].isFormation .. isFormationStr @@ -730,7 +759,7 @@ function this.GetAllHeroDataMsinusUpWar2(_sortTypeId,ExchangeConfigId) end --筛选 if heros and LengthOfTable(heros) > 0 then - for i, v in pairs(heros) do + for i, v in pairs(heros) do -- if (v.star >= 7 and v.star<=9 and type == 1) or (v.star >= 10 and type == 2) then -- if _sortTypeId == 0 then -- table.insert(heros2, v) @@ -742,7 +771,7 @@ function this.GetAllHeroDataMsinusUpWar2(_sortTypeId,ExchangeConfigId) -- if v.property == _sortTypeId then -- table.insert(heros2, v) -- end - -- end + -- end -- end --条件一:最大星级大于等于10星的卡,Hero 表中 MaxRank >= 10 --条件二:根据改装前卡牌阵营,符合 HeroExchangeConfig 表中 CanChangeCountry 字段所要求的阵营 @@ -752,7 +781,7 @@ function this.GetAllHeroDataMsinusUpWar2(_sortTypeId,ExchangeConfigId) local isLock = false local teamIdList = HeroManager.GetAllFormationByHeroId(v.dynamicId) if teamIdList ~= nil and #teamIdList > 0 then - for k,v in pairs(teamIdList)do + for k, v in pairs(teamIdList) do if v == FormationTypeDef.DEFENSE_TRAINING or v == FormationTypeDef.FORMATION_DREAMLAND or v == FormationTypeDef.FORMATION_AoLiaoer then isLock = true break @@ -771,7 +800,7 @@ function this.GetAllHeroDataMsinusUpWar2(_sortTypeId,ExchangeConfigId) if canChangeCountry[i] == v.property then table.insert(heros2, v) end - end + end else if v.property == _sortTypeId then table.insert(heros2, v) @@ -781,13 +810,13 @@ function this.GetAllHeroDataMsinusUpWar2(_sortTypeId,ExchangeConfigId) end end end - table.sort(heros2,function (a,b) - return a.heroConfig.Id 0 then - for k,n in pairs(teamIdList)do + for k, n in pairs(teamIdList) do if n == FormationTypeDef.DEFENSE_TRAINING and DefenseTrainingManager.teamLock == 1 then isLock = true break end - --防守训练 + --防守训练 -- if n == FormationTypeDef.FORMATION_DREAMLAND or n == FormationTypeDef.FORMATION_AoLiaoer then -- isLock = true -- break @@ -1163,7 +1191,7 @@ function this.GetUpStarHeroListData(heroRankUpGroupId, heroData) end end if v.dynamicId == heroData.dynamicId then --自己筛掉 - -- elseif isLock == true then --防守训练 奥廖尔筛掉 + -- elseif isLock == true then --防守训练 奥廖尔筛掉 else v.isFormation = "" if heroRankUpGroup.Issame == 1 then --需要同名卡 @@ -1234,7 +1262,6 @@ function this.GetUpStarHeroListData(heroRankUpGroupId, heroData) if this.heroResolveLicence[n] then for m = 1, #w.teamHeroInfos do if v.dynamicId == w.teamHeroInfos[m].heroId then - local isFormationStr = this.GetHeroFormationStr2(n) v.isFormation = isFormationStr end @@ -1343,15 +1370,15 @@ function this.GetCurHeroStarLvEnd(getValType, curHeroData, _breakId, _upStarId) breakId = _breakId upStarId = _upStarId end - if--[[ breakId == 0 and ]] upStarId > 0 then --从没突破过 显示当前初始星级的等级上限 + if --[[ breakId == 0 and ]] upStarId > 0 then --从没突破过 显示当前初始星级的等级上限 -- for i, v in ConfigPairs(heroRankUpConfig) do -- if v.Star == curHeroData.heroConfig.Star then -- return v.LimitLevel -- end - return heroRankUpConfig[upStarId].OpenLevel - elseif breakId > 0 and heroRankUpConfig[breakId].JudgeClass ~= 1 and upStarId ==0 then --没突破完毕 显示当前突破的等级上限 + return heroRankUpConfig[upStarId].OpenLevel + elseif breakId > 0 and heroRankUpConfig[breakId].JudgeClass ~= 1 and upStarId == 0 then --没突破完毕 显示当前突破的等级上限 return heroRankUpConfig[breakId].OpenLevel - elseif breakId > 0 and heroRankUpConfig[breakId].JudgeClass == 1 then --突破完毕 显示当前进阶的等级上限 + elseif breakId > 0 and heroRankUpConfig[breakId].JudgeClass == 1 then --突破完毕 显示当前进阶的等级上限 if upStarId > 0 then return heroRankUpConfig[upStarId].OpenLevel else @@ -1394,7 +1421,6 @@ local function CalculateHeroUpEquipsProAddVal(_heroId) end local curHeroData = HeroManager.GetSingleHeroData(_heroId) if curHeroData then - local equipSuit = {} --[id] = 件数 for i = 1, #curHeroData.equipIdList do @@ -1441,7 +1467,7 @@ local function CalculateHeroUpEquipsProAddVal(_heroId) if v >= curSuitConfig.SuiteValue[j][1] then local curProId = curSuitConfig.SuiteValue[j][2] local curProVal = curSuitConfig.SuiteValue[j][3] - + if addAllProVal[curProId] then addAllProVal[curProId] = addAllProVal[curProId] + curProVal else @@ -1458,7 +1484,7 @@ local function CalculateHeroUpEquipsProAddVal(_heroId) end --计算所有法宝加成的属性值 -local function CalculateHeroUpTalismanProAddVal(_heroId, _breakId, _upStarId,teamCurPropertyName) +local function CalculateHeroUpTalismanProAddVal(_heroId, _breakId, _upStarId, teamCurPropertyName) local addAllProVal = {} local singleHeroProVal, lvProVal, allHeroProVal, specialProVal local curHeroData = HeroManager.GetSingleHeroData(_heroId) @@ -1472,17 +1498,18 @@ local function CalculateHeroUpTalismanProAddVal(_heroId, _breakId, _upStarId,tea if curTalisman and curTalisman[2] then local talismanConFig = ConfigManager.GetConfigDataByDoubleKey( - ConfigName.EquipTalismana, - "TalismanaId", - curTalisman[2], - "Level", - curHeroData.talismanList - ) + ConfigName.EquipTalismana, + "TalismanaId", + curTalisman[2], + "Level", + curHeroData.talismanList + ) if talismanConFig then --主属性 for j = 1, #talismanConFig.Property do if addAllProVal[talismanConFig.Property[j][1]] then - addAllProVal[talismanConFig.Property[j][1]] = addAllProVal[talismanConFig.Property[j][1]] + talismanConFig.Property[j][2] + addAllProVal[talismanConFig.Property[j][1]] = addAllProVal[talismanConFig.Property[j][1]] + + talismanConFig.Property[j][2] else addAllProVal[talismanConFig.Property[j][1]] = talismanConFig.Property[j][2] end @@ -1492,15 +1519,18 @@ local function CalculateHeroUpTalismanProAddVal(_heroId, _breakId, _upStarId,tea for k = 1, #talismanConFig.SpecialProperty do if talismanConFig.SpecialProperty[k][1] == curHeroData.profession then if addAllProVal[talismanConFig.SpecialProperty[k][2]] then - addAllProVal[talismanConFig.SpecialProperty[k][2]] = addAllProVal[talismanConFig.SpecialProperty[k][2]] + talismanConFig.SpecialProperty[k][3] + addAllProVal[talismanConFig.SpecialProperty[k][2]] = addAllProVal + [talismanConFig.SpecialProperty[k][2]] + talismanConFig.SpecialProperty[k][3] else - addAllProVal[talismanConFig.SpecialProperty[k][2]] = talismanConFig.SpecialProperty[k][3] + addAllProVal[talismanConFig.SpecialProperty[k][2]] = talismanConFig.SpecialProperty + [k][3] end end end end --当前法宝全部天赋数据(天赋可能为空) - local dowerAllData = ConfigManager.GetAllConfigsDataByKey(ConfigName.EquipTalismana, "TalismanaId", curTalisman[2]) + local dowerAllData = ConfigManager.GetAllConfigsDataByKey(ConfigName.EquipTalismana, "TalismanaId", + curTalisman[2]) local skillIds = {} for i = 1, #dowerAllData do if dowerAllData[i].OpenSkillRules and curHeroData.talismanList >= dowerAllData[i].Level then @@ -1512,7 +1542,8 @@ local function CalculateHeroUpTalismanProAddVal(_heroId, _breakId, _upStarId,tea --被动技能计算 if skillIds and #skillIds > 0 then --talismanConFig.OpenSkillRules and #talismanConFig.OpenSkillRules > 0 then --单体加成 --单体等级限制加成 --团体加成 --减乘 - singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.Talisman, skillIds,teamCurPropertyName,curHeroData) + singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList( + WarPowerType.Talisman, skillIds, teamCurPropertyName, curHeroData) end end end @@ -1547,43 +1578,44 @@ local function CalculateSoulPrintAddVal(_heroId) -- return allSoulPrintAddWarPowerVal local addAllProVal = {} - local singleHeroProVal,lvProVal,allHeroProVal,specialProVal + local singleHeroProVal, lvProVal, allHeroProVal, specialProVal local curHeroData = HeroManager.GetSingleHeroData(_heroId) 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 then - --单体加成 --单体等级限制加成 --团体加成 --减乘 - singleHeroProVal,lvProVal,allHeroProVal,specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.SoulPrint,cursoulPrintConfig.PassiveSkill) - end - end - end - end + 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 then + --单体加成 --单体等级限制加成 --团体加成 --减乘 + singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList( + WarPowerType.SoulPrint, cursoulPrintConfig.PassiveSkill) + end + end + end + end end if singleHeroProVal and LengthOfTable(singleHeroProVal) > 0 then - for i,v in pairs(singleHeroProVal) do - if addAllProVal[i] then - addAllProVal[i] = addAllProVal[i] + v - else - addAllProVal[i] = v - end - end + for i, v in pairs(singleHeroProVal) do + if addAllProVal[i] then + addAllProVal[i] = addAllProVal[i] + v + else + addAllProVal[i] = v + end + end end - return addAllProVal,lvProVal,allHeroProVal,specialProVal + return addAllProVal, lvProVal, allHeroProVal, specialProVal end --英雄身上宝器属性计算 @@ -1603,8 +1635,8 @@ local function CalculateEquipTreaSureAddVal(_heroId) for _, configInfo in ConfigPairs(jewelRankupConfig) do --强化的属性 if configInfo.PoolID == curEuipTreaSureConfig.LevelupPool and configInfo.Type == 1 and - configInfo.Level == curEuipTreaSureData.lv - then + configInfo.Level == curEuipTreaSureData.lv + then for j = 1, #configInfo.Property do if addAllProVal[configInfo.Property[j][1]] then addAllProVal[configInfo.Property[j][1]] = @@ -1655,8 +1687,8 @@ local function CalculateEquipTreaSureAddVal(_heroId) if lvjewelResonanceConfig then if curjewelResonanceConfig.Type == 1 and curjewelResonanceConfig.Level <= minLv and - curjewelResonanceConfig.Id > lvjewelResonanceConfig.Id - then + curjewelResonanceConfig.Id > lvjewelResonanceConfig.Id + then lvjewelResonanceConfig = curjewelResonanceConfig end else @@ -1667,8 +1699,8 @@ local function CalculateEquipTreaSureAddVal(_heroId) if refineLvjewelResonanceConfig then if curjewelResonanceConfig.Type == 2 and curjewelResonanceConfig.Level <= mainRefineLv and - curjewelResonanceConfig.Id > refineLvjewelResonanceConfig.Id - then + curjewelResonanceConfig.Id > refineLvjewelResonanceConfig.Id + then refineLvjewelResonanceConfig = curjewelResonanceConfig end else @@ -1710,7 +1742,7 @@ end --计算能力属性 local function CalculateWarWayAddVal(_heroId) local addAllProVal = {} - local singleHeroProVal,lvProVal,allHeroProVal,specialProVal + local singleHeroProVal, lvProVal, allHeroProVal, specialProVal local curHeroData = HeroManager.GetSingleHeroData(_heroId) if curHeroData then local passiveSkills = {} @@ -1727,25 +1759,26 @@ local function CalculateWarWayAddVal(_heroId) if #passiveSkills > 0 then --LogError("passiveSkills",passiveSkills[1]) --单体加成 --单体等级限制加成 --团体加成 --减乘 - singleHeroProVal,lvProVal,allHeroProVal,specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.WarWayAndCombatPlan, passiveSkills) + singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList( + WarPowerType.WarWayAndCombatPlan, passiveSkills) end end if singleHeroProVal and LengthOfTable(singleHeroProVal) > 0 then - for i,v in pairs(singleHeroProVal) do - if addAllProVal[i] then - addAllProVal[i] = addAllProVal[i] + v - else - addAllProVal[i] = v - end - end + for i, v in pairs(singleHeroProVal) do + if addAllProVal[i] then + addAllProVal[i] = addAllProVal[i] + v + else + addAllProVal[i] = v + end + end end - return addAllProVal,lvProVal,allHeroProVal,specialProVal + return addAllProVal, lvProVal, allHeroProVal, specialProVal end --计算戒指属性 local function CalculateCombatPlanAddVal(_heroId) local addAllProVal = {} - local singleHeroProVal,lvProVal,allHeroProVal,specialProVal + local singleHeroProVal, lvProVal, allHeroProVal, specialProVal local curHeroData = HeroManager.GetSingleHeroData(_heroId) if curHeroData then local passiveSkills = {} @@ -1776,7 +1809,8 @@ local function CalculateCombatPlanAddVal(_heroId) --被动技能计算 if #passiveSkills > 0 then --单体加成 --单体等级限制加成 --团体加成 --减乘 - singleHeroProVal,lvProVal,allHeroProVal,specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.WarWayAndCombatPlan, passiveSkills) + singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList( + WarPowerType.WarWayAndCombatPlan, passiveSkills) end end if singleHeroProVal and LengthOfTable(singleHeroProVal) > 0 then @@ -1788,13 +1822,13 @@ local function CalculateCombatPlanAddVal(_heroId) end end end - return addAllProVal,lvProVal,allHeroProVal,specialProVal + return addAllProVal, lvProVal, allHeroProVal, specialProVal end --计算能力和戒指属性 local function CalculateCombatPlanAndWarWayAddVal(_heroId) local addAllProVal = {} - local singleHeroProVal,lvProVal,allHeroProVal,specialProVal + local singleHeroProVal, lvProVal, allHeroProVal, specialProVal local curHeroData = HeroManager.GetSingleHeroData(_heroId) if curHeroData then local passiveSkills = {} @@ -1849,7 +1883,7 @@ local function CalculateCombatPlanAndWarWayAddVal(_heroId) end end if state then - table.insert(repeatList, {id = id, group = config[id].Group, lv = config[id].Level}) + table.insert(repeatList, { id = id, group = config[id].Group, lv = config[id].Level }) end end @@ -1859,12 +1893,13 @@ local function CalculateCombatPlanAndWarWayAddVal(_heroId) end --单体加成 --单体等级限制加成 --团体加成 --减乘 - singleHeroProVal,lvProVal,allHeroProVal,specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.WarWayAndCombatPlan, passiveSkills) + singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList( + WarPowerType.WarWayAndCombatPlan, passiveSkills) end end if singleHeroProVal and LengthOfTable(singleHeroProVal) > 0 then - for i,v in pairs(singleHeroProVal) do + for i, v in pairs(singleHeroProVal) do if addAllProVal[i] then addAllProVal[i] = addAllProVal[i] + v else @@ -1872,14 +1907,14 @@ local function CalculateCombatPlanAndWarWayAddVal(_heroId) end end end - return addAllProVal,lvProVal,allHeroProVal,specialProVal + return addAllProVal, lvProVal, allHeroProVal, specialProVal end --计算勋章属性 local function CalculateMedalAddVal(_heroId) local addAllProVal = {} - local singleHeroProVal,lvProVal,allHeroProVal,specialProVal - -- local curHeroData = HeroManager.GetSingleHeroData(_heroId) + local singleHeroProVal, lvProVal, allHeroProVal, specialProVal + -- local curHeroData = HeroManager.GetSingleHeroData(_heroId) local medalList = MedalManager.MedalDaraByHero(_heroId) if medalList and LengthOfTable(medalList) > 0 then for i = 1, 4 do @@ -1904,7 +1939,7 @@ local function CalculateMedalAddVal(_heroId) addAllProVal[id] = value end end - end + end end end end @@ -1935,7 +1970,7 @@ local function CalculateMedalAddVal(_heroId) -- end -- end -- end - + -- end -- end -- end @@ -1947,7 +1982,7 @@ end --计算勋章套装属性 local function CalculateMedalSuitAddVal(_heroId) local addAllProVal = {} - local singleHeroProVal,lvProVal,allHeroProVal,specialProVal + local singleHeroProVal, lvProVal, allHeroProVal, specialProVal local curHeroData = HeroManager.GetSingleHeroData(_heroId) if curHeroData then local passiveSkills = {} @@ -1957,14 +1992,14 @@ local function CalculateMedalSuitAddVal(_heroId) local suitId = curHeroData.suitActive[i].suitId local suitNum = curHeroData.suitActive[i].num local medalSuitData = MedalManager.GetMedalSuitInfoById(suitId) - for k,v in pairs(medalSuitData.SuitAttr) do + for k, v in pairs(medalSuitData.SuitAttr) do if v[1] == suitNum then if v[2] == 8888 then --激活技能 -- local PassiveSkillConfigData=ConfigManager.GetConfigDataByKey(ConfigName.PassiveSkillConfig, "Id", v[3]) -- icon:GetComponent("Image").sprite=Util.LoadSprite(GetResourcePath(PassiveSkillConfigData.icon)) -- value:GetComponent("Text").text=string.format("技能:%s",PassiveSkillConfigData.Name) - table.insert(passiveSkills,v[3]) + table.insert(passiveSkills, v[3]) else if addAllProVal[v[2]] then addAllProVal[v[2]] = addAllProVal[v[2]] + v[3] @@ -1981,31 +2016,33 @@ local function CalculateMedalSuitAddVal(_heroId) --被动技能计算 if #passiveSkills > 0 then --单体加成 --单体等级限制加成 --团体加成 --减乘 - singleHeroProVal,lvProVal,allHeroProVal,specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.medalSuit, passiveSkills) + singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList( + WarPowerType.medalSuit, passiveSkills) end if singleHeroProVal and LengthOfTable(singleHeroProVal) > 0 then - for i,v in pairs(singleHeroProVal) do + for i, v in pairs(singleHeroProVal) do if addAllProVal[i] then addAllProVal[i] = addAllProVal[i] + v else addAllProVal[i] = v end end - end + end end - return addAllProVal,lvProVal,allHeroProVal,specialProVal + return addAllProVal, lvProVal, allHeroProVal, specialProVal end --计算图腾属性 local function CalculateTotemAddVal(_heroId) local addAllProVal = {} - local singleHeroProVal,lvProVal,allHeroProVal,specialProVal - -- local curHeroData =HeroManager.GetSingleHeroData(_heroId) + local singleHeroProVal, lvProVal, allHeroProVal, specialProVal + -- local curHeroData =HeroManager.GetSingleHeroData(_heroId) local totemData = TotemManager.GetTotemDataByHeroId(_heroId) local passiveSkills = {} if totemData ~= nil then - local totemItems = ConfigManager.GetAllConfigsDataByKey(ConfigName.ExpeditionTotemConfig,"ItemId",totemData.idDyn) + local totemItems = ConfigManager.GetAllConfigsDataByKey(ConfigName.ExpeditionTotemConfig, "ItemId", + totemData.idDyn) for i = 1, #totemItems do local item = totemItems[i] if totemData.id >= item.Id then @@ -2023,11 +2060,11 @@ local function CalculateTotemAddVal(_heroId) --被动技能计算 local step = totemData.step - local itemlist = ConfigManager.GetAllConfigsDataByKey("ExpeditionTotemTypeConfig","ItemId",totemData.idDyn) + local itemlist = ConfigManager.GetAllConfigsDataByKey("ExpeditionTotemTypeConfig", "ItemId", totemData.idDyn) for i = 1, #itemlist do - if i <= step then - table.insert(passiveSkills,itemlist[i].SkillId) - end + if i <= step then + table.insert(passiveSkills, itemlist[i].SkillId) + end end end -- if totemData~=nil then @@ -2041,23 +2078,24 @@ local function CalculateTotemAddVal(_heroId) -- addAllProVal[id] = value -- end -- end - -- end + -- end -- --被动技能计算 -- local step= totemData.step -- local itemlist=ConfigManager.GetAllConfigsDataByKey("ExpeditionTotemTypeConfig","ItemId",totemData.idDyn) -- for i = 1, #itemlist do -- if i<=step then -- table.insert(passiveSkills,itemlist[i].SkillId) - -- end + -- end -- end -- end if #passiveSkills > 0 then --单体加成 --单体等级限制加成 --团体加成 --减乘 - singleHeroProVal,lvProVal,allHeroProVal,specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.Totem, passiveSkills) + singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.Totem, + passiveSkills) end if singleHeroProVal and LengthOfTable(singleHeroProVal) > 0 then - for i,v in pairs(singleHeroProVal) do + for i, v in pairs(singleHeroProVal) do if addAllProVal[i] then addAllProVal[i] = addAllProVal[i] + v else @@ -2066,13 +2104,13 @@ local function CalculateTotemAddVal(_heroId) end end - return addAllProVal,lvProVal,allHeroProVal,specialProVal + return addAllProVal, lvProVal, allHeroProVal, specialProVal end --计算特性属性 local function CalculateTalentAddVal(_heroId) local addAllProVal = {} - local singleHeroProVal,lvProVal,allHeroProVal,specialProVal + local singleHeroProVal, lvProVal, allHeroProVal, specialProVal local curHeroData = HeroManager.GetSingleHeroData(_heroId) if curHeroData then local passiveSkills = {} @@ -2086,23 +2124,24 @@ local function CalculateTalentAddVal(_heroId) --被动技能计算 if #passiveSkills > 0 then --单体加成 --单体等级限制加成 --团体加成 --减乘 - singleHeroProVal,lvProVal,allHeroProVal,specialProVal = this.CalculatePassiveSkillsValList(WarPowerType.Talent, passiveSkills) + singleHeroProVal, lvProVal, allHeroProVal, specialProVal = this.CalculatePassiveSkillsValList( + WarPowerType.Talent, passiveSkills) end end if singleHeroProVal and LengthOfTable(singleHeroProVal) > 0 then - for i,v in pairs(singleHeroProVal) do - if addAllProVal[i] then - addAllProVal[i] = addAllProVal[i] + v - else - addAllProVal[i] = v - end - end + for i, v in pairs(singleHeroProVal) do + if addAllProVal[i] then + addAllProVal[i] = addAllProVal[i] + v + else + addAllProVal[i] = v + end + end end - return addAllProVal,lvProVal,allHeroProVal,specialProVal + return addAllProVal, lvProVal, allHeroProVal, specialProVal end --计算所有英雄被动技能的属性值 -local function CalculateHeroPassiveSkillProAddVal(_type, _heroId, _breakId, _upStarId,teamCurPropertyName) +local function CalculateHeroPassiveSkillProAddVal(_type, _heroId, _breakId, _upStarId, teamCurPropertyName) local singleHeroProVal, lvProVal, allHeroProVal, specialProVal local curHeroData = HeroManager.GetSingleHeroData(_heroId) if curHeroData then @@ -2110,14 +2149,17 @@ local function CalculateHeroPassiveSkillProAddVal(_type, _heroId, _breakId, _upS local allOpenPassiveSkillIds = {} if _type == 1 then allOpenPassiveSkillIds = - this.GetAllPassiveSkillIds(curHeroData.heroConfig, curHeroData.breakId, curHeroData.upStarId,star,curHeroData) + this.GetAllPassiveSkillIds(curHeroData.heroConfig, curHeroData.breakId, curHeroData.upStarId, star, + curHeroData) else - allOpenPassiveSkillIds = this.GetAllPassiveSkillIds(curHeroData.heroConfig, _breakId, _upStarId,star,curHeroData) + allOpenPassiveSkillIds = this.GetAllPassiveSkillIds(curHeroData.heroConfig, _breakId, _upStarId, star, + curHeroData) end --单体加成 --单体等级限制加成 --团体加成 --减乘 singleHeroProVal, lvProVal, allHeroProVal, specialProVal = - this.CalculatePassiveSkillsValList(WarPowerType.Hero, allOpenPassiveSkillIds,teamCurPropertyName,curHeroData) - end + this.CalculatePassiveSkillsValList(WarPowerType.Hero, allOpenPassiveSkillIds, teamCurPropertyName, + curHeroData) + end return singleHeroProVal, lvProVal, allHeroProVal, specialProVal end @@ -2127,23 +2169,23 @@ end -- 原始属性 + 等级x属性提升x品级乘修x星级乘修 + 品级加修 + 星级加修 = 基础属性 -- 基础属性*被动乘修+被动加修=技能修正属性 -- (技能修正属性+联盟活跃+神兵基础)*联盟科技=面板属性 -function this.CalculateProVal(proValue, lvNum, breakId, upStarId, proId, heroConFigData,star) +function this.CalculateProVal(proValue, lvNum, breakId, upStarId, proId, heroConFigData, star) local upRate = heroConFigData[HeroLvUpRate[proId]] local breakBase = 0 local starBase = 0 local breakRate = 10000 local starRate = 10000 - if heroRankUpConfig[breakId] and HeroBreakStarUpBaseValue[proId] and HeroBreakStarUpRate[proId] then + if heroRankUpConfig[breakId] and HeroBreakStarUpBaseValue[proId] and HeroBreakStarUpRate[proId] then local breakLv = heroRankUpConfig[breakId].Phase[2] -- if breakLv > 6 then -- breakLv = breakLv-7 -- end - local heroRankConfigData = ConfigManager.GetConfigDataByKey(ConfigName.HeroRankConfig, "Rank", breakLv) - breakBase = heroRankConfigData[HeroBreakStarUpBaseValue[proId]] - breakRate = heroRankConfigData[HeroBreakStarUpRate[proId]] + local heroRankConfigData = ConfigManager.GetConfigDataByKey(ConfigName.HeroRankConfig, "Rank", breakLv) + breakBase = heroRankConfigData[HeroBreakStarUpBaseValue[proId]] + breakRate = heroRankConfigData[HeroBreakStarUpRate[proId]] end - - if heroRankUpConfig[upStarId] and HeroBreakStarUpBaseValue[proId] and HeroBreakStarUpRate[proId] then + + if heroRankUpConfig[upStarId] and HeroBreakStarUpBaseValue[proId] and HeroBreakStarUpRate[proId] then local upStarLv = heroRankUpConfig[upStarId].Phase[2] starBase = HeroStarConfig[upStarLv][HeroBreakStarUpBaseValue[proId]] starRate = HeroStarConfig[upStarLv][HeroBreakStarUpRate[proId]] @@ -2185,7 +2227,6 @@ end --计算其他属性值 初始属性*(1+化境增长)*等级系数 + 初始属性*突破系数 --proValue 初始属性 rebirth 化境增长 lvNum 等级系数 breakNum 突破系数 function this.CalculateProValMap(_heroDid, _proType) - --proValue,rebirth,lvNum,breakId local curheroData = {} if heroDatas[_heroDid] then @@ -2209,7 +2250,7 @@ function this.CalculateProValMap(_heroDid, _proType) proValue = curheroData.hp elseif _proType == HeroProType.PhysicalDefence then proValue = curheroData.pDef - -- elseif _proType == HeroProType.MagicDefence then + -- elseif _proType == HeroProType.MagicDefence then -- proValue = curheroData.mDef elseif _proType == HeroProType.Speed then proValue = curheroData.speed @@ -2217,7 +2258,8 @@ function this.CalculateProValMap(_heroDid, _proType) if _proType == HeroProType.Speed then --return CalculateSpeedProVal(proValue,curheroData.breakId,speedNum)+allEquipAddProVal[_proType] else - return this.CalculateProVal(proValue, curheroData.lv, curheroData.breakId, curheroData.upStarId, _proType, curheroData.heroConfig,curheroData.star) + + return this.CalculateProVal(proValue, curheroData.lv, curheroData.breakId, curheroData.upStarId, _proType, + curheroData.heroConfig, curheroData.star) + allEquipAddProVal[_proType] end end @@ -2230,19 +2272,22 @@ local function CalculateWarForce(powerVal) if v > 0 then if propertyConfig[i] then powerEndVal = powerEndVal + v * HeroManager.heroPropertyScore[i] - str = str .. propertyConfig[i].Name..":"..v.."x"..HeroManager.heroPropertyScore[i].."="..v*HeroManager.heroPropertyScore[i].."\n" + str = str .. + propertyConfig[i].Name .. + ":" .. v .. "x" .. HeroManager.heroPropertyScore[i] .. "=" .. v * HeroManager.heroPropertyScore[i] .. + "\n" end end end if this.isLog then - LogError("计算战斗力:\n"..str) + LogError("计算战斗力:\n" .. str) end return math.floor(powerEndVal) end function this.ShowLog(str, args, type) if args ~= nil and args[type] then - str = str..args[type].."\n" + str = str .. args[type] .. "\n" end end @@ -2255,9 +2300,9 @@ local function CalculateSingleModuleWarForce(powerVal) if curProConfig and curProConfig.TargetPropertyId > 0 then powerVal[curProConfig.TargetPropertyId] = math.floor( - powerVal[curProConfig.TargetPropertyId] + + powerVal[curProConfig.TargetPropertyId] + powerVal[curProConfig.TargetPropertyId] * powerVal[i] / 10000 - ) + ) end if curProConfig and curProConfig.Style == 2 then powerVal[i] = powerVal[i] / 10000 @@ -2281,7 +2326,7 @@ end ---前端计算逻辑 先把所有被动技团体加成 和 被动技个人加成都提出来 然后计算英雄身上所有绝对值 + 所有被动技团体绝对值 + 所有被动技个人加成绝对值 --- * (1 + 英雄身上万分比加成 + 普通团体被动技百分比 + 普通个人被动技百分比 + 个体等级百分比加成 ) * (1 - 4乘减算 百分比) --- -function this.CalculatePassiveSkillsValList(index, skillids,teamCurPropertyName,curHeroData) +function this.CalculatePassiveSkillsValList(index, skillids, teamCurPropertyName, curHeroData) -- for k,v in pairs(this.allProVal)do --1,2,3,4 -- end @@ -2299,7 +2344,7 @@ function this.CalculatePassiveSkillsValList(index, skillids,teamCurPropertyName, local curSkillData = passiveSkillLogicConfig[skillid] --LogError("curSkillData"..skillid) --> 改为数组 - for j = 1, #curSkillData.Type do + for j = 1, #curSkillData.Type do if curSkillData.EffectiveRange[j] == 2 then --战前个人 --LogError("curSkillData.Type "..curSkillData.Type[j]) if curSkillData.Type[j] == 90 then @@ -2319,13 +2364,13 @@ function this.CalculatePassiveSkillsValList(index, skillids,teamCurPropertyName, curSkillData.Value[j][1], curSkillData.Value[j][3] ) - -- elseif curSkillData.Type[j] == 171 then - -- this.GetProAndValByFormula( - -- this.allProVal[index].lvProVal, - -- this.allProVal[index].specialProVal, - -- curSkillData.Value[j][1], - -- curSkillData.Value[j][2] - -- ) + -- elseif curSkillData.Type[j] == 171 then + -- this.GetProAndValByFormula( + -- this.allProVal[index].lvProVal, + -- this.allProVal[index].specialProVal, + -- curSkillData.Value[j][1], + -- curSkillData.Value[j][2] + -- ) end elseif curSkillData.EffectiveRange[j] == 3 then --战前团体 if curSkillData.Type[j] == 90 then @@ -2344,31 +2389,31 @@ function this.CalculatePassiveSkillsValList(index, skillids,teamCurPropertyName, curSkillData.Value[j][1], curSkillData.Value[j][3] ) - -- elseif curSkillData.Type[j]== 129 then - -- if teamCurPropertyName and teamCurPropertyName == curSkillData.Value[j][1] then - - -- this.GetProAndValByFormula( - -- this.allProVal[index].allHeroProVal, - -- this.allProVal[index].specialProVal, - -- curSkillData.Value[j][3], - -- curSkillData.Value[j][2], - -- curSkillData.Value[j][4], - -- curSkillData.Value[j][1] - -- ) - -- elseif not teamCurPropertyName then - - -- this.GetProAndValByFormula( - -- this.allProVal[index].allHeroProVal, - -- this.allProVal[index].specialProVal, - -- curSkillData.Value[j][3], - -- curSkillData.Value[j][2], - -- curSkillData.Value[j][4], - -- curSkillData.Value[j][1] - -- ) - -- end - --elseif curSkillData.Type[j] == 171 then - --目前没有 - --this.GetProAndValByFormula(lvProVal,curSkillData,specialProVal) + -- elseif curSkillData.Type[j]== 129 then + -- if teamCurPropertyName and teamCurPropertyName == curSkillData.Value[j][1] then + + -- this.GetProAndValByFormula( + -- this.allProVal[index].allHeroProVal, + -- this.allProVal[index].specialProVal, + -- curSkillData.Value[j][3], + -- curSkillData.Value[j][2], + -- curSkillData.Value[j][4], + -- curSkillData.Value[j][1] + -- ) + -- elseif not teamCurPropertyName then + + -- this.GetProAndValByFormula( + -- this.allProVal[index].allHeroProVal, + -- this.allProVal[index].specialProVal, + -- curSkillData.Value[j][3], + -- curSkillData.Value[j][2], + -- curSkillData.Value[j][4], + -- curSkillData.Value[j][1] + -- ) + -- end + --elseif curSkillData.Type[j] == 171 then + --目前没有 + --this.GetProAndValByFormula(lvProVal,curSkillData,specialProVal) end end end @@ -2376,12 +2421,13 @@ function this.CalculatePassiveSkillsValList(index, skillids,teamCurPropertyName, end end - return this.allProVal[index].singleHeroProVal, this.allProVal[index].lvProVal, this.allProVal[index].allHeroProVal, this.allProVal[ + return this.allProVal[index].singleHeroProVal, this.allProVal[index].lvProVal, this.allProVal[index].allHeroProVal, + this.allProVal[ index - ].specialProVal + ].specialProVal end -function this.GetProAndValByFormula(proTable, specialProVal, curProId, curProVal, curProlGs,heroPro) - + +function this.GetProAndValByFormula(proTable, specialProVal, curProId, curProVal, curProlGs, heroPro) --LogError(" curProVal:"..curProVal.." curProId:"..curProId.." curProlGs:"..curProlGs) if curProlGs == 1 then --公式 (绝对值加a+b) local curProConfig = ConfigManager.GetConfigDataByKey(ConfigName.PropertyConfig, "PropertyIdInBattle", curProId) @@ -2413,9 +2459,9 @@ function this.GetProAndValByFormula(proTable, specialProVal, curProId, curProVal --LogError("value1:"..proTable[curProConfig2.PropertyId]) else if proTable[curProConfig1.PropertyId] then - proTable[curProConfig1.PropertyId] = proTable[curProConfig1.PropertyId] + curProVal * 10000 + proTable[curProConfig1.PropertyId] = proTable[curProConfig1.PropertyId] + curProVal * 10000 else - proTable[curProConfig1.PropertyId] = curProVal * 10000 + proTable[curProConfig1.PropertyId] = curProVal * 10000 end -- LogError("curProlGs 3:"..proTable[curProConfig1.PropertyId]) end @@ -2423,7 +2469,7 @@ function this.GetProAndValByFormula(proTable, specialProVal, curProId, curProVal local curProConfig = ConfigManager.GetConfigDataByKey(ConfigName.PropertyConfig, "PropertyIdInBattle", curProId) if propertyConfig[curProConfig.PropertyId].Style == 1 then if proTable[curProConfig.PropertyId] then - proTable[curProConfig.PropertyId] = proTable[curProConfig.PropertyId] - curProVal + proTable[curProConfig.PropertyId] = proTable[curProConfig.PropertyId] - curProVal else proTable[curProConfig.PropertyId] = curProVal end @@ -2474,22 +2520,23 @@ function this.GetProAndValByFormula(proTable, specialProVal, curProId, curProVal --LogError("value:"..proTable[curProConfig.PropertyId]) end end + --团队加成 -function this.GetAllHeroTeamAddProVal(teamHeroInfos,curteamHeroDid) +function this.GetAllHeroTeamAddProVal(teamHeroInfos, curteamHeroDid) local teamProVal = {} --英雄 法宝 魂印 被动技能 --> 被动 能力 戒指 for i = 1, 5 do if teamHeroInfos[i] then local heroSkillSingleHeroProVal, heroSkillLvProVal, heroSkillAllHeroProVal, heroSkillSpecialProVal = - CalculateHeroPassiveSkillProAddVal(1, - teamHeroInfos[i].heroId, - nil, - nil, - curteamHeroDid and - HeroManager.GetSingleHeroData(curteamHeroDid).heroConfig.PropertyName or nil) + CalculateHeroPassiveSkillProAddVal(1, + teamHeroInfos[i].heroId, + nil, + nil, + curteamHeroDid and + HeroManager.GetSingleHeroData(curteamHeroDid).heroConfig.PropertyName or nil) -- local falismanSingleHeroProVal, falismanLvProVal, falismanAllHeroProVal, falismanSpecialProVal = - -- CalculateHeroUpTalismanProAddVal(teamHeroInfos[i].heroId,nil,nil, curteamHeroDid and HeroManager.GetSingleHeroData(curteamHeroDid).heroConfig.PropertyName or nil) + -- CalculateHeroUpTalismanProAddVal(teamHeroInfos[i].heroId,nil,nil, curteamHeroDid and HeroManager.GetSingleHeroData(curteamHeroDid).heroConfig.PropertyName or nil) -- local soulPrinSingleHeroProVal,soulPrinLvProVal,soulPrinAllHeroProVal,soulPrinSpecialProVal = CalculateSoulPrintAddVal(teamHeroInfos[i].heroId) -- local singleHeroProValWarWay, lvProValWarWay, allHeroProValWarWay, specialProValWarWay = CalculateWarWayAddVal(teamHeroInfos[i].heroId) -- local singleHeroProValCombatPlan, lvProValCombatPlan, allHeroProValCombatPlan, specialProValCombatPlan = CalculateCombatPlanAddVal(teamHeroInfos[i].heroId) @@ -2497,7 +2544,8 @@ function this.GetAllHeroTeamAddProVal(teamHeroInfos,curteamHeroDid) local _, _, allHeroProValCombatPlanAndWarWay, _ = CalculateCombatPlanAndWarWayAddVal(teamHeroInfos[i].heroId) -- local medalSuitAddPro , lvProValMedalSuit, allHeroProValMedalSuit, specialProValMedalSuit = CalculateMedalSuitAddVal(teamHeroInfos[i].heroId) - local singleHeroProValTalent, lvProValTalent, allHeroProValTalent, specialProValTalent = CalculateTalentAddVal(teamHeroInfos[i].heroId) + local singleHeroProValTalent, lvProValTalent, allHeroProValTalent, specialProValTalent = + CalculateTalentAddVal(teamHeroInfos[i].heroId) this.DoubleTableCompound(teamProVal, heroSkillAllHeroProVal) -- this.DoubleTableCompound(teamProVal, allHeroProValWarWay) -- this.DoubleTableCompound(teamProVal, allHeroProValCombatPlan) @@ -2513,6 +2561,7 @@ function this.GetAllHeroTeamAddProVal(teamHeroInfos,curteamHeroDid) this.DoubleTableCompound(teamProVal, aureoleProAdd) return teamProVal end + this.isLog = false --计算英雄身上所有属性加成 --_type==1 计算当前英雄的所有属性 _type==2 根据_heroDid之后_breakId传过来的值进行计算 _isAllHeroProVal==true 团体加成综合 用字段_allHeroProVal @@ -2527,7 +2576,7 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt end if curHeroData == nil then if type(_heroDid) == "string" then - LogRed("有问题英雄:".._heroDid) + LogRed("有问题英雄:" .. _heroDid) end end local curLvNum = curHeroData.lv -- heroLevelConfig[curHeroData.lv].CharacterLevelPara @@ -2537,63 +2586,66 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt --英雄装备 local allEquipScore = PlayerManager.GetSingHeroAllEquipSkillListScore(curHeroData) - str = str.."英雄装备:"..allEquipScore.."\n" - + str = str .. "英雄装备:" .. allEquipScore .. "\n" + --单体所有属性加成 local lvProVal = {} --100等级所有属性加成 升一级 加一次 local allHeroProVal = _allHeroProVal or {} - this.ShowLog(str.."100等级所有属性加成:", allHeroProVal, type) + this.ShowLog(str .. "100等级所有属性加成:", allHeroProVal, type) --团体所有属性加成 local specialProVal = {} --计算所有装备加成的属性值 local allAddProVal = CalculateHeroUpEquipsProAddVal(curHeroData.dynamicId) - this.ShowLog(str.."计算所有装备加成的属性值:", allAddProVal, type) + this.ShowLog(str .. "计算所有装备加成的属性值:", allAddProVal, type) --公会技能加成 local guildSkillAllProAdd = GuildSkillManager.HeroCalculateGuildSkillWarForce(curHeroData.heroConfig.Profession) - this.ShowLog(str.."公会技能加成:", guildSkillAllProAdd, type) + this.ShowLog(str .. "公会技能加成:", guildSkillAllProAdd, type) --公会活跃 local guildActiveAddPro = MyGuildManager.GetLivenessAllPro() - this.ShowLog(str.."公会活跃:", guildActiveAddPro, type) + this.ShowLog(str .. "公会活跃:", guildActiveAddPro, type) --契约 local generalDate = GeneralManager.getAllData(curHeroData.heroConfig.PropertyName) - this.ShowLog(str.."契约:", generalDate, type) + this.ShowLog(str .. "契约:", generalDate, type) --英雄被动技能属性加成 local heroSkillSingleHeroProVal, heroSkillLvProVal, _, heroSkillSpecialProVal = {}, {}, {}, {} if _type == 1 then - heroSkillSingleHeroProVal, heroSkillLvProVal, _, heroSkillSpecialProVal = CalculateHeroPassiveSkillProAddVal(_type, curHeroData.dynamicId) + heroSkillSingleHeroProVal, heroSkillLvProVal, _, heroSkillSpecialProVal = CalculateHeroPassiveSkillProAddVal( + _type, curHeroData.dynamicId) elseif _type == 2 then - heroSkillSingleHeroProVal, heroSkillLvProVal, _, heroSkillSpecialProVal = CalculateHeroPassiveSkillProAddVal(_type, curHeroData.dynamicId, _breakId, _upStarId) + heroSkillSingleHeroProVal, heroSkillLvProVal, _, heroSkillSpecialProVal = CalculateHeroPassiveSkillProAddVal( + _type, curHeroData.dynamicId, _breakId, _upStarId) end - this.ShowLog(str.."英雄被动技能属性加成1:", heroSkillSingleHeroProVal, type) - this.ShowLog(str.."英雄被动技能属性加成2:", heroSkillLvProVal, type) - this.ShowLog(str.."英雄被动技能属性加成3:", heroSkillSpecialProVal, type) + this.ShowLog(str .. "英雄被动技能属性加成1:", heroSkillSingleHeroProVal, type) + this.ShowLog(str .. "英雄被动技能属性加成2:", heroSkillLvProVal, type) + this.ShowLog(str .. "英雄被动技能属性加成3:", heroSkillSpecialProVal, type) --玩家称号 皮肤 坐骑属性加成 local playerDcorateAdd = PlayerManager.CalculatePlayerDcorateProAddVal() - this.ShowLog(str.."玩家称号:", playerDcorateAdd, type) + this.ShowLog(str .. "玩家称号:", playerDcorateAdd, type) --守护 local supportAddPro = SupportManager.GetAllPropertyAdd() local supportAddProbool = SupportManager.GetDataById("isactive") - this.ShowLog(str.."守护:", supportAddPro, type) + this.ShowLog(str .. "守护:", supportAddPro, type) --先驱 local adjutantAddPro = AdjutantManager.GetAllPropertyAdd() - this.ShowLog(str.."先驱:", adjutantAddPro, type) + this.ShowLog(str .. "先驱:", adjutantAddPro, type) --启明星 local investigateAddPro = FormationCenterManager.GetAllPropertyAdd() - this.ShowLog(str.."启明星:", investigateAddPro, type) + this.ShowLog(str .. "启明星:", investigateAddPro, type) --能力和戒指 - local warWayAndCombatPlanAddPro, lvProValCombatPlanAndWarWay, _, specialProValCombatPlanAndWarWay = CalculateCombatPlanAndWarWayAddVal(curHeroData.dynamicId) - this.ShowLog(str.."能力1:", warWayAndCombatPlanAddPro, type) - this.ShowLog(str.."能力2:", lvProValCombatPlanAndWarWay, type) - this.ShowLog(str.."能力3:", specialProValCombatPlanAndWarWay, type) + local warWayAndCombatPlanAddPro, lvProValCombatPlanAndWarWay, _, specialProValCombatPlanAndWarWay = + CalculateCombatPlanAndWarWayAddVal(curHeroData.dynamicId) + this.ShowLog(str .. "能力1:", warWayAndCombatPlanAddPro, type) + this.ShowLog(str .. "能力2:", lvProValCombatPlanAndWarWay, type) + this.ShowLog(str .. "能力3:", specialProValCombatPlanAndWarWay, type) --芯片 local medalAddPro = CalculateMedalAddVal(curHeroData.dynamicId) - this.ShowLog(str.."芯片1:", medalAddPro, type) + this.ShowLog(str .. "芯片1:", medalAddPro, type) --芯片套装 - local medalSuitAddPro , lvProValMedalSuit, _, specialProValMedalSuit = CalculateMedalSuitAddVal(curHeroData.dynamicId) - this.ShowLog(str.."芯片2:", medalSuitAddPro, type) - this.ShowLog(str.."芯片3:", lvProValMedalSuit, type) - this.ShowLog(str.."芯片4:", specialProValMedalSuit, type) + local medalSuitAddPro, lvProValMedalSuit, _, specialProValMedalSuit = CalculateMedalSuitAddVal(curHeroData.dynamicId) + this.ShowLog(str .. "芯片2:", medalSuitAddPro, type) + this.ShowLog(str .. "芯片3:", lvProValMedalSuit, type) + this.ShowLog(str .. "芯片4:", specialProValMedalSuit, type) --能源基地 local energBaseAddPro = EnergyBaseManager.GetAllPropertyAdd() --法宝的属性加成 falismanProAdd @@ -2619,7 +2671,7 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt -- local totemAddPro, lvProValTotem, allHeroProValTotem, specialProValTotem = CalculateTotemAddVal(curHeroData.dynamicId) --特性 -- local singleHeroProValTalent, lvProValTalent, allHeroProValTalent, specialProValTalent = CalculateTalentAddVal(curHeroData.dynamicId) - + --单体所有属性合并 this.DoubleTableCompound(allAddProVal, guildSkillAllProAdd) this.DoubleTableCompound(allAddProVal, generalDate) @@ -2691,7 +2743,7 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt this.DoubleTableCompound(allAddProVal, allHeroProVal) -- 新加测试代码 -- this.DoubleTableCompound(allAddProVal, specialProVal) - + if _type == 1 then -- allAddProVal[HeroProType.Speed] = -- CalculateSpeedProVal( @@ -2699,7 +2751,7 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt -- curHeroData.breakId, -- speedNum) + allAddProVal[HeroProType.Speed] -- allAddProVal[HeroProType.WarPower] = - -- allEquipScore + -- allEquipScore -- + CalculateWarForce(allAddProVal[HeroProType.Hp], -- allAddProVal[HeroProType.PhysicalDefence], -- allAddProVal[HeroProType.MagicDefence], @@ -2712,36 +2764,36 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt -- allAddProVal[HeroProType.Speed]) allAddProVal[HeroProType.Attack] = this.CalculateProVal( - curHeroData.attack, - curLvNum, - curHeroData.breakId, - curHeroData.upStarId, - HeroProType.Attack, - curHeroData.heroConfig,curHeroData.star) + allAddProVal[HeroProType.Attack] + curHeroData.attack, + curLvNum, + curHeroData.breakId, + curHeroData.upStarId, + HeroProType.Attack, + curHeroData.heroConfig, curHeroData.star) + allAddProVal[HeroProType.Attack] allAddProVal[HeroProType.Hp] = this.CalculateProVal(curHeroData.hp, - curLvNum, - curHeroData.breakId, - curHeroData.upStarId, - HeroProType.Hp, - curHeroData.heroConfig, - curHeroData.star) + allAddProVal[HeroProType.Hp] + curLvNum, + curHeroData.breakId, + curHeroData.upStarId, + HeroProType.Hp, + curHeroData.heroConfig, + curHeroData.star) + allAddProVal[HeroProType.Hp] allAddProVal[HeroProType.PhysicalDefence] = this.CalculateProVal( - curHeroData.pDef, - curLvNum, - curHeroData.breakId, - curHeroData.upStarId, - HeroProType.PhysicalDefence, - curHeroData.heroConfig,curHeroData.star) + allAddProVal[HeroProType.PhysicalDefence] + curHeroData.pDef, + curLvNum, + curHeroData.breakId, + curHeroData.upStarId, + HeroProType.PhysicalDefence, + curHeroData.heroConfig, curHeroData.star) + allAddProVal[HeroProType.PhysicalDefence] allAddProVal[HeroProType.Speed] = this.CalculateProVal( - curHeroData.speed, - curLvNum, - curHeroData.breakId, - curHeroData.upStarId, - HeroProType.Speed, - curHeroData.heroConfig,curHeroData.star) + allAddProVal[HeroProType.Speed] + curHeroData.speed, + curLvNum, + curHeroData.breakId, + curHeroData.upStarId, + HeroProType.Speed, + curHeroData.heroConfig, curHeroData.star) + allAddProVal[HeroProType.Speed] -- allAddProVal[HeroProType.MagicDefence] = -- this.CalculateProVal( -- curHeroData.mDef, @@ -2753,33 +2805,33 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt elseif _type == 2 then allAddProVal[HeroProType.Attack] = this.CalculateProVal(curHeroData.attack, - curLvNum, - _breakId, - _upStarId, - HeroProType.Attack, - curHeroData.heroConfig,curHeroData.star) + allAddProVal[HeroProType.Attack] + curLvNum, + _breakId, + _upStarId, + HeroProType.Attack, + curHeroData.heroConfig, curHeroData.star) + allAddProVal[HeroProType.Attack] allAddProVal[HeroProType.Hp] = this.CalculateProVal(curHeroData.hp, - curLvNum, - _breakId, - _upStarId, - HeroProType.Hp, - curHeroData.heroConfig, - curHeroData.star) + allAddProVal[HeroProType.Hp] + curLvNum, + _breakId, + _upStarId, + HeroProType.Hp, + curHeroData.heroConfig, + curHeroData.star) + allAddProVal[HeroProType.Hp] allAddProVal[HeroProType.PhysicalDefence] = this.CalculateProVal(curHeroData.pDef, - curLvNum, - _breakId, - _upStarId, - HeroProType.PhysicalDefence, - curHeroData.heroConfig,curHeroData.star) + allAddProVal[HeroProType.PhysicalDefence] + curLvNum, + _breakId, + _upStarId, + HeroProType.PhysicalDefence, + curHeroData.heroConfig, curHeroData.star) + allAddProVal[HeroProType.PhysicalDefence] allAddProVal[HeroProType.Speed] = this.CalculateProVal(curHeroData.speed, - curLvNum, - _breakId, - _upStarId, - HeroProType.Speed, - curHeroData.heroConfig,curHeroData.star) +allAddProVal[HeroProType.Speed] + curLvNum, + _breakId, + _upStarId, + HeroProType.Speed, + curHeroData.heroConfig, curHeroData.star) + allAddProVal[HeroProType.Speed] -- allAddProVal[HeroProType.MagicDefence] = -- this.CalculateProVal( -- curHeroData.mDef, @@ -2791,8 +2843,8 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt -- allAddProVal[HeroProType.Speed] = -- CalculateSpeedProVal(curHeroData.speed, -- _breakId,speedNum) + allAddProVal[HeroProType.Speed] - -- allAddProVal[HeroProType.WarPower] = - -- allEquipScore + -- allAddProVal[HeroProType.WarPower] = + -- allEquipScore -- + CalculateWarForce(allAddProVal[HeroProType.Hp], -- allAddProVal[HeroProType.PhysicalDefence], -- allAddProVal[HeroProType.MagicDefence], @@ -2818,12 +2870,12 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt -- 标注 TargetPropertyId加成 --计算装备异妖 特殊百分比加成 (在英雄自身、装备、异妖 绝对值属性算完之后 最后计算百分比加成) -- and allAddProVal[k] > 0 减易属性 非战斗内 - if curProConfig and curProConfig.TargetPropertyId > 0 then + if curProConfig and curProConfig.TargetPropertyId > 0 then allAddProVal[curProConfig.TargetPropertyId] = math.floor( - allAddProVal[curProConfig.TargetPropertyId] + - allAddProVal[curProConfig.TargetPropertyId] * allAddProVal[k] / 10000--修改比例 - ) + allAddProVal[curProConfig.TargetPropertyId] + + allAddProVal[curProConfig.TargetPropertyId] * allAddProVal[k] / 10000 --修改比例 + ) end --战斗里面 PropertyConfig里Style字段,2类型的统一需要除以100在战斗里面 if curProConfig and allAddProVal[k] > 0 and isWar and curProConfig.Style == 2 then @@ -2838,11 +2890,11 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt -- allAddProVal[k] = math.floor(allAddProVal[k]*0.1/(curHeroData.lv+10)/100) end end - + --目前没有 王振兴加 最后计算个属性的乘减算 -- if curHeroData.MLSproList and LengthOfTable(curHeroData.MLSproList)>0 then -- for k, v in pairs(curHeroData.MLSproList) do - -- local mlsPro = curHeroData.MLSproList[k] + -- local mlsPro = curHeroData.MLSproList[k] -- if allAddProVal[mlsPro.proId] then -- -- local aaa = 1-mlsPro.value -- LogError("has MLSproList !!!!!!!!!!!!!!") @@ -2850,25 +2902,25 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt -- allAddProVal[mlsPro.proId] = value -- end -- end - -- end + -- end -- curHeroData.MLSproList = {} - + --最后计算英雄战斗力 if _type == 1 then - allAddProVal[HeroProType.WarPower] = - allEquipScore + - CalculateWarForce(allAddProVal) + - ConfigManager.GetConfigData(ConfigName.SpecialConfig, 125).Value + allAddProVal[HeroProType.WarPower] = + allEquipScore + + CalculateWarForce(allAddProVal) + + ConfigManager.GetConfigData(ConfigName.SpecialConfig, 125).Value -- + allSoulPrintAddWarPowerVal - str = str.."\n".. - "装备:"..allEquipScore.."\n".. - "属性:"..CalculateWarForce(allAddProVal).."\n".. - "偏移:"..ConfigManager.GetConfigData(ConfigName.SpecialConfig, 125).Value + str = str .. "\n" .. + "装备:" .. allEquipScore .. "\n" .. + "属性:" .. CalculateWarForce(allAddProVal) .. "\n" .. + "偏移:" .. ConfigManager.GetConfigData(ConfigName.SpecialConfig, 125).Value elseif _type == 2 then - allAddProVal[HeroProType.WarPower] = - allEquipScore + - CalculateWarForce(allAddProVal) + - ConfigManager.GetConfigData(ConfigName.SpecialConfig, 125).Value + allAddProVal[HeroProType.WarPower] = + allEquipScore + + CalculateWarForce(allAddProVal) + + ConfigManager.GetConfigData(ConfigName.SpecialConfig, 125).Value -- + allSoulPrintAddWarPowerVal end if this.isLog then @@ -2881,11 +2933,11 @@ function this.DoubleTableCompound(allProVal, addProVal) if addProVal and LengthOfTable(addProVal) > 0 then for k, v in pairs(addProVal) do -- if v > 0 then -- 负数属性也可加入 加入减益计算 - if allProVal[k] then - allProVal[k] = allProVal[k] + v - else - allProVal[k] = v - end + if allProVal[k] then + allProVal[k] = allProVal[k] + v + else + allProVal[k] = v + end -- end end end @@ -2929,7 +2981,7 @@ function this.CalculateSingleModuleProPower(_type, _heroDid) curHeroData.breakId, curHeroData.upStarId, HeroProType.Attack, - curHeroData.heroConfig,curHeroData.star) + curHeroData.heroConfig, curHeroData.star) allAddProVal[HeroProType.Hp] = this.CalculateProVal( curHeroData.hp, @@ -2946,7 +2998,7 @@ function this.CalculateSingleModuleProPower(_type, _heroDid) curHeroData.breakId, curHeroData.upStarId, HeroProType.PhysicalDefence, - curHeroData.heroConfig,curHeroData.star) + curHeroData.heroConfig, curHeroData.star) -- allAddProVal[HeroProType.MagicDefence] = -- this.CalculateProVal( -- curHeroData.mDef, @@ -2955,7 +3007,7 @@ function this.CalculateSingleModuleProPower(_type, _heroDid) -- curHeroData.upStarId, -- HeroProType.MagicDefence, -- curHeroData.heroConfig) - -- allAddProVal[HeroProType.Speed] = + -- allAddProVal[HeroProType.Speed] = -- CalculateSpeedProVal( -- curHeroData.speed, -- curHeroData.breakId, @@ -3040,6 +3092,7 @@ this.mapShotTimeItemData = {} function this.InitMapShotTimeHeroBagData(_mapHero) this.mapShotTimeItemData[#this.mapShotTimeItemData + 1] = _mapHero end + --通过职业筛选英雄 function this.GetHeroDataByProfession(_profession) local heros = {} @@ -3072,6 +3125,7 @@ function this.GetHeroDataByProperty(_property, _lvLimit) end return heros end + --自选招募英雄数据 function this.GetSelfRewardHeroData(_proId, ActId) local ChosenOptionConfig = ConfigManager.GetConfig(ConfigName.ChosenOptionConfig) @@ -3080,7 +3134,7 @@ function this.GetSelfRewardHeroData(_proId, ActId) local isAdd = false for i, v in ConfigPairs(ChosenOptionConfig) do if v.ActivityId == ActId then - if v.UnlockActivityId == nil then --根据活动隐藏item + if v.UnlockActivityId == nil then --根据活动隐藏item if _proId == 0 then heros[index] = v index = index + 1 @@ -3089,7 +3143,7 @@ function this.GetSelfRewardHeroData(_proId, ActId) heros[index] = v index = index + 1 end - end + end else if #RecruitManager.everOpenedActIds > 0 then for inde, value in ipairs(RecruitManager.everOpenedActIds) do @@ -3105,7 +3159,7 @@ function this.GetSelfRewardHeroData(_proId, ActId) index = index + 1 isAdd = true end - end + end break end end @@ -3114,27 +3168,28 @@ function this.GetSelfRewardHeroData(_proId, ActId) break end end - end + end end end end - + return heros end + --获取自选招募单个英雄数据 -function this.GetOneHeroData(ActId,HeroId) +function this.GetOneHeroData(ActId, HeroId) local ChosenOptionConfig = ConfigManager.GetConfig(ConfigName.ChosenOptionConfig) local hero = {} local index = 1 for i, v in ConfigPairs(ChosenOptionConfig) do if v.ActivityId == ActId and v.HeroID == HeroId then - hero = v return hero end end return hero end + --通过品阶筛选英雄 function this.GetHeroDataByNatural(_natural) local heros = {} @@ -3145,6 +3200,7 @@ function this.GetHeroDataByNatural(_natural) end return heros end + --检测单个英雄是否有可穿的法宝 function this.GetHeroIsUpTalisman(heroDid) if heroDatas[heroDid] then @@ -3168,14 +3224,14 @@ function this.GetHeroIsUpTalisman(heroDid) if GetAllTalismanData and #GetAllTalismanData > 0 then for i = 1, #GetAllTalismanData do if GetAllTalismanData[i].power > curTalismanData.power then - return {GetAllTalismanData[i]} + return { GetAllTalismanData[i] } end end end return {} else if GetAllTalismanData and #GetAllTalismanData > 0 then - return {GetAllTalismanData[1]} + return { GetAllTalismanData[1] } else return {} end @@ -3183,6 +3239,7 @@ function this.GetHeroIsUpTalisman(heroDid) end return {} end + --获取妖灵师技能最大等级 function this.GetHeroSkillMaxLevel(heroTId, skillPos) local curHeroData = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroTId) @@ -3199,12 +3256,13 @@ function this.GetHeroSkillMaxLevel(heroTId, skillPos) -- maxSkillLv = curHeroData.OpenPassiveSkillRules[#curHeroData.OpenPassiveSkillRules][2] % 10 -- end -- return maxSkillLv - local unLockSkills = ConfigManager.GetAllConfigsDataByKey(ConfigName.UnlockSkill,"SkillPos",skillPos) - table.sort(unLockSkills,function (a,b) + local unLockSkills = ConfigManager.GetAllConfigsDataByKey(ConfigName.UnlockSkill, "SkillPos", skillPos) + table.sort(unLockSkills, function(a, b) return a.Star > b.Star end) local maxStar = curHeroData.MaxRank - local maxRankUpConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.HeroRankupConfig,"Star",curHeroData.Star,"JudgeClass",1,"Type",1) + local maxRankUpConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.HeroRankupConfig, "Star", + curHeroData.Star, "JudgeClass", 1, "Type", 1) local maxRank if maxRankUpConfig then maxRank = maxRankUpConfig.Phase[2] @@ -3246,6 +3304,7 @@ function this.GetReturnHeroDatas(_star) end return heros2 end + function this.GetCurHeroSidAndCurStarAllSkillDatas(sid, star) local allSkillDatas = {} local skillIndex = 1 @@ -3274,18 +3333,22 @@ function this.GetCurHeroSidAndCurStarAllSkillDatas(sid, star) end return allSkillDatas end + function this.GetCurHeroSidAndCurStarAllSkillDatas2(sid, star) local allSkillDatas = {} local skillIndex = 1 local curHeroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, sid) isHeroUpStar = false - local upStarRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroRankupConfig, "Star", curHeroConfig.Star, "LimitStar", star) + local upStarRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroRankupConfig, "Star", + curHeroConfig.Star, "LimitStar", star) if curHeroConfig.OpenSkillRules then for i = 1, #curHeroConfig.OpenSkillRules do if curHeroConfig.OpenSkillRules[i][1] <= star then local heroSkill = {} heroSkill.skillId = curHeroConfig.OpenSkillRules[i][2] - local skilllogicconfig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", heroSkill.skillId, "Level", this.GetSkillUnlockLv(curHeroConfig.OpenSkillRules[i][1], star, upStarRankUpConfig.Phase[2])) + local skilllogicconfig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", + heroSkill.skillId, "Level", + this.GetSkillUnlockLv(curHeroConfig.OpenSkillRules[i][1], star, upStarRankUpConfig.Phase[2])) if skilllogicconfig ~= nil then heroSkill.skillConfig = skillConfig[skilllogicconfig.Id] end @@ -3299,8 +3362,10 @@ function this.GetCurHeroSidAndCurStarAllSkillDatas2(sid, star) if curHeroConfig.OpenPassiveSkillRules[i][1] <= star then local heroSkill = {} heroSkill.skillId = curHeroConfig.OpenPassiveSkillRules[i][2] - local skilllogicconfig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PassiveSkillLogicConfig, "Group", heroSkill.skillId, "Level", this.GetSkillUnlockLv(curHeroConfig.OpenPassiveSkillRules[i][1], star, upStarRankUpConfig.Phase[2])) - if skilllogicconfig~=nil then + local skilllogicconfig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PassiveSkillLogicConfig, + "Group", heroSkill.skillId, "Level", + this.GetSkillUnlockLv(curHeroConfig.OpenPassiveSkillRules[i][1], star, upStarRankUpConfig.Phase[2])) + if skilllogicconfig ~= nil then heroSkill.skillConfig = passiveSkillConfig[skilllogicconfig.Id] end allSkillDatas[skillIndex] = heroSkill @@ -3310,6 +3375,7 @@ function this.GetCurHeroSidAndCurStarAllSkillDatas2(sid, star) end return allSkillDatas end + function this.DetectionOpenFiveStarActivity(starUpGiftNum) Game.GlobalEvent:DispatchEvent(GameEvent.PatFace.PatFaceSend, FacePanelType.GrowGift, starUpGiftNum) end @@ -3326,6 +3392,7 @@ function this.IsHeroHaveSoulPrintFunc(heroId) end return false end + -- 判断英雄是否有法宝功能 function this.IsHeroHaveTalismanFunc(heroId) local unlock = ConfigManager.GetConfigData(ConfigName.GameSetting, 1).EquipTalismanaUnlock @@ -3338,7 +3405,8 @@ function this.IsHeroHaveTalismanFunc(heroId) end return false end -function this.SetHeroFormationList(heroDid,teamId,isAddOrDel) + +function this.SetHeroFormationList(heroDid, teamId, isAddOrDel) if heroDatas[heroDid] then if isAddOrDel and this.heroResolveLicence[teamId] then heroDatas[heroDid].formationList[teamId] = teamId @@ -3347,6 +3415,7 @@ function this.SetHeroFormationList(heroDid,teamId,isAddOrDel) end end end + --获取探索所有英雄信息 function this.GetFingTreasureAllHeroDatas() local allUpZhenHeroList = FindTreasureManager.GetAllUpHeros() @@ -3358,6 +3427,7 @@ function this.GetFingTreasureAllHeroDatas() end return heros end + --回溯 和 献祭 返回item信息 local rewardGroup = ConfigManager.GetConfig(ConfigName.RewardGroup) function this.GetHeroReturnItems(selectHeroData, type, spe) @@ -3381,25 +3451,25 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end local heroReturnConfig = ConfigManager.TryGetConfigDataByDoubleKey( - ConfigName.HeroReturn, - "HeroId", - curHeroData.id, - "Star", - pId - ) + ConfigName.HeroReturn, + "HeroId", + curHeroData.id, + "Star", + pId + ) local rewardShowStr1 = {} if not heroReturnConfig then else - ShowItemlist[heroReturnConfig.HeroId] = {heroReturnConfig.HeroId,1,curHeroData.star} + ShowItemlist[heroReturnConfig.HeroId] = { heroReturnConfig.HeroId, 1, curHeroData.star } rewardShowStr1 = heroReturnConfig.RankupReturn cost = heroReturnConfig.ReturnConsume - if rewardShowStr1 then - for k,v in ipairs(rewardShowStr1) do + if rewardShowStr1 then + for k, v in ipairs(rewardShowStr1) do if v[1] and v[2] then if not ShowItemlist[v[1]] then - ShowItemlist[v[1]] = {v[1], v[2] * specificValue} + ShowItemlist[v[1]] = { v[1], v[2] * specificValue } else - ShowItemlist[v[1]] = {v[1],ShowItemlist[v[1]][2] + v[2] * specificValue} + ShowItemlist[v[1]] = { v[1], ShowItemlist[v[1]][2] + v[2] * specificValue } end end end @@ -3407,18 +3477,18 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end rewardShowStr1 = ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, v.lv).SumConsume if rewardShowStr1 then - for k, v in ipairs(rewardShowStr1) do + for k, v in ipairs(rewardShowStr1) do if not ShowItemlist[v[1]] then - ShowItemlist[v[1]] = {v[1], v[2] * specificValue} + ShowItemlist[v[1]] = { v[1], v[2] * specificValue } else - ShowItemlist[v[1]] = {v[1],ShowItemlist[v[1]][2] + v[2] * specificValue} + ShowItemlist[v[1]] = { v[1], ShowItemlist[v[1]][2] + v[2] * specificValue } end end end --this.GetHeroReturnItems2(ShowItemlist,allRewardData) end local dropList = {} - for n,m in pairs(ShowItemlist) do + for n, m in pairs(ShowItemlist) do local curReward = {} curReward.id = m[1] curReward.num = math.floor(m[2]) @@ -3438,13 +3508,12 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) -- curReward.num = 1 -- curReward.itemConfig = itemConfig[curReward.id] -- curReward.star = nil - -- table.insert(dropList, curReward) + -- table.insert(dropList, curReward) -- end -- end -- end - - return dropList, cost + return dropList, cost elseif type == GENERAL_POPUP_TYPE.ResolveDismantle then --献祭 local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 35).Value) / 10000 for i, v in pairs(selectHeroData) do @@ -3471,44 +3540,47 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) local showItem = rewardGroup[rewardGroupId].ShowItem if showItem and LengthOfTable(showItem) > 0 then for i = 1, #showItem do - table.insert(ShowItemlist, {showItem[i][1], showItem[i][2]}) + table.insert(ShowItemlist, { showItem[i][1], showItem[i][2] }) end end end else if pId > 0 then - local heroRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroSacrifice,"Type",2,"Key",pId) + local heroRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroSacrifice, "Type", 2, + "Key", pId) if heroRankUpConfig then local sumConsume = heroRankUpConfig.Value for i = 1, #sumConsume do - table.insert(ShowItemlist, {sumConsume[i][1], sumConsume[i][2] * specificValue}) + table.insert(ShowItemlist, { sumConsume[i][1], sumConsume[i][2] * specificValue }) end else - + end end if curHeroData.star > 1 then - local heroRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroSacrifice,"Type",1,"Key",curHeroData.star) + local heroRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroSacrifice, "Type", 1, + "Key", curHeroData.star) if heroRankUpConfig then local sumConsume = heroRankUpConfig.Value for i = 1, #sumConsume do - table.insert(ShowItemlist, {sumConsume[i][1], sumConsume[i][2] * specificValue}) + table.insert(ShowItemlist, { sumConsume[i][1], sumConsume[i][2] * specificValue }) end end else - + end end local temp = {} if curHeroData.talismanList > 1 then - local temp1 = tonumber(ConfigManager.GetConfigData(ConfigName.HeroConfig, curHeroData.id).EquipTalismana[2]) + local temp1 = tonumber(ConfigManager.GetConfigData(ConfigName.HeroConfig, curHeroData.id).EquipTalismana + [2]) for i = 1, curHeroData.talismanList - 1 do - temp = ConfigManager.GetConfigDataByDoubleKey(ConfigName.EquipTalismana,"TalismanaId",temp1,"Level",i).RankupBasicMaterial - for i = 1,#temp do - table.insert(ShowItemlist, {temp[i][1], temp[i][2] * specificValue}) + temp = ConfigManager.GetConfigDataByDoubleKey(ConfigName.EquipTalismana, "TalismanaId", temp1, + "Level", i).RankupBasicMaterial + for i = 1, #temp do + table.insert(ShowItemlist, { temp[i][1], temp[i][2] * specificValue }) end end - end if curHeroData.lv > 1 then local rewardShowStr2 = {} @@ -3516,7 +3588,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) if rewardShowStr2 then for i = 1, #rewardShowStr2 do if rewardShowStr2[i] and rewardShowStr2[i][1] then - table.insert(ShowItemlist, {rewardShowStr2[i][1], rewardShowStr2[i][2] * specificValue}) + table.insert(ShowItemlist, { rewardShowStr2[i][1], rewardShowStr2[i][2] * specificValue }) end end end @@ -3527,13 +3599,14 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) local warWayData warWayData = ConfigManager.GetConfigData(ConfigName.WarWaySkillConfig, curHeroData.warWaySlot1Id) if warWayData then - local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig,"WarWayGroup",warWayData.WarWayGroup) + local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig, "WarWayGroup", + warWayData.WarWayGroup) for i = 1, #dataList do if dataList[i].Level <= warWayData.Level then for j = 1, #dataList[i].UpgradeCost do - table.insert(ShowItemlist, {dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2]}) + table.insert(ShowItemlist, { dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j] + [2] }) end - end end end @@ -3542,13 +3615,14 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) local warWayData warWayData = ConfigManager.GetConfigData(ConfigName.WarWaySkillConfig, curHeroData.warWaySlot2Id) if warWayData then - local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig,"WarWayGroup",warWayData.WarWayGroup) + local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig, "WarWayGroup", + warWayData.WarWayGroup) for i = 1, #dataList do if dataList[i].Level <= warWayData.Level then for j = 1, #dataList[i].UpgradeCost do - table.insert(ShowItemlist, {dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2]}) + table.insert(ShowItemlist, { dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j] + [2] }) end - end end end @@ -3557,13 +3631,14 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) local warWayData warWayData = ConfigManager.GetConfigData(ConfigName.WarWaySkillConfig, curHeroData.warWaySlot3Id) if warWayData then - local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig,"WarWayGroup",warWayData.WarWayGroup) + local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig, "WarWayGroup", + warWayData.WarWayGroup) for i = 1, #dataList do if dataList[i].Level <= warWayData.Level then for j = 1, #dataList[i].UpgradeCost do - table.insert(ShowItemlist, {dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2]}) + table.insert(ShowItemlist, { dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j] + [2] }) end - end end end @@ -3584,7 +3659,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end ) return dropList - elseif type == GENERAL_POPUP_TYPE.ResolveDebris then --碎片回收 + elseif type == GENERAL_POPUP_TYPE.ResolveDebris then --碎片回收 local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 35).Value) / 10000 for i, v in pairs(selectHeroData) do --当英雄一次都未突破和进阶时 @@ -3610,41 +3685,45 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) local showItem = rewardGroup[rewardGroupId].ShowItem if showItem and LengthOfTable(showItem) > 0 then for i = 1, #showItem do - table.insert(ShowItemlist, {showItem[i][1], showItem[i][2]}) + table.insert(ShowItemlist, { showItem[i][1], showItem[i][2] }) end end end else if pId > 0 then - local heroRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroSacrifice,"Type",2,"Key",pId) + local heroRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroSacrifice, "Type", 2, + "Key", pId) if heroRankUpConfig then local sumConsume = heroRankUpConfig.Value for i = 1, #sumConsume do - table.insert(ShowItemlist, {sumConsume[i][1], sumConsume[i][2] * specificValue}) + table.insert(ShowItemlist, { sumConsume[i][1], sumConsume[i][2] * specificValue }) end else - + end end if curHeroData.star > 1 then - local heroRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroSacrifice,"Type",1,"Key",curHeroData.star) + local heroRankUpConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.HeroSacrifice, "Type", 1, + "Key", curHeroData.star) if heroRankUpConfig then local sumConsume = heroRankUpConfig.Value for i = 1, #sumConsume do - table.insert(ShowItemlist, {sumConsume[i][1], sumConsume[i][2] * specificValue}) + table.insert(ShowItemlist, { sumConsume[i][1], sumConsume[i][2] * specificValue }) end end else - + end end local temp = {} if curHeroData.talismanList > 1 then - local temp1 = tonumber(ConfigManager.GetConfigData(ConfigName.HeroConfig, curHeroData.id).EquipTalismana[2]) + local temp1 = tonumber(ConfigManager.GetConfigData(ConfigName.HeroConfig, curHeroData.id).EquipTalismana + [2]) for i = 1, curHeroData.talismanList - 1 do - temp = ConfigManager.GetConfigDataByDoubleKey(ConfigName.EquipTalismana,"TalismanaId",temp1,"Level",i).RankupBasicMaterial - for i = 1,#temp do - table.insert(ShowItemlist, {temp[i][1], temp[i][2] * specificValue}) + temp = ConfigManager.GetConfigDataByDoubleKey(ConfigName.EquipTalismana, "TalismanaId", temp1, + "Level", i).RankupBasicMaterial + for i = 1, #temp do + table.insert(ShowItemlist, { temp[i][1], temp[i][2] * specificValue }) end end end @@ -3654,7 +3733,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) if rewardShowStr2 then for i = 1, #rewardShowStr2 do if rewardShowStr2[i] and rewardShowStr2[i][1] then - table.insert(ShowItemlist, {rewardShowStr2[i][1], rewardShowStr2[i][2] * specificValue}) + table.insert(ShowItemlist, { rewardShowStr2[i][1], rewardShowStr2[i][2] * specificValue }) end end end @@ -3674,7 +3753,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end ) return dropList - elseif type == GENERAL_POPUP_TYPE.GeneralPopup_HeroStarBack then--改装厂回溯(普通高级) + elseif type == GENERAL_POPUP_TYPE.GeneralPopup_HeroStarBack then --改装厂回溯(普通高级) if spe == 1 then local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 34).Value) / 10000 local ShowItemlist = {} @@ -3693,23 +3772,23 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end local heroReturnConfig = ConfigManager.TryGetConfigDataByDoubleKey( - ConfigName.HeroReturn, - "HeroId", - curHeroData.id, - "Star", - pId - ) + ConfigName.HeroReturn, + "HeroId", + curHeroData.id, + "Star", + pId + ) local rewardShowStr1 = {} if not heroReturnConfig then else rewardShowStr1 = heroReturnConfig.RankupReturn - if rewardShowStr1 then - for k,v in ipairs(rewardShowStr1) do + if rewardShowStr1 then + for k, v in ipairs(rewardShowStr1) do if v[1] and v[2] then if not ShowItemlist[v[1]] then - ShowItemlist[v[1]] = {v[1], v[2] * specificValue} + ShowItemlist[v[1]] = { v[1], v[2] * specificValue } else - ShowItemlist[v[1]] = {v[1],ShowItemlist[v[1]][2] + v[2] * specificValue} + ShowItemlist[v[1]] = { v[1], ShowItemlist[v[1]][2] + v[2] * specificValue } end end end @@ -3717,24 +3796,26 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end rewardShowStr1 = ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, v.lv).SumConsume if rewardShowStr1[1][2] then - for k,v in ipairs(rewardShowStr1) do + for k, v in ipairs(rewardShowStr1) do if not ShowItemlist[v[1]] then - ShowItemlist[v[1]] = {v[1], v[2] * specificValue} + ShowItemlist[v[1]] = { v[1], v[2] * specificValue } else - ShowItemlist[v[1]] = {v[1],ShowItemlist[v[1]][2] + v[2] * specificValue} + ShowItemlist[v[1]] = { v[1], ShowItemlist[v[1]][2] + v[2] * specificValue } end end end - - if curHeroData.warWaySlot1Id ~= nil and curHeroData.warWaySlot1Id ~= 0 then + + if curHeroData.warWaySlot1Id ~= nil and curHeroData.warWaySlot1Id ~= 0 then local warWayData warWayData = ConfigManager.GetConfigData(ConfigName.WarWaySkillConfig, curHeroData.warWaySlot1Id) if warWayData then - local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig,"WarWayGroup",warWayData.WarWayGroup) + local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig, "WarWayGroup", + warWayData.WarWayGroup) for i = 1, #dataList do if dataList[i].Level <= warWayData.Level then for j = 1, #dataList[i].UpgradeCost do - table.insert(ShowItemlist, {dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2]}) + table.insert(ShowItemlist, + { dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2] }) end end end @@ -3742,7 +3823,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end end local dropList = {} - for n,m in pairs(ShowItemlist) do + for n, m in pairs(ShowItemlist) do local curReward = {} curReward.id = m[1] curReward.num = math.floor(m[2]) @@ -3750,7 +3831,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) curReward.star = m[3] or nil table.insert(dropList, curReward) end - + return dropList elseif spe == 2 then local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 34).Value) / 10000 @@ -3778,11 +3859,11 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) -- ) -- local rewardShowStr1 = {} -- if not heroReturnConfig then - + -- else -- rewardShowStr1 = heroReturnConfig.RankupReturn -- if rewardShowStr1 then - -- for k,v in ipairs(rewardShowStr1) do + -- for k,v in ipairs(rewardShowStr1) do -- if v[1] and v[2] then -- if not ShowItemlist[v[1]] then -- ShowItemlist[v[1]] = {v[1], v[2] * specificValue} @@ -3795,7 +3876,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) -- end -- rewardShowStr1 = ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, v.lv).SumConsume -- if rewardShowStr1 then - -- for k,v in ipairs(rewardShowStr1) do + -- for k,v in ipairs(rewardShowStr1) do -- if not ShowItemlist[v[1]] then -- ShowItemlist[v[1]] = {v[1], v[2] * specificValue} -- else @@ -3803,17 +3884,19 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) -- end -- end -- end - + if curHeroData.warWaySlot2Id ~= nil and curHeroData.warWaySlot2Id ~= 0 then local warWayData warWayData = ConfigManager.GetConfigData(ConfigName.WarWaySkillConfig, curHeroData.warWaySlot2Id) if warWayData then - local dataList=ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig,"WarWayGroup",warWayData.WarWayGroup) - + local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig, "WarWayGroup", + warWayData.WarWayGroup) + for i = 1, #dataList do if dataList[i].Level <= warWayData.Level then for j = 1, #dataList[i].UpgradeCost do - table.insert(ShowItemlist, {dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2]}) + table.insert(ShowItemlist, + { dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2] }) end end end @@ -3821,7 +3904,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end end local dropList = {} - for n,m in pairs(ShowItemlist) do + for n, m in pairs(ShowItemlist) do local curReward = {} curReward.id = m[1] curReward.num = math.floor(m[2]) @@ -3829,7 +3912,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) curReward.star = m[3] or nil table.insert(dropList, curReward) end - + return dropList elseif spe == 3 then local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 34).Value) / 10000 @@ -3857,11 +3940,11 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) -- ) -- local rewardShowStr1 = {} -- if not heroReturnConfig then - + -- else -- rewardShowStr1 = heroReturnConfig.RankupReturn -- if rewardShowStr1 then - -- for k,v in ipairs(rewardShowStr1) do + -- for k,v in ipairs(rewardShowStr1) do -- if v[1] and v[2] then -- if not ShowItemlist[v[1]] then -- ShowItemlist[v[1]] = {v[1], v[2] * specificValue} @@ -3874,7 +3957,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) -- end -- rewardShowStr1 = ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, v.lv).SumConsume -- if rewardShowStr1 then - -- for k,v in ipairs(rewardShowStr1) do + -- for k,v in ipairs(rewardShowStr1) do -- if not ShowItemlist[v[1]] then -- ShowItemlist[v[1]] = {v[1], v[2] * specificValue} -- else @@ -3882,17 +3965,19 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) -- end -- end -- end - + if curHeroData.warWaySlot3Id ~= nil and curHeroData.warWaySlot3Id ~= 0 then local warWayData warWayData = ConfigManager.GetConfigData(ConfigName.WarWaySkillConfig, curHeroData.warWaySlot3Id) if warWayData then - local dataList=ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig,"WarWayGroup",warWayData.WarWayGroup) - + local dataList = ConfigManager.GetAllConfigsDataByKey(ConfigName.WarWaySkillConfig, "WarWayGroup", + warWayData.WarWayGroup) + for i = 1, #dataList do if dataList[i].Level <= warWayData.Level then for j = 1, #dataList[i].UpgradeCost do - table.insert(ShowItemlist, {dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2]}) + table.insert(ShowItemlist, + { dataList[i].UpgradeCost[j][1], dataList[i].UpgradeCost[j][2] }) end end end @@ -3900,7 +3985,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) end end local dropList = {} - for n,m in pairs(ShowItemlist) do + for n, m in pairs(ShowItemlist) do local curReward = {} curReward.id = m[1] curReward.num = math.floor(m[2]) @@ -3908,7 +3993,7 @@ function this.GetHeroReturnItems(selectHeroData, type, spe) curReward.star = m[3] or nil table.insert(dropList, curReward) end - + return dropList end end @@ -3933,11 +4018,13 @@ function this.UpdateSkillIdList(heroData) heroData.skillIdList = {} this.SetSkillListByRules(heroData, false, heroData.skillIdList) end + --更新英雄被动技能 function this.UpdatePassiveHeroSkill(heroData) heroData.passiveSkillList = {} --被动技 this.SetSkillListByRules(heroData, true, heroData.passiveSkillList) end + --> 获取技能数据 by Rules(HeroConfig) function this.SetSkillListByRules(heroData, isPassivity, RetList) local Rules = nil @@ -3946,7 +4033,7 @@ function this.SetSkillListByRules(heroData, isPassivity, RetList) else Rules = heroData.heroConfig.OpenSkillRules end - + if Rules then for i = 1, #Rules do while true do @@ -3961,11 +4048,14 @@ function this.SetSkillListByRules(heroData, isPassivity, RetList) if unlockLv == -1 then break end - local skilllogicconfig = ConfigManager.GetAllConfigsDataByDoubleKey(isPassivity and ConfigName.PassiveSkillLogicConfig or ConfigName.SkillLogicConfig, "Group", Rules[i][2], "Level", unlockLv) + local skilllogicconfig = ConfigManager.GetAllConfigsDataByDoubleKey( + isPassivity and ConfigName.PassiveSkillLogicConfig or ConfigName.SkillLogicConfig, "Group", Rules[i][2], + "Level", unlockLv) local heroSkill = {} heroSkill.skillId = skilllogicconfig.Id - heroSkill.skillConfig = isPassivity and passiveSkillConfig[skilllogicconfig.Id] or skillConfig[skilllogicconfig.Id] + heroSkill.skillConfig = isPassivity and passiveSkillConfig[skilllogicconfig.Id] or + skillConfig[skilllogicconfig.Id] table.insert(RetList, heroSkill) break @@ -3998,13 +4088,14 @@ function this.GetSkillIdsByHeroRules(_rules, _star, _break) --> 改解锁机制 local pId if _break == 0 then - pId=0 + pId = 0 else - pId= heroRankUpConfig[_break].Phase[2] + pId = heroRankUpConfig[_break].Phase[2] end local unlockLv = this.GetSkillUnlockLv(_rules[i][1], _star, pId) if unlockLv ~= -1 then - local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", _rules[i][2], "Level", unlockLv) + local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", + _rules[i][2], "Level", unlockLv) local heroSkill = {} heroSkill.skillId = skilllogicconfig.Id heroSkill.skillConfig = skillConfig[skilllogicconfig.Id] @@ -4015,6 +4106,7 @@ function this.GetSkillIdsByHeroRules(_rules, _star, _break) end return RetList end + function this.GetSkillIdsByHeroRulesRole(_rules, _star, _break, _heroData) local heroData = _heroData local RetList = {} @@ -4029,7 +4121,8 @@ function this.GetSkillIdsByHeroRulesRole(_rules, _star, _break, _heroData) end local unlockLv = this.GetSkillUnlockLv(_rules[i][1], _star, pId) if unlockLv ~= -1 then - local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", _rules[i][2], "Level", unlockLv) + local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", + _rules[i][2], "Level", unlockLv) local heroSkill = {} local skillId = skilllogicconfig.Id @@ -4037,7 +4130,7 @@ function this.GetSkillIdsByHeroRulesRole(_rules, _star, _break, _heroData) if heroData then local skillIdStr = tostring(skillId) local slot = tonumber(string.sub(skillIdStr, -2, -2)) - + local partsData = heroData.partsData local partsAddLv = 0 if partsData[slot] then @@ -4053,11 +4146,12 @@ function this.GetSkillIdsByHeroRulesRole(_rules, _star, _break, _heroData) heroSkill.lock = false table.insert(RetList, heroSkill) else - local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", _rules[i][2], "Level", 1) + local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", + _rules[i][2], "Level", 1) local heroSkill = {} heroSkill.skillId = skilllogicconfig.Id heroSkill.skillConfig = skillConfig[skilllogicconfig.Id] - heroSkill.lock=true + heroSkill.lock = true table.insert(RetList, heroSkill) end end @@ -4080,12 +4174,13 @@ function this.GetSkillPartsAddLevel(_rules, _star, _break, _heroData) end local unlockLv = this.GetSkillUnlockLv(_rules[i][1], _star, pId) if unlockLv ~= -1 then - local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", _rules[i][2], "Level", unlockLv) + local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SkillLogicConfig, "Group", + _rules[i][2], "Level", unlockLv) local skillId = skilllogicconfig.Id --> 部件add 只有全部解锁会有此功能 下面undo if heroData then local skillIdStr = tostring(skillId) - local slot = tonumber(string.sub(skillIdStr, -2, -2)) + local slot = tonumber(string.sub(skillIdStr, -2, -2)) local partsData = heroData.partsData local partsAddLv = 0 if partsData[slot] then @@ -4109,13 +4204,14 @@ function this.GetPassiveSkillIdsByHeroRules(_rules, _star, _break) --> 改解锁机制 local pId if _break == 0 then - pId=0 + pId = 0 else - pId= heroRankUpConfig[_break].Phase[2] + pId = heroRankUpConfig[_break].Phase[2] end local unlockLv = this.GetSkillUnlockLv(_rules[i][1], _star, pId) if unlockLv ~= -1 then - local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.PassiveSkillLogicConfig, "Group", _rules[i][2], "Level", unlockLv) + local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.PassiveSkillLogicConfig, + "Group", _rules[i][2], "Level", unlockLv) local heroSkill = {} heroSkill.skillId = skilllogicconfig.Id @@ -4126,6 +4222,7 @@ function this.GetPassiveSkillIdsByHeroRules(_rules, _star, _break) end return RetList end + function this.GetPassiveSkillIdsByHeroRuleslock(_rules, _star, _break, _heroData) local heroData = _heroData local RetList = {} @@ -4140,14 +4237,15 @@ function this.GetPassiveSkillIdsByHeroRuleslock(_rules, _star, _break, _heroData end local unlockLv = this.GetSkillUnlockLv(_rules[i][1], _star, pId) if unlockLv ~= -1 then - local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.PassiveSkillLogicConfig, "Group", _rules[i][2], "Level", unlockLv) + local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.PassiveSkillLogicConfig, + "Group", _rules[i][2], "Level", unlockLv) local heroSkill = {} local skillId = skilllogicconfig.Id -- 部件add 只有全部解锁会有此功能 下面undo if heroData then local skillIdStr = tostring(skillId) local slot = tonumber(string.sub(skillIdStr, -2, -2)) - + local partsData = heroData.partsData local partsAddLv = 0 if partsData[slot] then @@ -4160,10 +4258,11 @@ function this.GetPassiveSkillIdsByHeroRuleslock(_rules, _star, _break, _heroData heroSkill.skillId = skillId heroSkill.skillConfig = passiveSkillConfig[skillId] - heroSkill.lock=false + heroSkill.lock = false table.insert(RetList, heroSkill) else - local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.PassiveSkillLogicConfig, "Group", _rules[i][2], "Level", 1) + local skilllogicconfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.PassiveSkillLogicConfig, + "Group", _rules[i][2], "Level", 1) local heroSkill = {} heroSkill.skillId = skilllogicconfig.Id @@ -4180,11 +4279,12 @@ end --增加魂印装备的英雄did function this.AddSoulPrintUpHeroDynamicId(heroDid, soulPrintSid, soulPrintPos) if heroDatas[heroDid] then - local singleSoulPrint = {equipId = soulPrintSid, position = soulPrintPos} + local singleSoulPrint = { equipId = soulPrintSid, position = soulPrintPos } table.insert(heroDatas[heroDid].soulPrintList, singleSoulPrint) SoulPrintManager.AddSoulPrintUpHeroDynamicId(soulPrintSid, heroDid) end end + --删除魂印装备的英雄did function this.DelSoulPrintUpHeroDynamicId(heroDid, soulPrintSid) if heroDatas[heroDid] then @@ -4196,12 +4296,13 @@ function this.DelSoulPrintUpHeroDynamicId(heroDid, soulPrintSid) end end end + ------------新魂印结束 --天赋技能(被动技能) -function this.GetAllPassiveSkillIds(heroConfig, breakId, upStarId,star,curHeroData) +function this.GetAllPassiveSkillIds(heroConfig, breakId, upStarId, star, curHeroData) --> 暂屏,新修改 - if false then + if false then return {}, 0, 0, {} end --获取星级 @@ -4210,48 +4311,53 @@ function this.GetAllPassiveSkillIds(heroConfig, breakId, upStarId,star,curHeroDa --获取被动技能组id local allPassiveSkillIds = {} if star then - local GetopenPassiveSkillRules = this.GetPassiveSkillIdsByHeroRuleslock(heroConfig.OpenPassiveSkillRules,star,breakId,curHeroData) - for i = 1, #GetopenPassiveSkillRules do - if GetopenPassiveSkillRules[i] and not GetopenPassiveSkillRules[i].lock then + local GetopenPassiveSkillRules = this.GetPassiveSkillIdsByHeroRuleslock(heroConfig.OpenPassiveSkillRules, star, + breakId, curHeroData) + for i = 1, #GetopenPassiveSkillRules do + if GetopenPassiveSkillRules[i] and not GetopenPassiveSkillRules[i].lock then PassiveskillId[i] = GetopenPassiveSkillRules[i].skillConfig.Id - table.insert(allPassiveSkillIds,PassiveskillId[i]) + table.insert(allPassiveSkillIds, PassiveskillId[i]) end end end - + local allPassiveSkillIdcompound = {} local allOpenPassiveSkillIdcompound = {} local allUpStarOpenData = {} --只用于界面升星开放技能提示显示用 local compoundNum = 0 local compoundOPenNum = 0 - if heroConfig.OpenPassiveSkillRules then + if heroConfig.OpenPassiveSkillRules then for i = 1, #heroConfig.OpenPassiveSkillRules do if heroConfig.OpenPassiveSkillRules[i][1] == 1 then --突破 - --for j=1,#PassiveskillId do + --for j=1,#PassiveskillId do if --[[breakId >= heroConfig.OpenPassiveSkillRules[i][2]] false then -- local openPassiveSkillRules = allPassiveSkillIds,heroConfig.OpenPassiveSkillRules - table.insert(allPassiveSkillIds, --[[heroConfig.OpenPassiveSkillRules[i][3]]PassiveskillId[j]) - if allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] then allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = + table.insert(allPassiveSkillIds, --[[heroConfig.OpenPassiveSkillRules[i][3]] PassiveskillId[j]) + if allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] then + allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] + 1 else allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = 1 end end else --升星 - allUpStarOpenData[heroRankUpConfig[heroConfig.OpenPassiveSkillRules[i][1]]] = heroConfig.OpenPassiveSkillRules[i] - --for j=1,#PassiveskillId do + allUpStarOpenData[heroRankUpConfig[heroConfig.OpenPassiveSkillRules[i][1]]] = heroConfig + .OpenPassiveSkillRules[i] + --for j=1,#PassiveskillId do if --[[upStarId >= heroConfig.OpenPassiveSkillRules[i][1]] false then - table.insert(allPassiveSkillIds, --[[heroConfig.OpenPassiveSkillRules[i][3]]PassiveskillId[1]) + table.insert(allPassiveSkillIds, --[[heroConfig.OpenPassiveSkillRules[i][3]] PassiveskillId[1]) if allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] then - allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] + 1 + allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = + allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] + 1 else allOpenPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = 1 end end end if allPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] then - allPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = allPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] + 1 + allPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = allPassiveSkillIdcompound + [heroConfig.OpenPassiveSkillRules[i][2]] + 1 else allPassiveSkillIdcompound[heroConfig.OpenPassiveSkillRules[i][2]] = 1 end @@ -4301,12 +4407,12 @@ function this.GetHeroAllPassiveSkillIds(curHeroData) if curTalisman and curTalisman[2] then local talismanConFig = ConfigManager.GetConfigDataByDoubleKey( - ConfigName.EquipTalismana, - "TalismanaId", - curTalisman[2], - "Level", - curHeroData.talismanList - ) + ConfigName.EquipTalismana, + "TalismanaId", + curTalisman[2], + "Level", + curHeroData.talismanList + ) if talismanConFig then --当前法宝全部天赋数据(天赋可能为空) local dowerAllData = @@ -4341,6 +4447,7 @@ function this.GetHeroAllPassiveSkillIds(curHeroData) end return allPassiveSkillIds end + --获取当前类型英雄是否存在 function this.GetCurHeroIsHaveBySid(heroSId) for i, v in pairs(heroDatas) do @@ -4350,15 +4457,17 @@ function this.GetCurHeroIsHaveBySid(heroSId) end return false end + --改变英雄礼物 function this.ChangeHeroGift(_dyn, list) if heroDatas[_dyn] then heroDatas[_dyn].giftIds = list --for k, v in pairs(heroDatas[_dyn].potential) do - --v.giftLv = GiftManager.GetHeroPotencyLvById(_dyn) + --v.giftLv = GiftManager.GetHeroPotencyLvById(_dyn) --end end end + -- 角色定位相关 -- 判断该角色是否开启定位 sid 英雄静态ID function this.IsHeroPosOpen(did) @@ -4374,18 +4483,18 @@ local heroRankupConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig) --编队所有英雄判断 function this.GetFormationHeroRedPoint() local teamHero = FormationManager.GetWuJinFormationHeroIds(FormationTypeDef.FORMATION_NORMAL) - local allHero= HeroManager.GetAllHeroDatas(0) + local allHero = HeroManager.GetAllHeroDatas(0) for i, v in pairs(teamHero) do local curHeroData = HeroManager.GetSingleHeroData(i) local abilityRedPointState = this.GetCurHeroAbilityIsShowRedPoint(curHeroData) if -- dynamicId - this.GetCurHeroUpLvOrUpStarSData(curHeroData) or - this.LvUpBtnRedPoint(curHeroData) or + this.GetCurHeroUpLvOrUpStarSData(curHeroData) or + this.LvUpBtnRedPoint(curHeroData) or this.IsShowUpStarRedPoint(curHeroData) or #this.GetHeroIsUpEquip(curHeroData.dynamicId) > 0 or this.GetIsShowSoulPrintRedPoint(curHeroData) or - this.GetIsShowTalismanRedPoint(curHeroData) + this.GetIsShowTalismanRedPoint(curHeroData) or abilityRedPointState["ability1"] or abilityRedPointState["ability2"] then return true @@ -4403,24 +4512,24 @@ function this.GetAllHeroRedPoint() local curHeroData = HeroManager.GetSingleHeroData(v.dynamicId) local abilityRedPointState = this.GetCurHeroAbilityIsShowRedPoint(curHeroData) --获得戒指是否有要显示红点的状态 - if (this.GetCurHeroUpLvOrUpStarSData(curHeroData) or - this.LvUpBtnRedPoint(curHeroData) or - this.IsShowUpStarRedPoint(curHeroData) or - #this.GetHeroIsUpEquip(curHeroData.dynamicId) > 0 or - this.GetIsShowSoulPrintRedPoint(curHeroData) or - this.GetIsShowTalismanRedPoint(curHeroData) or abilityRedPointState["ability1"] or abilityRedPointState["ability2"]) and teamHeros[v.dynamicId] - -- or (myBetterRingsState["Rings1"] or myBetterRingsState["Rings2"]) - then - return true + if (this.GetCurHeroUpLvOrUpStarSData(curHeroData) or + this.LvUpBtnRedPoint(curHeroData) or + this.IsShowUpStarRedPoint(curHeroData) or + #this.GetHeroIsUpEquip(curHeroData.dynamicId) > 0 or + this.GetIsShowSoulPrintRedPoint(curHeroData) or + this.GetIsShowTalismanRedPoint(curHeroData) or abilityRedPointState["ability1"] or abilityRedPointState["ability2"]) and teamHeros[v.dynamicId] + -- or (myBetterRingsState["Rings1"] or myBetterRingsState["Rings2"]) + then + return true end end return false end - ----玩家能力只要有一个可以学习和升级就返回true function this.GetCurHeroAbilityIsShowRedPointState() - return abilityCanShowRedPointState["ability1"] or abilityCanShowRedPointState["ability2"] or abilityCanShowRedPointState["ability3"] + return abilityCanShowRedPointState["ability1"] or abilityCanShowRedPointState["ability2"] or + abilityCanShowRedPointState["ability3"] end --玩家能力可学习可升级给两个技能的true和false @@ -4439,13 +4548,13 @@ function this.GetCurHeroAbilityIsShowRedPoint(curHeroData) for i = 1, 3 do --技能如果可以升级需要红点 --获得当前技能的当前等级,id分别是1和2 - local warWaySlotId = curHeroData[string.format("warWaySlot%dId",i)] + local warWaySlotId = curHeroData[string.format("warWaySlot%dId", i)] local warWayConfig = WarWaySkillConfig[warWaySlotId] if warWayConfig ~= nil then if warWayConfig.Level >= 4 then - abilityCanShowRedPointState["ability"..tostring(i)] = false + abilityCanShowRedPointState["ability" .. tostring(i)] = false else - local nextId = tonumber(tostring(warWayConfig.WarWayGroup)..tostring(warWayConfig.Level + 1)) + local nextId = tonumber(tostring(warWayConfig.WarWayGroup) .. tostring(warWayConfig.Level + 1)) local warWayConfigNext = WarWaySkillConfig[nextId] --第1个能力升级所需要的的道具id和道具数量 @@ -4455,24 +4564,24 @@ function this.GetCurHeroAbilityIsShowRedPoint(curHeroData) --第2个能力升级所需要的的道具id和道具数量 local itemid2 = warWayConfigNext.UpgradeCost[2][1] local itemnum2 = warWayConfigNext.UpgradeCost[2][2] - + --第1个能力升级所需要的第1个道具数量 local ownNum1 = BagManager.GetItemCountById(itemid1) --第2个能力升级所需要的第1个道具数量 local ownNum2 = BagManager.GetItemCountById(itemid2) - + --判断英雄星级是否达到条件 local TankStar1 = curHeroData.star local TankStar2 = warWayConfigNext.TankStarLimit if ownNum1 > itemnum1 and ownNum2 > itemnum2 and TankStar1 >= TankStar2 then - abilityCanShowRedPointState["ability"..tostring(i)] = true + abilityCanShowRedPointState["ability" .. tostring(i)] = true else - abilityCanShowRedPointState["ability"..tostring(i)] = false + abilityCanShowRedPointState["ability" .. tostring(i)] = false end end else - abilityCanShowRedPointState["ability"..tostring(i)] = false + abilityCanShowRedPointState["ability" .. tostring(i)] = false end -- local isOpen = false @@ -4485,13 +4594,13 @@ function this.GetCurHeroAbilityIsShowRedPoint(curHeroData) if isOpen then -- isOpen local isOn = false local warWaySlotId = curHeroData[string.format("warWaySlot%dId", i)] - + if warWaySlotId and warWaySlotId ~= 0 then isOn = true end if not isOn then --解锁了能力但是没有学习能力,加号和红点都显示 - abilityCanShowRedPointState["ability"..tostring(i)] = true + abilityCanShowRedPointState["ability" .. tostring(i)] = true end end end @@ -4545,7 +4654,7 @@ function this.GetRingsIsShowRedPoint(curHeroData) if not rings1IsUnlock and not rings2IsUnlock then --Log("戒指没解锁") - return false,betterRingsState + return false, betterRingsState end --初始化获得背包所有的戒指,索引从5开始,因为装备是1234,方便区别 @@ -4553,7 +4662,7 @@ function this.GetRingsIsShowRedPoint(curHeroData) for i = 1, #curHeroData.planList do local sData = curHeroData.planList[i] local bData = CombatPlanManager.GetPlanData(sData.planId) - curRingsData[sData.position+4] = {sData = sData, bData = bData} + curRingsData[sData.position + 4] = { sData = sData, bData = bData } end --获取所有的没装备的戒指 @@ -4576,52 +4685,52 @@ function this.GetRingsIsShowRedPoint(curHeroData) for i = 1, #allRingsData do local oneRingsData = bestRings - --如果两个戒指有一个解锁了就显示红点 - if curRingsData[5] == nil or curRingsData[6] == nil then + --如果两个戒指有一个解锁了就显示红点 + if curRingsData[5] == nil or curRingsData[6] == nil then + hasBetterRings = true + else + --如果当前装备戒指的评分不大于未装备的最高评分的戒指那么久显示红点 + if + oneRingsData > CombatPlanManager.CalPlanPowerByProperty(curRingsData[5].bData.property) or + oneRingsData > CombatPlanManager.CalPlanPowerByProperty(curRingsData[6].bData.property) + then hasBetterRings = true - else - --如果当前装备戒指的评分不大于未装备的最高评分的戒指那么久显示红点 - if - oneRingsData > CombatPlanManager.CalPlanPowerByProperty(curRingsData[5].bData.property) or - oneRingsData > CombatPlanManager.CalPlanPowerByProperty(curRingsData[6].bData.property) - then - hasBetterRings = true - end end + end - if rings1IsUnlock then - --比较一号戒指是不是有更好的替代品 - if curRingsData[5] == nil then - betterRingsState["Rings1"] = true - --Log("一号戒指解锁了但是没装备") - else - --注释戒指一号评分判断 - -- if oneRingsData > CombatPlanManager.CalPlanPowerByProperty(curRingsData[5].bData.property) then - -- -- betterRingsState["Rings1"] = true - -- --Log("一号戒指有更好的"..oneRingsData) - -- else - -- betterRingsState["Rings1"] = false - -- --Log("一号戒指就是最好的".. CombatPlanManager.CalPlanPowerByProperty(curRingsData[5].bData.property)) - -- end - end + if rings1IsUnlock then + --比较一号戒指是不是有更好的替代品 + if curRingsData[5] == nil then + betterRingsState["Rings1"] = true + --Log("一号戒指解锁了但是没装备") + else + --注释戒指一号评分判断 + -- if oneRingsData > CombatPlanManager.CalPlanPowerByProperty(curRingsData[5].bData.property) then + -- -- betterRingsState["Rings1"] = true + -- --Log("一号戒指有更好的"..oneRingsData) + -- else + -- betterRingsState["Rings1"] = false + -- --Log("一号戒指就是最好的".. CombatPlanManager.CalPlanPowerByProperty(curRingsData[5].bData.property)) + -- end end - - if rings2IsUnlock then - --比较二号戒指是不是有更好的替代品 - if curRingsData[6] == nil then - betterRingsState["Rings2"] = true - --Log("二号戒指解锁了但是没装备") - else - --注释戒指二号评分判断 - -- if oneRingsData > CombatPlanManager.CalPlanPowerByProperty(curRingsData[6].bData.property) then - -- betterRingsState["Rings2"] = true - -- --Log("二号戒指有更好的"..oneRingsData) - -- else - -- betterRingsState["Rings2"] = false - -- --Log("二号戒指就是最好的".. CombatPlanManager.CalPlanPowerByProperty(curRingsData[6].bData.property)) - -- end - end + end + + if rings2IsUnlock then + --比较二号戒指是不是有更好的替代品 + if curRingsData[6] == nil then + betterRingsState["Rings2"] = true + --Log("二号戒指解锁了但是没装备") + else + --注释戒指二号评分判断 + -- if oneRingsData > CombatPlanManager.CalPlanPowerByProperty(curRingsData[6].bData.property) then + -- betterRingsState["Rings2"] = true + -- --Log("二号戒指有更好的"..oneRingsData) + -- else + -- betterRingsState["Rings2"] = false + -- --Log("二号戒指就是最好的".. CombatPlanManager.CalPlanPowerByProperty(curRingsData[6].bData.property)) + -- end end + end --背包全部装备的评价 --Log('全部未装备戒指的评价:' .. CombatPlanManager.CalPlanPowerByProperty(allRingsData[i].property)) end @@ -4639,17 +4748,18 @@ function this.GetRingsIsShowRedPoint(curHeroData) -- end --这里处理一定要!!!注意!!!,三个前提,1.戒指都解锁了,2.背包有至少一个戒指,3.没有装备戒指 - if rings1IsUnlock and rings2IsUnlock and (curRingsData[5]==nil or curRingsData[6]==nil) and #allRingsData>1 then + if rings1IsUnlock and rings2IsUnlock and (curRingsData[5] == nil or curRingsData[6] == nil) and #allRingsData > 1 then --Log("戒指都解锁了,背包有戒指,但是没装备任何戒指") - return true,betterRingsState + return true, betterRingsState elseif hasBetterRings then --Log("有更好的戒指") - return true,betterRingsState + return true, betterRingsState elseif rings1IsUnlock and rings2IsUnlock then --Log("戒指都解锁了,背包没有戒指") - return true,betterRingsState + return true, betterRingsState end end + --单个英雄所有红点判断 function this.GetCurHeroIsShowRedPoint(curHeroData) if curHeroData.heroConfig.Material == 1 then @@ -4663,17 +4773,19 @@ function this.GetCurHeroIsShowRedPoint(curHeroData) this.IsShowUpStarRedPoint(curHeroData) or #this.GetHeroIsUpEquip(curHeroData.dynamicId) > 0 or this.GetIsShowSoulPrintRedPoint(curHeroData) or - this.GetIsShowTalismanRedPoint(curHeroData) or - this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability1"] or this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability2"] or + this.GetIsShowTalismanRedPoint(curHeroData) or + this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability1"] or + this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability2"] or (betterRingsState1["Rings1"] or betterRingsState1["Rings2"]) end - return this.GetCurHeroUpLvOrUpStarSData(curHeroData) or + return this.GetCurHeroUpLvOrUpStarSData(curHeroData) or this.LvUpBtnRedPoint(curHeroData) or this.IsShowUpStarRedPoint(curHeroData) or #this.GetHeroIsUpEquip(curHeroData.dynamicId) > 0 or this.GetIsShowSoulPrintRedPoint(curHeroData) or - this.GetIsShowTalismanRedPoint(curHeroData) or - this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability1"] or this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability2"] + this.GetIsShowTalismanRedPoint(curHeroData) or + this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability1"] or + this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability2"] end --单个英雄所有红点判断,去掉装备红点判断 @@ -4688,19 +4800,20 @@ function this.GetIsHeroAlternativeRedPoint(curHeroData) this.LvUpBtnRedPoint(curHeroData) or this.IsShowUpStarRedPoint(curHeroData) or this.GetIsShowSoulPrintRedPoint(curHeroData) or - this.GetIsShowTalismanRedPoint(curHeroData) or - this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability1"] or this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability2"] or + this.GetIsShowTalismanRedPoint(curHeroData) or + this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability1"] or + this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability2"] or (betterRingsState1["Rings1"] or betterRingsState1["Rings2"]) end - return this.GetCurHeroUpLvOrUpStarSData(curHeroData) or + return this.GetCurHeroUpLvOrUpStarSData(curHeroData) or this.LvUpBtnRedPoint(curHeroData) or this.IsShowUpStarRedPoint(curHeroData) or this.GetIsShowSoulPrintRedPoint(curHeroData) or - this.GetIsShowTalismanRedPoint(curHeroData) or - this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability1"] or this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability2"] + this.GetIsShowTalismanRedPoint(curHeroData) or + this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability1"] or + this.GetCurHeroAbilityIsShowRedPoint(curHeroData)["ability2"] end - --获取当前英雄的下一突破 和 升星 静态数据 function this.GetCurHeroUpLvOrUpStarSData(curHeroData) isHeroUpTuPo = false @@ -4708,12 +4821,12 @@ function this.GetCurHeroUpLvOrUpStarSData(curHeroData) upTuPoRankUpConfig = {} upStarRankUpConfig = {} - if curHeroData == nil then -- 线上红点问题 +空判断 + if curHeroData == nil then -- 线上红点问题 +空判断 return end for i, v in ConfigPairs(heroRankUpConfig) do - if v.Star == curHeroData.heroConfig.Star then --初始星级相等 - if v.Show == 1 then -- 1 突破 + if v.Star == curHeroData.heroConfig.Star then --初始星级相等 + if v.Show == 1 then -- 1 突破 if v.Id ~= curHeroData.breakId and curHeroData.lv == v.LimitLevel then --and curHeroData.star == v.LimitStar isHeroUpTuPo = true upTuPoRankUpConfig = v @@ -4728,6 +4841,7 @@ function this.GetCurHeroUpLvOrUpStarSData(curHeroData) end end end + --单个英雄升级红点 function this.LvUpBtnRedPoint(curHeroData) HeroManager.GetCurHeroUpLvOrUpStarSData(curHeroData) @@ -4752,8 +4866,8 @@ function this.LvUpBtnRedPoint(curHeroData) end --如果此时需要进阶 每次都要跳转 if isHeroUpStar and upStarRankUpConfig and curTuPoRankUpConfig and curTuPoRankUpConfig.JudgeClass == 1 and - curHeroData.lv >= curTuPoRankUpConfig.OpenLevel then --当前突破全部完成 - if curStarRankUpConfig then --进阶过处理 + curHeroData.lv >= curTuPoRankUpConfig.OpenLevel then --当前突破全部完成 + if curStarRankUpConfig then --进阶过处理 if curHeroData.lv == curStarRankUpConfig.OpenLevel then return false else @@ -4775,17 +4889,18 @@ function this.LvUpBtnRedPoint(curHeroData) end return false end + --单个英雄升星红点 function this.IsShowUpStarRedPoint(curHeroData) HeroManager.GetCurHeroUpLvOrUpStarSData(curHeroData) if curHeroData.lv >= HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then return false - --培养已满 + --培养已满 end if upStarRankUpConfig and upStarRankUpConfig.LimitLevel then if curHeroData.lv < upStarRankUpConfig.LimitLevel then return false - --等级不够 + --等级不够 end else --不能升星 @@ -4798,7 +4913,7 @@ function this.IsShowUpStarRedPoint(curHeroData) if ConsumeMaterial[i][2] and ConsumeMaterial[i][2] > 0 then if BagManager.GetItemCountById(ConsumeMaterial[i][1]) < ConsumeMaterial[i][2] then return false - --材料不足 + --材料不足 end end end @@ -4818,10 +4933,10 @@ function this.IsShowUpStarRedPoint(curHeroData) for j = 1, #upStarHeroListData.heroList do if upStarHeroListData.heroList[j].lockState == 0 and - upStarHeroListData.heroList[j].isFormation == "" and - #curSelectHeroList < curSelectUpStarData.upStarData[4] and - not upStarConsumeMaterial[upStarHeroListData.heroList[j].dynamicId] - then + upStarHeroListData.heroList[j].isFormation == "" and + #curSelectHeroList < curSelectUpStarData.upStarData[4] and + not upStarConsumeMaterial[upStarHeroListData.heroList[j].dynamicId] + then table.insert(curSelectHeroList, upStarHeroListData.heroList[j]) end end @@ -4843,6 +4958,7 @@ function this.IsShowUpStarRedPoint(curHeroData) end return true end + --单个英雄装备红点 --检测单个英雄是否有可穿的装备 function this.GetHeroIsUpEquip(heroDid) if heroDatas[heroDid] then @@ -4866,7 +4982,8 @@ function this.GetHeroIsUpEquip(heroDid) if not curEquipConFigData then else lackEquips[curEquipConFigData.equipConfig.Position].id = heroData.equipIdList[i] - lackEquips[curEquipConFigData.equipConfig.Position].warPower = EquipManager.CalculateWarForce(heroData.equipIdList[i]) + lackEquips[curEquipConFigData.equipConfig.Position].warPower = EquipManager.CalculateWarForce( + heroData.equipIdList[i]) end end end @@ -4910,7 +5027,7 @@ function this.GetHeroIsUpEquip(heroDid) if isAdd then if i == 7 or i == 8 then local limit = string.split(G_SpecialConfig[157].Value, "#") - if heroData.star >= tonumber(limit[i-6]) then + if heroData.star >= tonumber(limit[i - 6]) then table.insert(allUpEquipDidTabs, lackEquips[i].id) end else @@ -4926,6 +5043,7 @@ function this.GetHeroIsUpEquip(heroDid) end return {} end + --单个英雄魂印红点 --获取魂印环形布局数据 didMaxLen最大槽位数量 didLen可装备槽位数量 didLv最大动态等级 maxLv配置最大等级 function this.GetSoulPrintLoopUIMaxData() @@ -4954,6 +5072,7 @@ function this.GetSoulPrintLoopUIMaxData() return didMaxLen, didLen, didLv, maxLv end + function this.GetIsShowSoulPrintRedPoint(curHeroData) local soulPrintIsOpen = SoulPrintManager.GetSoulPrintIsOpen(curHeroData) if not soulPrintIsOpen then @@ -4973,7 +5092,7 @@ function this.GetIsShowSoulPrintRedPoint(curHeroData) for i = 1, #allBagSoulPrintData do if not allUpSoulPrint[allBagSoulPrintData[i].id] and equipConfig[allBagSoulPrintData[i].id].Range[1] == 0 then return true - --有空位可以穿戴 + --有空位可以穿戴 end local isHaveCurHeroid = false for j = 1, #equipConfig[allBagSoulPrintData[i].id].Range do @@ -4984,17 +5103,18 @@ function this.GetIsShowSoulPrintRedPoint(curHeroData) end if not allUpSoulPrint[allBagSoulPrintData[i].id] and isHaveCurHeroid then return true - --有空位可以穿戴 + --有空位可以穿戴 end end return false end + --单个英雄法宝红点 function this.GetIsShowTalismanRedPoint(curHeroData) local isOpen = TalismanManager.GetCurHeroIsOpenTalisman(curHeroData) if not isOpen then return false - --功能未开启 + --功能未开启 end local equipTalismana = ConfigManager.GetConfigData(ConfigName.HeroConfig, curHeroData.id).EquipTalismana --当前法宝数据 data[1]星级 data[2]法宝ID @@ -5017,12 +5137,12 @@ function this.GetIsShowTalismanRedPoint(curHeroData) end local curTalismanConFig = ConfigManager.GetConfigDataByDoubleKey( - ConfigName.EquipTalismana, - "Level", - curLv, - "TalismanaId", - equipTalismana[2] - ) + ConfigName.EquipTalismana, + "Level", + curLv, + "TalismanaId", + equipTalismana[2] + ) --local nextTalismanConFig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.EquipTalismana, "TalismanaId", equipTalismana[2], "Level", nextLv) --需要判断材料够不够 for i = 1, #curTalismanConFig.RankupBasicMaterial do @@ -5032,7 +5152,7 @@ function this.GetIsShowTalismanRedPoint(curHeroData) --已有物品数量 if haveNum < needNum then return false - --材料不足 + --材料不足 end end return true @@ -5050,19 +5170,19 @@ function this.ByCompoundHeroGetAllHeros() local upSortHeroList = {} local downSoryHeroList = {} for i, v in pairs(heroDatas) do - if v.star == 4 or v.star == 5 or v.star == 3 then--四星 五星 才能加 3星 是狗粮 - if LengthOfTable(v.formationList) ~= 0 then + if v.star == 4 or v.star == 5 or v.star == 3 then --四星 五星 才能加 3星 是狗粮 + if LengthOfTable(v.formationList) ~= 0 then local text = "" for index, value in pairs(v.formationList) do text = HeroManager.GetHeroFormationStr(value) end v.isFormation = text end - table.insert(upSortHeroList,v) - table.insert(downSoryHeroList,v) + table.insert(upSortHeroList, v) + table.insert(downSoryHeroList, v) end end - table.sort(downSoryHeroList, function(a,b) + table.sort(downSoryHeroList, function(a, b) if a.star == b.star then if a.lv == b.lv then return a.heroConfig.Id < b.heroConfig.Id @@ -5073,7 +5193,7 @@ function this.ByCompoundHeroGetAllHeros() return a.star > b.star end end) - table.sort(upSortHeroList, function(a,b) + table.sort(upSortHeroList, function(a, b) if a.star == b.star then if a.lv == b.lv then return a.heroConfig.Id > b.heroConfig.Id @@ -5084,25 +5204,26 @@ function this.ByCompoundHeroGetAllHeros() return a.star < b.star end end) - return upSortHeroList,downSoryHeroList + return upSortHeroList, downSoryHeroList end + --神将置换 function this.ByReplaceHeroGetAllHeros() local sortHeroList = {} for i, v in pairs(heroDatas) do - if v.star == 4 or v.star == 5 then--四星 五星 - v.isFormation = "" + if v.star == 4 or v.star == 5 then --四星 五星 + v.isFormation = "" --筛选 local teamIdList = HeroManager.GetAllFormationByHeroId(v.dynamicId) local isOK = true if teamIdList ~= nil and #teamIdList > 0 then - for k, v in pairs(teamIdList)do + for k, v in pairs(teamIdList) do if v == FormationTypeDef.DEFENSE_TRAINING and DefenseTrainingManager.teamLock == 1 then isOK = false --table.removebyvalue(sortHeroList, n) break end - --防守训练 + --防守训练 -- if v == FormationTypeDef.FORMATION_DREAMLAND or v == FormationTypeDef.FORMATION_AoLiaoer then -- isOK = true -- --table.removebyvalue(sortHeroList, n) @@ -5111,12 +5232,12 @@ function this.ByReplaceHeroGetAllHeros() end end -- if isOK == true then - table.insert(sortHeroList,v) + table.insert(sortHeroList, v) -- end end end - --标记编队上的英雄 - if sortHeroList and LengthOfTable(sortHeroList) > 0 then + --标记编队上的英雄 + if sortHeroList and LengthOfTable(sortHeroList) > 0 then for i, v in pairs(sortHeroList) do local isFormations = {} for n, w in pairs(FormationManager.formationList) do @@ -5132,7 +5253,7 @@ function this.ByReplaceHeroGetAllHeros() table.insert(isFormations, curFormationId) else isFormationStr, curFormationId = this.GetHeroFormationStr2(n) - isFormationStr = "、" ..isFormationStr + isFormationStr = "、" .. isFormationStr table.insert(isFormations, curFormationId) end sortHeroList[i].isFormation = sortHeroList[i].isFormation .. isFormationStr @@ -5166,7 +5287,7 @@ function this.ByReplaceHeroGetAllHeros() -- end -- end -- end - table.sort(sortHeroList, function(a,b) + table.sort(sortHeroList, function(a, b) if a.star == b.star then if a.lv == b.lv then return a.heroConfig.Id > b.heroConfig.Id @@ -5179,8 +5300,9 @@ function this.ByReplaceHeroGetAllHeros() end) return sortHeroList end + --修改神将changeId (1是增加/修改 0是恢复默认值0) -function this.ResetHeroChangeId(dynamicloadId,changeId) +function this.ResetHeroChangeId(dynamicloadId, changeId) if heroDatas[dynamicloadId] then if changeId then heroDatas[dynamicloadId].changeId = changeId @@ -5243,7 +5365,8 @@ function this.CalculateMonsterAllProValList(enemyIdList, _breakId, _upStarId) --减乘 --英雄被动技能属性加成 - local heroSkillSingleHeroProVal, heroSkillLvProVal, heroSkillAllHeroProVal, heroSkillSpecialProVal = {}, {}, {}, {} + local heroSkillSingleHeroProVal, heroSkillLvProVal, heroSkillAllHeroProVal, heroSkillSpecialProVal = {}, {}, {}, + {} heroSkillSingleHeroProVal, heroSkillLvProVal, heroSkillAllHeroProVal, heroSkillSpecialProVal = CalculateMonsterPassiveSkillProAddVal(heroData, _breakId, _upStarId) @@ -5271,17 +5394,19 @@ function this.CalculateMonsterAllProValList(enemyIdList, _breakId, _upStarId) this.DoubleTableCompound(allAddProVal, allHeroProVal) allAddProVal[HeroProType.Attack] = - this.CalculateProVal(heroData.Attack, curLvNum, _breakId, _upStarId, HeroProType.Attack,heroData,curHeroData.star) + + this.CalculateProVal(heroData.Attack, curLvNum, _breakId, _upStarId, HeroProType.Attack, heroData, + curHeroData.star) + allAddProVal[HeroProType.Attack] allAddProVal[HeroProType.Hp] = - this.CalculateProVal(heroData.Hp, curLvNum, _breakId, _upStarId, HeroProType.Hp,heroData,curHeroData.star) + + this.CalculateProVal(heroData.Hp, curLvNum, _breakId, _upStarId, HeroProType.Hp, heroData, curHeroData.star) + allAddProVal[HeroProType.Hp] allAddProVal[HeroProType.PhysicalDefence] = - this.CalculateProVal(heroData.PhysicalDefence, curLvNum, _breakId, _upStarId, HeroProType.PhysicalDefence,heroData,curHeroData.star) + + this.CalculateProVal(heroData.PhysicalDefence, curLvNum, _breakId, _upStarId, HeroProType.PhysicalDefence, + heroData, curHeroData.star) + allAddProVal[HeroProType.PhysicalDefence] -- allAddProVal[HeroProType.MagicDefence] = - -- this.CalculateProVal(heroData.MagicDefence, curLvNum, _breakId, _upStarId, HeroProType.MagicDefence,heroData) + - -- allAddProVal[HeroProType.MagicDefence] + -- this.CalculateProVal(heroData.MagicDefence, curLvNum, _breakId, _upStarId, HeroProType.MagicDefence,heroData) + + -- allAddProVal[HeroProType.MagicDefence] --最后计算战斗力 allAddProVal[HeroProType.WarPower] = CalculateWarForce(allAddProVal) @@ -5307,11 +5432,11 @@ function HeroManager.UpdateWarWayData(tankDId, slot, warWayId, isOn) end HeroDownDataType = { - EQUIP = 1, - WARWAY = 2, + EQUIP = 1, + WARWAY = 2, } --清除client本地英雄身上 类型数据(all) -function HeroManager.UpdateHeroDownData(type, dynamicId,spe) +function HeroManager.UpdateHeroDownData(type, dynamicId, spe) if heroDatas[dynamicId] then if HeroDownDataType.EQUIP == type then local equips = heroDatas[dynamicId].equipIdList @@ -5348,10 +5473,10 @@ function HeroManager.SortHeroData(_heroDatas, sortType) table.sort(_heroDatas, function(a, b) if sortType == SortTypeConst.Lv then if a.lv == b.lv then - if a.heroConfig.Quality == b.heroConfig.Quality then--Natural + if a.heroConfig.Quality == b.heroConfig.Quality then --Natural if a.star == b.star then if a.warPower == b.warPower then - if a.heroConfig.Natural == b.heroConfig.Natural then--Natural + if a.heroConfig.Natural == b.heroConfig.Natural then --Natural return a.heroConfig.Id < b.heroConfig.Id else return a.heroConfig.Natural > b.heroConfig.Natural @@ -5369,11 +5494,11 @@ function HeroManager.SortHeroData(_heroDatas, sortType) return a.lv > b.lv end elseif sortType == SortTypeConst.Natural then - if a.heroConfig.Quality == b.heroConfig.Quality then--Natural + if a.heroConfig.Quality == b.heroConfig.Quality then --Natural if a.star == b.star then if a.lv == b.lv then if a.warPower == b.warPower then - if a.heroConfig.Natural == b.heroConfig.Natural then--Natural + if a.heroConfig.Natural == b.heroConfig.Natural then --Natural return a.heroConfig.Id < b.heroConfig.Id else return a.heroConfig.Natural > b.heroConfig.Natural @@ -5421,12 +5546,13 @@ function HeroManager.SetHeroPartsData(partsData, unlockData, heroData) if unlockData and #unlockData > 0 then for i = 1, #unlockData do --> isUnLock -1未解锁,0已解锁,>0已升级 actualLv 实际应用等级 - partsData[unlockData[i].position] = {position = unlockData[i].position, isUnLock = unlockData[i].isUnLock, actualLv = 0} + partsData[unlockData[i].position] = { position = unlockData[i].position, isUnLock = unlockData[i].isUnLock, actualLv = 0 } end this.UpdateHeroPartsData(heroData) end end + --更新部件数据 主装备变动更新 function HeroManager.UpdateHeroPartsData(heroData) local partsData = heroData.partsData @@ -5439,25 +5565,30 @@ function HeroManager.UpdateHeroPartsData(heroData) if partsData[equipConfig.Position] then if partsData[equipConfig.Position].isUnLock > 0 then if equipConfig.IfAdjust == 1 then - partsData[equipConfig.Position].actualLv = math.min(partsData[equipConfig.Position].isUnLock, equipConfig.Adjustlimit) + partsData[equipConfig.Position].actualLv = math.min(partsData[equipConfig.Position].isUnLock, + equipConfig.Adjustlimit) end end end end end + --获取技能ids 按顺序 (注:目前只有主动有槽位 被动无槽位 如果按技能id区分倒数第二位 或直接顺序走) 去掉普攻 function HeroManager.GetHeroSkillSortList(heroData) - local skillAList = HeroManager.GetSkillIdsByHeroRulesRole(heroData.heroConfig.OpenSkillRules, heroData.star, heroData.breakId, heroData) - local skillBList = HeroManager.GetPassiveSkillIdsByHeroRuleslock(heroData.heroConfig.OpenPassiveSkillRules, heroData.star, heroData.breakId, heroData) + local skillAList = HeroManager.GetSkillIdsByHeroRulesRole(heroData.heroConfig.OpenSkillRules, heroData.star, + heroData.breakId, heroData) + local skillBList = HeroManager.GetPassiveSkillIdsByHeroRuleslock(heroData.heroConfig.OpenPassiveSkillRules, + heroData.star, heroData.breakId, heroData) for key, value in pairs(skillBList) do table.insert(skillAList, value) end - table.sort(skillAList, function(a, b) + table.sort(skillAList, function(a, b) return a.skillConfig.Id < b.skillConfig.Id end) table.remove(skillAList, 1) return skillAList end + --部件解锁设值 解锁 重置 function HeroManager.PartsSetUnlockValue(heroData, position) if heroData.partsData and heroData.partsData[position] then @@ -5465,6 +5596,7 @@ function HeroManager.PartsSetUnlockValue(heroData, position) this.UpdateHeroPartsData(heroData) end end + --部件升级设值 function HeroManager.PartsSetLvUpValue(heroData, position) if heroData.partsData and heroData.partsData[position] then @@ -5472,6 +5604,7 @@ function HeroManager.PartsSetLvUpValue(heroData, position) this.UpdateHeroPartsData(heroData) end end + --部件获取表数据 by level function HeroManager.GetPartsConfigData(level) for _, configInfo in ConfigPairs(ConfigManager.GetConfig(ConfigName.AdjustConfig)) do @@ -5552,4 +5685,4 @@ function HeroManager.GetPowerCenterLinkHeros(camp) return list end -return this \ No newline at end of file +return this diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua index 9a32598f1..32a1bd218 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua @@ -78,14 +78,14 @@ function RewardEquipSingleShowPopup2:BindEvent() heroId = self.curHeroData.dynamicId local list = GiftManager.GetHeroGifts(heroId) if #list >= 12 then - PopupTipPanel.ShowTip("礼物数量已达上限!") + PopupTipPanel.ShowTip(GetLanguageStrById(16010123)) return end else heroId = "0" local list = GiftManager.GetPlayerGifts() if #list >= 12 then - PopupTipPanel.ShowTip("礼物数量已达上限!") + PopupTipPanel.ShowTip(GetLanguageStrById(16010123)) return end end diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua index b66f7eca2..634b94dbc 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua @@ -122,7 +122,7 @@ function RoleGiftPanel:BindEvent() --礼物获取 Util.AddClick(this.gainChipBtn, function() --UIManager.OpenPanel(UIName.ReconnaissancePanel) - UIManager.OpenPanel(UIName.DailyCarbonPanel,6) + UIManager.OpenPanel(UIName.DailyCarbonPanel, 6) end) Util.AddClick(this.collectImg.gameObject, function() -- local data = {} @@ -259,12 +259,15 @@ function this.RefreshWindowData() this.force.text = "" --显示上面赠送的 local list = GiftManager.GetHeroGifts(curHeroData.dynamicId) - maxNum = GiftManager.GetHeroGiftBoxNum(curHeroData.dynamicId) + curNum = GiftManager.GetHeroGiftBoxNum(curHeroData.dynamicId) --if #list>=50 then --curNum=#list+6 --maxNum=#list+6 --else - curNum = maxNum + maxNum = curNum + 1 + if maxNum > 12 then + maxNum = 12 + end --maxNum = 12 --end --this.lvTxt.text = "收集度" .. lv .. "级" @@ -467,7 +470,7 @@ function this.SingleUpItemShow(_go, data, _index) add:SetActive(false) red:SetActive(false) lockText.gameObject:SetActive(true) - lockText.text = "收集度" .. lv + 1 .. "级解锁" + lockText.text = GetLanguageStrById(16010122) else lockObj:SetActive(false) lockText.gameObject:SetActive(false) @@ -646,15 +649,15 @@ if not itemConfig[_itemData.id] then if curHeroData then heroId = curHeroData.dynamicId local list = GiftManager.GetHeroGifts(heroId) - if #list >= 12 then - PopupTipPanel.ShowTip("礼物数量已达上限!") + if #list >= curNum then + PopupTipPanel.ShowTip(GetLanguageStrById(16010123)) return end else heroId = "0" local list = GiftManager.GetPlayerGifts() if #list >= 12 then - PopupTipPanel.ShowTip("礼物数量已达上限!") + PopupTipPanel.ShowTip(GetLanguageStrById(16010123)) return end end diff --git a/Assets/ManagedResources/~Lua/Modules/TreasureStore/TreasureStorePopup.lua b/Assets/ManagedResources/~Lua/Modules/TreasureStore/TreasureStorePopup.lua index f1d04f5d6..77603542b 100644 --- a/Assets/ManagedResources/~Lua/Modules/TreasureStore/TreasureStorePopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/TreasureStore/TreasureStorePopup.lua @@ -76,6 +76,7 @@ function TreasureStorePopup:RefreshPanel() if not curActId then return end + LogError("sssssssssssssssssssssssssssssssss"..tostring(curActId)) Util.GetGameObject(this.gameObject, "Panel/Bg/Image/Text"):GetComponent("Text").text = GetLanguageStrById(GlobalActivity[curActId].ExpertDec) local data = GlobalActivity[curActId].CanBuyRechargeId for i = 1, #data do