From 7c3827cd0d82ba39724fb3fcb0d22956d5842c97 Mon Sep 17 00:00:00 2001
From: wangzhenxing <1545929779@qq.com>
Date: Sun, 24 Dec 2023 15:16:09 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=A3=85=E5=A4=87=E3=80=91=3D=3D=3D?=
=?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D?=
=?UTF-8?q?=3D=3D=3D=E6=BD=9C=E8=83=BD=E5=B1=9E=E6=80=A7=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=BD=92=E5=85=83=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E8=BF=94=E8=BF=98=E6=9D=90=E6=96=99=E6=98=BE=E7=A4=BA=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../~Lua/Modules/Hero/HeroManager.lua | 159 ++++++++++--------
.../Popup/RewardEquipSingleShowPopup2.lua | 7 +-
.../Popup/RewardTalismanSingleShowPopup2.lua | 3 +-
.../Modules/Recruit/RecruitEquipPanelNew.lua | 12 +-
.../~Lua/Modules/Recruit/RecruitManager.lua | 3 +
5 files changed, 109 insertions(+), 75 deletions(-)
diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua
index 3f8a4daf8a..3325e0b578 100644
--- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua
@@ -293,6 +293,17 @@ function this.AddPotentialDataByType(dyn,type,lv)
end
end
+--改变所有英雄的礼物等级
+function this.ChangeAllHeroGiftLV()
+ for i, v in pairs(heroDatas) do
+ if v.potential then
+ for key, value in pairs(v.potential) do
+ value.giftLv=GiftManager.GetHeroPotencyLvById(i)
+ end
+ end
+ end
+end
+
--设置法灵
function this.SetHeroBaublesId(dyn,_id)
if heroDatas[dyn] then
@@ -2970,72 +2981,73 @@ end
local rewardGroup = ConfigManager.GetConfig(ConfigName.RewardGroup)
function this.GetHeroReturnItems(selectHeroData, type)
local allRewardData = {}
- -- if type == GENERAL_POPUP_TYPE.ResolveRecall then
- -- local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 34).Value) / 10000
- -- local ShowItemlist = {}
- -- --HeroReturn 的 ReturnHero + RankupReturn * specificValue + HeroLevelConfig 的 Consume * specificValue
- -- --先把回溯英雄放进去
- -- for i, v in pairs(selectHeroData) do
- -- local curHeroData = heroDatas[i]
- -- if not curHeroData then
- -- return
- -- end
- -- local pId
- -- if curHeroData.breakId == 0 then
- -- pId=0
- -- else
- -- pId= heroRankUpConfig[curHeroData.breakId].Phase[2]
- -- end
- -- local heroReturnConfig =
- -- ConfigManager.TryGetConfigDataByDoubleKey(
- -- ConfigName.HeroReturn,
- -- "HeroId",
- -- curHeroData.id,
- -- "Star",
- -- pId
- -- )
- -- local rewardShowStr1 = {}
- -- if not heroReturnConfig then
- -- LogRed("pId:"..pId.." curHeroData.breakId:"..curHeroData.breakId.." curHeroData.id:"..curHeroData.id)
- -- else
- -- ShowItemlist[heroReturnConfig.HeroId] = {heroReturnConfig.HeroId,1,curHeroData.star}
- -- rewardShowStr1 = heroReturnConfig.RankupReturn
- -- 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}
- -- else
- -- ShowItemlist[v[1]] = {v[1],ShowItemlist[v[1]][2] + v[2] * specificValue}
- -- end
- -- end
- -- end
- -- end
- -- end
- -- rewardShowStr1 = ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, v.lv).SumConsume
- -- if rewardShowStr1 then
- -- for k,v in ipairs(rewardShowStr1) do
- -- if not ShowItemlist[v[1]] then
- -- ShowItemlist[v[1]] = {v[1], v[2] * specificValue}
- -- else
- -- 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
- -- local curReward = {}
- -- curReward.id = m[1]
- -- curReward.num = math.floor(m[2])
- -- curReward.itemConfig = itemConfig[curReward.id]
- -- curReward.star = m[3] or nil
- -- table.insert(dropList, curReward)
- -- end
- -- return dropList
- -- else
- if type == GENERAL_POPUP_TYPE.ResolveDismantle or type== GENERAL_POPUP_TYPE.ResolveRecall then --献祭
+ if type == GENERAL_POPUP_TYPE.ResolveRecall then
+ local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 34).Value) / 10000
+ local ShowItemlist = {}
+ --HeroReturn 的 ReturnHero + RankupReturn * specificValue + HeroLevelConfig 的 Consume * specificValue
+ --先把回溯英雄放进去
+ for i, v in pairs(selectHeroData) do
+ local curHeroData = heroDatas[i]
+ if not curHeroData then
+ return
+ end
+ local pId
+ if curHeroData.breakId == 0 then
+ pId=0
+ else
+ pId= heroRankUpConfig[curHeroData.breakId].Phase[2]
+ end
+ local heroReturnConfig =
+ ConfigManager.TryGetConfigDataByDoubleKey(
+ ConfigName.HeroReturn,
+ "HeroId",
+ curHeroData.id,
+ "Star",
+ pId
+ )
+ local rewardShowStr1 = {}
+ if not heroReturnConfig then
+ LogRed("pId:"..pId.." curHeroData.breakId:"..curHeroData.breakId.." curHeroData.id:"..curHeroData.id)
+ else
+ ShowItemlist[heroReturnConfig.HeroId] = {heroReturnConfig.HeroId,1,curHeroData.star}
+ rewardShowStr1 = heroReturnConfig.RankupReturn
+ 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}
+ else
+ ShowItemlist[v[1]] = {v[1],ShowItemlist[v[1]][2] + v[2] * specificValue}
+ end
+ end
+ end
+ end
+ end
+ rewardShowStr1 = ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, v.lv).SumConsume
+ if rewardShowStr1 then
+ for k,v in ipairs(rewardShowStr1) do
+ if not ShowItemlist[v[1]] then
+ ShowItemlist[v[1]] = {v[1], v[2] * specificValue}
+ else
+ 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
+ local curReward = {}
+ curReward.id = m[1]
+ curReward.num = math.floor(m[2])
+ curReward.itemConfig = itemConfig[curReward.id]
+ curReward.star = m[3] or nil
+ table.insert(dropList, curReward)
+ end
+ return dropList
+ elseif type == GENERAL_POPUP_TYPE.ResolveDismantle then
+
+ --if type == GENERAL_POPUP_TYPE.ResolveDismantle or type== GENERAL_POPUP_TYPE.ResolveRecall then --献祭
local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 35).Value) / 10000
for i, v in pairs(selectHeroData) do
--当英雄一次都未突破和进阶时
@@ -3199,7 +3211,7 @@ function this.GetReturnItemsByType(selectHeroData)
for i, v in pairs(selectHeroData) do
local curHeroData = heroDatas[i]
local temp = {}
- if curHeroData.talismanList > 1 then
+ if curHeroData.talismanList and curHeroData.talismanList > 1 then
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
@@ -4247,6 +4259,19 @@ function this.GetHeroPotencyAddByType(_dyn,_type)
end
+function this.GetHeroPotencyAddByTypeAndPotencyData(_data,_type)
+ if _data and _type and _data[_type] then
+ local aaa=_data[_type]
+ local allLv=aaa.lv+aaa.giftLv
+ local config=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PotentialNew,"Type",_type,"Level",allLv)
+ if config then
+ local pro=config.Attribute/10000
+ return pro
+ end
+ end
+ return 0
+end
+
function this.ResetHero(dynamicloadId)
if heroDatas[dynamicloadId] then
diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua
index 4162bce2b8..8211b9bacb 100644
--- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardEquipSingleShowPopup2.lua
@@ -140,6 +140,7 @@ function RewardEquipSingleShowPopup2:BindEvent()
self:ClosePanel()
if heroId=="0" then
GiftManager.SetPlayerGift(idList)
+ HeroManager.ChangeAllHeroGiftLV()
else
GiftManager.SetHeroGift(self.curHeroData.dynamicId,idList,1)
end
@@ -359,7 +360,10 @@ function RewardEquipSingleShowPopup2:OnShow()
string.format(" 主角礼物加成+%s (%s%%)",math.floor(prop[2]*GiftManager.GetPlayerGiftAdd()/100),GiftManager.GetPlayerGiftAdd())
..string.format(" 特训加成+%s (%s%%)",math.floor(prop[2]*HeroManager.ReturnGiftAtt()),HeroManager.ReturnGiftAtt())
elseif equipConfigData.Position<=4 and self.curHeroData then
- local potencyAdd=HeroManager.GetHeroPotencyAddByType(self.curHeroData.dynamicId,equipConfigData.Position)
+ -- for k, v in pairs(self.curHeroData.potential) do
+ -- LogError("v======================"..v.." k==="..k)
+ -- end
+ local potencyAdd=HeroManager.GetHeroPotencyAddByTypeAndPotencyData(self.curHeroData.potential,equipConfigData.Position)
LogError("potencyAdd============"..potencyAdd)
vText.text = "+"..GetPropertyFormatStr(proConfigData.Style, prop[2])..string.format(" 潜能 +%s(%s%%)",math.floor(prop[2]*potencyAdd+0.5),potencyAdd*100)
else
@@ -553,6 +557,7 @@ function RewardEquipSingleShowPopup2:OnShow()
if self.curHeroData and (self.openType == 2 or self.openType == 5) then
equipGoldSuite = HeroManager.GetCurHeroBaiJinEquipSuitPros(self.curHeroData.equipIdList)
end
+ LogError("equipConfigData.Star===================="..equipConfigData.Star)
local curGoldSuitConFig = suitConFig[equipConfigData.Star]
for k,v in ipairs(_superProList) do
v.gameObject:SetActive(false)
diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardTalismanSingleShowPopup2.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardTalismanSingleShowPopup2.lua
index 52744ad7d3..5a0bd2b362 100644
--- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardTalismanSingleShowPopup2.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardTalismanSingleShowPopup2.lua
@@ -556,7 +556,8 @@ function RewardTalismanSingleShowPopup2:SetPropertyShow1(_infos,_preList,_grid)
end
if self.curHeroData then
if proper.Style==1 then
- local potencyAdd=HeroManager.GetHeroPotencyAddByType(self.curHeroData.dynamicId,self.position)
+
+ local potencyAdd=HeroManager.GetHeroPotencyAddByTypeAndPotencyData(self.curHeroData.potential,self.position)
LogError("potencyAdd============"..potencyAdd)
str = str..GetLanguageStrById(proper.Info).."+".. value.currValue..string.format(" 潜能 +%s(%s%%)",math.floor(value.currValue*(potencyAdd)+0.5),potencyAdd*100)
else
diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitEquipPanelNew.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitEquipPanelNew.lua
index 2d89733a4b..1cbaafff10 100644
--- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitEquipPanelNew.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitEquipPanelNew.lua
@@ -103,12 +103,12 @@ end
function RecruitEquipPanelNew:BindEvent()
Util.AddOnceClick(self.lsth, function()
- -- local isOpen =CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
- -- local tip=GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
- -- if isOpen==false then
- -- PopupTipPanel.ShowTip(tip)
- -- return
- -- end
+ local isOpen =CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
+ local tip=GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
+ if isOpen==false then
+ PopupTipPanel.ShowTip(tip)
+ return
+ end
JumpManager.GoJump(40082)
end)
--帮助按钮
diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua
index 4756877358..d93699e85d 100644
--- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua
@@ -484,6 +484,9 @@ local bType={
--点将台红点状态
function this.GetAllRecruitBtnRedpoint(red)
local index = {}
+ if red==RedPointType.Recruit_Friend and CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)==false then
+ return false
+ end
if red == RedPointType.Recruit_Normal then
index = {1,2}
elseif red == RedPointType.Recruit_Friend then