法相显示修改提交

dev_chengFeng
wangzhenxing 2023-02-20 16:20:17 +08:00
parent 0d44032d25
commit 91b13fb22c
3 changed files with 80 additions and 31 deletions

View File

@ -193,7 +193,12 @@ function this.GetCurrLvAndNextLvPropertyValue(_id, _lv,_data)
proList[i].nextValue = proList[i].currValue proList[i].nextValue = proList[i].currValue
end end
end end
return proList local lvList={}
for key, value in pairs(proList) do
value.proId=key
table.insert(lvList,value)
end
return lvList
end end
--获取当前星级的基础属性/精炼属性 --获取当前星级的基础属性/精炼属性
@ -235,12 +240,16 @@ function this.GetCurrStarAndNextStarPropertyValue(_id, _lv,_data)
end end
end end
end end
local starList={}
table.insert(starList,{proId=100,currValue=Para,nextValue=nextPara })
for key, value in pairs(proList) do for key, value in pairs(proList) do
value.currValue=math.floor(value.currValue * (1 + Para)) value.currValue=math.floor(value.currValue * (1 + Para))
value.nextValue=math.floor(value.currValue * (1 + nextPara)) value.nextValue=math.floor(value.currValue * (1 + nextPara))
value.proId=key
table.insert(starList,value)
end end
return proList return starList
end end
@ -252,6 +261,9 @@ function this.GetFaXiangLevelCost(_pool,_lv)
local levelConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangLevelConfig,"PoolId",_pool,"Level",_lv) local levelConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangLevelConfig,"PoolId",_pool,"Level",_lv)
if levelConfig then if levelConfig then
local items={} local items={}
if levelConfig.PropList==nil or #levelConfig.PropList==0 then
return items
end
for i = 1,#levelConfig.PropList do for i = 1,#levelConfig.PropList do
local id=levelConfig.PropList[i][1] local id=levelConfig.PropList[i][1]
if itemConfig[id] then if itemConfig[id] then
@ -533,7 +545,7 @@ function this.GetOneKeyUpFaXiangByType(_hero)
for i, v in pairs(allTreasures) do for i, v in pairs(allTreasures) do
if v.faXiangConfig.Type==0 if v.faXiangConfig.Type==0
and (v.faXiangConfig.Profession==0 or v.faXiangConfig.Profession==_hero.heroConfig.Profession) and (v.faXiangConfig.Profession==0 or v.faXiangConfig.Profession==_hero.heroConfig.Profession)
and (v.faXiangConfig.Job==0 or v.faXiangConfig.Profession==_hero.heroConfig.Job) and v.upHeroDid=="" then and (v.faXiangConfig.Job==0 or v.faXiangConfig.Job==_hero.heroConfig.Job) and v.upHeroDid=="" then
local power=this.CalculateEquipWarForce(v) local power=this.CalculateEquipWarForce(v)
--LogError("power=========="..power) --LogError("power=========="..power)
--table.insert(yinList,v) --table.insert(yinList,v)
@ -546,7 +558,7 @@ function this.GetOneKeyUpFaXiangByType(_hero)
for i, v in pairs(allTreasures) do for i, v in pairs(allTreasures) do
if v.faXiangConfig.Type==1 if v.faXiangConfig.Type==1
and (v.faXiangConfig.Profession==0 or v.faXiangConfig.Profession==_hero.heroConfig.Profession) and (v.faXiangConfig.Profession==0 or v.faXiangConfig.Profession==_hero.heroConfig.Profession)
and (v.faXiangConfig.Job==0 or v.faXiangConfig.Profession==_hero.heroConfig.Job) and v.upHeroDid=="" then and (v.faXiangConfig.Job==0 or v.faXiangConfig.Job==_hero.heroConfig.Job) and v.upHeroDid=="" then
local power=this.CalculateEquipWarForce(v) local power=this.CalculateEquipWarForce(v)
-- LogError("power=========="..power) -- LogError("power=========="..power)
--table.insert(yinList,v) --table.insert(yinList,v)
@ -637,6 +649,36 @@ function this.GetAllTreasures()
return curAllEquipTreasure return curAllEquipTreasure
end end
--获取当前英雄所有能穿的宝物 不算英雄身上穿的
function this.GetAllTreasuresCanUp(_heroData)
local curAllEquipTreasure = {}
for key, value in pairs(allTreasures) do
if (value.upHeroDid == "" or value.upHeroDid == "0")
and (value.faXiangConfig.Profession==0 or value.faXiangConfig.Profession==_heroData.heroConfig.Profession)
and (value.faXiangConfig.Job==0 or value.faXiangConfig.Job==_heroData.heroConfig.Job) then
table.insert(curAllEquipTreasure, value)
end
end
if LengthOfTable(curAllEquipTreasure) > 0 then
table.sort(curAllEquipTreasure,function(a, b)
if a.quantity == b.quantity then
if a.lv == b.lv then
return a.refineLv > b.refineLv
else
return a.lv > b.lv
end
else
return a.quantity > b.quantity
end
end)
return curAllEquipTreasure
end
return curAllEquipTreasure
end
--设置法相穿戴的英雄 --设置法相穿戴的英雄
function this.SetEquipTreasureUpHeroDid(_equipTreasureDid, _heroDid) function this.SetEquipTreasureUpHeroDid(_equipTreasureDid, _heroDid)

View File

@ -119,7 +119,7 @@ function FaXiangStrongPopup:BindEvent()
this.treasureDatas[curIndex]:OnOpen(false, {curEquipData.id,0}, 1, false, false, false, 0,curEquipData.idDyn) this.treasureDatas[curIndex]:OnOpen(false, {curEquipData.id,0}, 1, false, false, false, 0,curEquipData.idDyn)
this:SetWindShow(type,0) this:SetWindShow(type,0)
HeroPropManager.SetDirtyByType(curEquipData.upHeroDid, Hero_Prop_Type.FaXiang) HeroPropManager.SetDirtyByType(curEquipData.upHeroDid, Hero_Prop_Type.FaXiang)
--this:RefreshRedPoint(0,true) this:RefreshRedPoint(0,true)
if isMax then if isMax then
PopupTipPanel.ShowTip(Language[11772]) PopupTipPanel.ShowTip(Language[11772])
else else
@ -156,10 +156,10 @@ function FaXiangStrongPopup:BindEvent()
FaXiangManager.ChangeTreasureLv(curEquipData.idDyn,2) FaXiangManager.ChangeTreasureLv(curEquipData.idDyn,2)
this:SetWindShow(2,0) this:SetWindShow(2,0)
HeroPropManager.SetDirtyByType(curEquipData.upHeroDid, Hero_Prop_Type.FaXiang) HeroPropManager.SetDirtyByType(curEquipData.upHeroDid, Hero_Prop_Type.FaXiang)
--this:RefreshRedPoint(0,true) this:RefreshRedPoint(0,true)
this.treasureDatas[curIndex]:OnOpen(false, {curEquipData.id,0}, 1, false, false, false, 0,curEquipData.idDyn) this.treasureDatas[curIndex]:OnOpen(false, {curEquipData.id,0}, 1, false, false, false, 0,curEquipData.idDyn)
if isMax then if isMax then
PopupTipPanel.ShowTip(Language[11774]) PopupTipPanel.ShowTip("以提升至最高星级")
else else
--PopupTipPanel.ShowTip("精炼成功") --PopupTipPanel.ShowTip("精炼成功")
end end
@ -248,7 +248,7 @@ function FaXiangStrongPopup:OnShow()
end) end)
this:ShowTopDataList(datas) this:ShowTopDataList(datas)
this:SetWindShow(type,0.2) this:SetWindShow(type,0.2)
--this:RefreshRedPoint(0.5,true) this:RefreshRedPoint(0.5,true)
end end
function FaXiangStrongPopup:GetHeroIsMainFormation(HeroId) function FaXiangStrongPopup:GetHeroIsMainFormation(HeroId)
@ -331,7 +331,7 @@ function FaXiangStrongPopup:SetWindShow(_index)
this.properList[0].rightTxt.text = Language[11062] this.properList[0].rightTxt.text = Language[11062]
this.btnStrong.gameObject:SetActive(false) this.btnStrong.gameObject:SetActive(false)
else else
this.btnStrongText.text = Language[11777] this.btnStrongText.text = "升 级"
this.properList[0].rightTxt.text = string.format( "%d/%d",curEquipData.lv+1,curEquipData.maxLv) this.properList[0].rightTxt.text = string.format( "%d/%d",curEquipData.lv+1,curEquipData.maxLv)
end end
propertyShow = FaXiangManager.GetCurrLvAndNextLvPropertyValue(curEquipData.levelPool,curEquipData.lv,curEquipData) propertyShow = FaXiangManager.GetCurrLvAndNextLvPropertyValue(curEquipData.levelPool,curEquipData.lv,curEquipData)
@ -359,7 +359,7 @@ function FaXiangStrongPopup:SetWindShow(_index)
this.properList[0].rightTxt.text = Language[11062] this.properList[0].rightTxt.text = Language[11062]
this.btnRefine.gameObject:SetActive(false) this.btnRefine.gameObject:SetActive(false)
else else
this.btnRefineText.text=Language[11781] this.btnRefineText.text="升 星"
this.properList[0].rightTxt.text = string.format( "%d/%s",curEquipData.refineLv+1,curEquipData.maxRefineLv) this.properList[0].rightTxt.text = string.format( "%d/%s",curEquipData.refineLv+1,curEquipData.maxRefineLv)
end end
propertyShow = FaXiangManager.GetCurrStarAndNextStarPropertyValue(2,curEquipData.lv,curEquipData) propertyShow = FaXiangManager.GetCurrStarAndNextStarPropertyValue(2,curEquipData.lv,curEquipData)
@ -382,19 +382,19 @@ function FaXiangStrongPopup:SetWindShow(_index)
isGongMing = false isGongMing = false
--if HarmonyManager.IsInfo(curEquipData.upHeroDid) and HarmonyManager.GetSingleAdditions(index) ~= -1 and _index == 1 then --if HarmonyManager.IsInfo(curEquipData.upHeroDid) and HarmonyManager.GetSingleAdditions(index) ~= -1 and _index == 1 then
if HarmonyManager.IsInfo(curEquipData.upHeroDid) and _index == 1 then -- if HarmonyManager.IsInfo(curEquipData.upHeroDid) and _index == 1 then
isGongMing = true -- isGongMing = true
this.hintTxt.text = "共鸣中的宝物无法强化" -- this.hintTxt.text = "共鸣中的宝物无法强化"
this.hintTxt.gameObject:SetActive(true) -- this.hintTxt.gameObject:SetActive(true)
this.Image2.gameObject:SetActive(false) -- this.Image2.gameObject:SetActive(false)
this.costItemGrid.gameObject:SetActive(false) -- this.costItemGrid.gameObject:SetActive(false)
this.btnGrid.gameObject:SetActive(false) -- this.btnGrid.gameObject:SetActive(false)
else -- else
-- this.hintTxt.gameObject:SetActive(isMax) -- -- this.hintTxt.gameObject:SetActive(isMax)
this.Image2.gameObject:SetActive(not isMax) -- this.Image2.gameObject:SetActive(not isMax)
this.costItemGrid.gameObject:SetActive(not isMax) -- this.costItemGrid.gameObject:SetActive(not isMax)
this.btnGrid.gameObject:SetActive(not isMax) -- this.btnGrid.gameObject:SetActive(not isMax)
end -- end
this:SetPropertyShow(propertyShow) this:SetPropertyShow(propertyShow)
this:CostShow(items) this:CostShow(items)
end end
@ -459,6 +459,7 @@ function FaXiangStrongPopup:SetPropertyShow(_infos)
end end
local index = 1 local index = 1
for key, value in pairs(_infos) do for key, value in pairs(_infos) do
--LogError("key======"..key)
if not this.properList[index] then if not this.properList[index] then
this.properList[index] = {} this.properList[index] = {}
this.properList[index].go = newObjToParent(this.properItemPre,this.propertyGrid) this.properList[index].go = newObjToParent(this.properItemPre,this.propertyGrid)
@ -466,14 +467,20 @@ function FaXiangStrongPopup:SetPropertyShow(_infos)
this.properList[index].rightTxt = Util.GetGameObject(this.properList[index].go,"rightTxt"):GetComponent("Text") this.properList[index].rightTxt = Util.GetGameObject(this.properList[index].go,"rightTxt"):GetComponent("Text")
end end
this.properList[index].go.gameObject:SetActive(true) this.properList[index].go.gameObject:SetActive(true)
local proper=ConfigManager.GetConfigData(ConfigName.PropertyConfig,key) if value.proId==100 then
if proper.Style==1 then this.properList[index].leftTxt.text="属性加成 ".."+"..value.currValue*100 .."%"
this.properList[index].leftTxt.text=string.format("%s+%s",GetLanguageStrById(proper.Info),value.currValue) this.properList[index].rightTxt.text = isMax and Language[11062] or value.nextValue*100 .."%"
this.properList[index].rightTxt.text= isMax and Language[11062] or value.nextValue
else else
this.properList[index].leftTxt.text=GetLanguageStrById(proper.Info).."+"..value.currValue/100 .."%" local proper=ConfigManager.GetConfigData(ConfigName.PropertyConfig,value.proId)
this.properList[index].rightTxt.text = isMax and Language[11062] or value.nextValue/100 .."%" if proper.Style==1 then
this.properList[index].leftTxt.text=string.format("%s+%s",GetLanguageStrById(proper.Info),value.currValue)
this.properList[index].rightTxt.text= isMax and Language[11062] or value.nextValue
else
this.properList[index].leftTxt.text=GetLanguageStrById(proper.Info).."+"..value.currValue/100 .."%"
this.properList[index].rightTxt.text = isMax and Language[11062] or value.nextValue/100 .."%"
end
end end
index = index + 1 index = index + 1
end end
LayoutRebuilder.ForceRebuildLayoutImmediate(this.secondScroll.transform) LayoutRebuilder.ForceRebuildLayoutImmediate(this.secondScroll.transform)

View File

@ -709,7 +709,7 @@ function this:OnClickTabBtn(_index)
this:SetItemData(allEquipTreasure) this:SetItemData(allEquipTreasure)
elseif _index==6 then elseif _index==6 then
local allEquipTreasure local allEquipTreasure
allEquipTreasure = FaXiangManager.GetAllTreasures() allEquipTreasure = FaXiangManager.GetAllTreasuresCanUp(curHeroData)
this:SortEquipDatas1(allEquipTreasure) this:SortEquipDatas1(allEquipTreasure)
--"装备数量:" --"装备数量:"
this.itemNumText.text = Language[12181] .. LengthOfTable(allEquipTreasure) this.itemNumText.text = Language[12181] .. LengthOfTable(allEquipTreasure)