魂宝灵宝分解

yuanshuai 2022-09-07 10:14:05 +08:00
parent 552ea8ec0e
commit d0d94401d4
4 changed files with 31 additions and 27 deletions

View File

@ -4501,6 +4501,9 @@ function this.CheckIsUpTreasure(Did,index)
items,isMatEnough = this.GetCostItems(curEquipData,curEquipData.refineConfig) items,isMatEnough = this.GetCostItems(curEquipData,curEquipData.refineConfig)
elseif index == 3 then elseif index == 3 then
isMax=curEquipData.treeLv==curEquipData.maxTreeLv isMax=curEquipData.treeLv==curEquipData.maxTreeLv
if isMax then
return false
end
local lvUpCost= ConfigManager.GetConfigData(ConfigName.GodHoodTreeLevel,curEquipData.treeLv).LvupCost local lvUpCost= ConfigManager.GetConfigData(ConfigName.GodHoodTreeLevel,curEquipData.treeLv).LvupCost
isMatEnough=BagManager.GetItemCountById(lvUpCost[1])>=lvUpCost[2] isMatEnough=BagManager.GetItemCountById(lvUpCost[1])>=lvUpCost[2]
else else

View File

@ -6869,7 +6869,6 @@ function NetManager.SendUpgradeGodTreeRequest(_jewelId,_count,func)
local data = buffer:DataByte() local data = buffer:DataByte()
local msg = HeroInfoProto_pb.UpgradeGodTreeResponse() local msg = HeroInfoProto_pb.UpgradeGodTreeResponse()
msg:ParseFromString(data) msg:ParseFromString(data)
EquipTreasureManager.SetEquipTreeLvByIdDyn(_jewelId)
if func then if func then
func(msg) func(msg)
end end

View File

@ -451,7 +451,7 @@ function this.ChangeTreeLv()
v.treeLv = v.TreeLv() v.treeLv = v.TreeLv()
end end
end end
--改变宝物的等级或精炼等级 --改变宝物的等级或精炼等级或神应等级
function this.ChangeTreasureLv(_idDyn, _type) function this.ChangeTreasureLv(_idDyn, _type)
if allTreasures == nil then if allTreasures == nil then
return return
@ -467,15 +467,16 @@ function this.ChangeTreasureLv(_idDyn, _type)
local lv = allTreasures[_idDyn].lv + 1 local lv = allTreasures[_idDyn].lv + 1
allTreasures[_idDyn].lv = lv allTreasures[_idDyn].lv = lv
allTreasures[_idDyn].strongConfig = this.GetCurrTreasureLvConfig(1, allTreasures[_idDyn].levelPool, lv) allTreasures[_idDyn].strongConfig = this.GetCurrTreasureLvConfig(1, allTreasures[_idDyn].levelPool, lv)
elseif _type == 2 then
if allTreasures[_idDyn].refineLv == allTreasures[_idDyn].maxRefineLv then
return
end
local refine = allTreasures[_idDyn].refineLv + 1
allTreasures[_idDyn].refineLv = refine
allTreasures[_idDyn].refineConfig =this.GetCurrTreasureLvConfig(2, allTreasures[_idDyn].refinePool, refine)
else else
if _type == 2 then if allTreasures[_idDyn] then
if allTreasures[_idDyn].refineLv == allTreasures[_idDyn].maxRefineLv then allTreasures[_idDyn].treeLv=allTreasures[_idDyn].treeLv+1
return
end
local refine = allTreasures[_idDyn].refineLv + 1
allTreasures[_idDyn].refineLv = refine
allTreasures[_idDyn].refineConfig =
this.GetCurrTreasureLvConfig(2, allTreasures[_idDyn].refinePool, refine)
end end
end end
end end
@ -599,12 +600,6 @@ function this.SetAllTreasureDirty(isDirty)
end end
end end
end end
function this.SetEquipTreeLvByIdDyn(_idDyn)
if allTreasures[_idDyn] then
allTreasures[_idDyn].treeLv=allTreasures[_idDyn].treeLv+1
end
end
-- 设置宝物战斗力 -- 设置宝物战斗力
function this.SetTreasurePower(dId, power) function this.SetTreasurePower(dId, power)
if not this.TreasurePowerData then if not this.TreasurePowerData then
@ -746,17 +741,23 @@ function this.GetEquipTreasureResolveItems(selectEquipTreasureData)
end end
if curEquipTreasureData.lv > 0 then if curEquipTreasureData.lv > 0 then
for i=0,curEquipTreasureData.lv - 1 do for i=0,curEquipTreasureData.lv - 1 do
local lvJewelRankupConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.JewelRankupConfig,"Type",1,"Level",i,"PoolID",curEquipTreasureData.levelPool) local lvJewelRankupConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.JewelRankupConfig,"Type",1,"Level",i,"PoolID",curEquipTreasureData.levelPool)
if lvJewelRankupConfig then
if lvJewelRankupConfig then --强化消耗的材料
--强化消耗的材料 if lvJewelRankupConfig.UpExpend then
if lvJewelRankupConfig.UpExpend then for UpExpendkey, UpExpendvalue in ipairs(lvJewelRankupConfig.UpExpend) do
for UpExpendkey, UpExpendvalue in ipairs(lvJewelRankupConfig.UpExpend) do this.GetEquipTreasureResolveItems2(UpExpendvalue[1], UpExpendvalue[2])
this.GetEquipTreasureResolveItems2(UpExpendvalue[1], UpExpendvalue[2]) end
end end
end end
end end
end end
if curEquipTreasureData.treeLv > 0 then
local treeLvConfig= ConfigManager.GetConfig(ConfigName.GodHoodTreeLevel)
for i = 0, curEquipTreasureData.treeLv-1 do
local costConfig=treeLvConfig[i]
this.GetEquipTreasureResolveItems2(costConfig.LvupCost[1], costConfig.LvupCost[2])
end
end end
--加自身分解消耗的东西 --加自身分解消耗的东西
-- local rewardShowStr1 = {} -- local rewardShowStr1 = {}

View File

@ -209,16 +209,18 @@ function EquipTreasureStrongPopup:BindEvent()
end end
NetManager.SendUpgradeGodTreeRequest(curEquipData.idDyn,1,function (msg) NetManager.SendUpgradeGodTreeRequest(curEquipData.idDyn,1,function (msg)
PopupTipPanel.ShowTip("升级成功") PopupTipPanel.ShowTip("升级成功")
EquipTreasureManager.ChangeTreasureLv(curEquipData.idDyn,type)
Timer.New(function() Timer.New(function()
this:SetWindShow(type,0) this:SetWindShow(type,0)
end,0.1):Start() end,0.1):Start()
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:RefreshRedPoint(0.2,true) this:RefreshRedPoint(0.2,true)
local oldWarPowerValue = EquipTreasureManager.CalculateWarForceBySid(curEquipData.id,curEquipData.lv ,curEquipData.refineLv - 1,curEquipData.treeLv) local oldWarPowerValue = EquipTreasureManager.CalculateWarForceBase(curEquipData.id,curEquipData.lv ,curEquipData.refineLv,curEquipData.treeLv-1,curEquipData)
local newWarPowerValue = EquipTreasureManager.CalculateWarForceBySid(curEquipData.id,curEquipData.lv,curEquipData.refineLv,curEquipData.treeLv) local newWarPowerValue = EquipTreasureManager.CalculateWarForceBase(curEquipData.id,curEquipData.lv,curEquipData.refineLv,curEquipData.treeLv,curEquipData)
if oldWarPowerValue ~= newWarPowerValue then if oldWarPowerValue ~= newWarPowerValue then
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPowerValue,newValue = newWarPowerValue}) UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPowerValue,newValue = newWarPowerValue})
end end
Game.GlobalEvent:DispatchEvent(GameEvent.Treasure.TreasureLvUp)
end) end)
end) end)
end end
@ -426,11 +428,10 @@ function EquipTreasureStrongPopup:SetWindShow(_index)
this.properList[0].rightTxt.text = curEquipData.treeLv+1 this.properList[0].rightTxt.text = curEquipData.treeLv+1
end end
propertyShow = SacredTreeManager.GetPropText(curEquipData.treeLv,curEquipData.quantity-1) propertyShow = SacredTreeManager.GetPropText(curEquipData.treeLv,curEquipData.quantity-1)
items = HeroManager.GetHoodTreeUpCost(curEquipData.treeLv)
if isMax then if isMax then
this.hintTxt.text = "神应等级已达上限" this.hintTxt.text = "神应等级已达上限"
else else
this.hintTxt.text=Language[11782] items = HeroManager.GetHoodTreeUpCost(curEquipData.treeLv)
end end
end end