魂印格子开启条件修改

(cherry picked from commit 0116983588)
PC-202302260912\Administrator 2023-11-30 15:11:06 +08:00 committed by wangzhenxing
parent 90b4946916
commit d78d5df5f2
2 changed files with 62 additions and 18 deletions

View File

@ -17,6 +17,7 @@ local jewelConfig = ConfigManager.GetConfig(ConfigName.JewelConfig)
local jewelRankupConfig = ConfigManager.GetConfig(ConfigName.JewelRankupConfig)
local jewelResonanceConfig = ConfigManager.GetConfig(ConfigName.JewelResonanceConfig)
local EquipStrengthen = ConfigManager.GetConfig(ConfigName.EquipStrengthen)
local EquipSignSetting = ConfigManager.GetConfig(ConfigName.EquipSignSetting)
local EquipRankUp = ConfigManager.GetConfig(ConfigName.EquipRankUp)
local heroDatas = {}
this.heroSortedDatas={}--排序后的英雄数据
@ -4024,29 +4025,41 @@ end
--单个英雄魂印红点
--获取魂印环形布局数据 didMaxLen最大槽位数量 didLen可装备槽位数量 didLv最大动态等级 maxLv配置最大等级
function this.GetSoulPrintLoopUIMaxData()
local d = string.split(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 37).Value, "#")
function this.GetSoulPrintLoopUIMaxData(_heroData)
--local d = string.split(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 37).Value, "#")
--local d =#EquipSignSetting
LogError("#EquipSignSetting==============="..#EquipSignSetting)
local _d = {}
for n = 1, #d do
local v = d[n]
if PlayerManager.level >= tonumber(v) then
table.insert(_d, v)
local maxLv = 0
for k, v in ConfigPairs(EquipSignSetting) do
if v.OpenRules then
if v.OpenRules[1]==1 then
if PlayerManager.level >= v.OpenRules[2] then
table.insert(_d, v.SlotPosition)
end
elseif v.OpenRules[1]==2 then
if _heroData.star>=v.OpenRules[2] then
table.insert(_d, v.SlotPosition)
end
end
maxLv=v.Id
end
end
--当前动态最大等级
local didLv = 0
--最大槽位数量
local didMaxLen = 0
--可装备槽位数量(与是否装备英雄无关)
local didLen = 0
if #_d < #d then --未达到最大等级 +1显示锁定
if #_d < maxLv then --未达到最大等级 +1显示锁定
didMaxLen = #_d + 1
else
didMaxLen = #_d
end
didLv = tonumber(d[didMaxLen])
didLv = EquipSignSetting[didMaxLen].SlotPosition
didLen = #_d
local maxLv = tonumber(d[#d])
return didMaxLen, didLen, didLv, maxLv
end
@ -4078,7 +4091,7 @@ function this.GetIsShowSoulPrintRedPoint(curHeroData)
if not soulPrintIsOpen then
return false
end
local didMaxLen, didLen, didLv, maxLv = this.GetSoulPrintLoopUIMaxData()
local didMaxLen, didLen, didLv, maxLv = this.GetSoulPrintLoopUIMaxData(curHeroData)
if curHeroData.soulPrintList and #curHeroData.soulPrintList >= didLen then
return false --空位置 已装满
end

View File

@ -239,8 +239,8 @@ function this.SetLoopUI()
local maxLv = 0
--LogBlue("动态最大等级 "..didLv)
loopCount,didLen,didLv,maxLv= HeroManager.GetSoulPrintLoopUIMaxData()
-- LogBlue("最大槽位数量"..loopCount.." 可装备槽位数量"..didLen.." 最大动态等级"..didLv.." 配置最大等级"..maxLv)
loopCount,didLen,didLv,maxLv= HeroManager.GetSoulPrintLoopUIMaxData(curHeroData)
LogError("最大槽位数量"..loopCount.." 可装备槽位数量"..didLen.." 最大动态等级"..didLv.." 配置最大等级"..maxLv)
--初始化
for i=1,loopCount do
@ -261,17 +261,48 @@ function this.SetLoopUI()
end
end
--最后一位锁定
if PlayerManager.level<maxLv then
this.SetLoopPre(loopList[loopCount],2,nil,didLv)
else
this.SetLoopPre(loopList[loopCount],1)
local rules=equipSignSetting[maxLv].OpenRules
if rules[1]==1 then
if PlayerManager.level<rules[2] then
this.SetLoopPre(loopList[loopCount],2,nil,didLv)
else
this.SetLoopPre(loopList[loopCount],1)
end
elseif rules[1]==2 then
if curHeroData.star<rules[2] then
this.SetLoopPre(loopList[loopCount],2,nil,didLv)
else
this.SetLoopPre(loopList[loopCount],1)
end
end
--数据赋值
for k=1,#curHeroData.soulPrintList do
local index=curHeroData.soulPrintList[k].position
this.SetLoopPre(loopList[index],3,index,curHeroData.soulPrintList[k])
end
end
function this.GetSoulLockTip()
for k, v in ConfigPairs(equipSignSetting) do
if v.OpenRules then
if v.OpenRules[1]==1 then
if PlayerManager.level < v.OpenRules[2] then
return string.format("主角%s级解锁",v.OpenRules[2])
end
elseif v.OpenRules[1]==2 then
if curHeroData.star < v.OpenRules[2] then
local str=""
if v.OpenRules[2]==14 then
str="飞升四阶"
elseif v.OpenRules[2]==15 then
str="飞升五阶"
end
return string.format("%s解锁",str)
end
end
end
end
end
--获取当前子布局坐标
function this.GetCurPosByIndex(index)
local hudu=(angle/180)*Mathf.PI
@ -296,7 +327,7 @@ function this.SetLoopPre(root,type,index,data,curIndex)
Util.GetGameObject(bg,"bg"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[0].circleBg1)
elseif type==2 then
Util.GetGameObject(bg,"bg"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[0].circleBg1)
Util.GetGameObject(lock,"Text"):GetComponent("Text").text=string.format( Language[11903],data)
Util.GetGameObject(lock,"Text"):GetComponent("Text").text=this.GetSoulLockTip()--string.format( Language[11903],data)
elseif type==3 then
--Util.GetGameObject(bg,"Frame"):GetComponent("Image").enabled=true
Util.GetGameObject(bg,"bg"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[equipConfig[data.equipId].Quality].circleBg1)
@ -440,7 +471,7 @@ function this.GetPos()
end
end
function this.ShowRedPotDataAndSort(allData)
local didMaxLen,didLen,didLv,maxLv = HeroManager.GetSoulPrintLoopUIMaxData()
local didMaxLen,didLen,didLv,maxLv = HeroManager.GetSoulPrintLoopUIMaxData(curHeroData)
if curHeroData.soulPrintList and #curHeroData.soulPrintList >= didLen then
table.sort(allData, function(a,b)
if equipConfig[a.id].Quality == equipConfig[b.id].Quality then