From 73283bd81840635e281c838778c026417c3bdce5 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Thu, 16 Dec 2021 10:09:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=E4=BF=AE=E6=94=B9=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/UI/Popup/GeneralPopup.prefab | 12 +-- .../~Lua/Modules/Hero/HeroManager.lua | 90 +++++++++++++------ .../Popup/View/GeneralPopup_ResolveReStar.lua | 9 +- 3 files changed, 74 insertions(+), 37 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/Popup/GeneralPopup.prefab b/Assets/ManagedResources/Prefabs/UI/Popup/GeneralPopup.prefab index 04fcb77173..745341df5a 100644 --- a/Assets/ManagedResources/Prefabs/UI/Popup/GeneralPopup.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Popup/GeneralPopup.prefab @@ -5155,7 +5155,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -200, y: -221.89} + m_AnchoredPosition: {x: -200, y: -238.5} m_SizeDelta: {x: 250, y: 110} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6326318158986269378 @@ -19531,7 +19531,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -21.789864, y: -78} + m_AnchoredPosition: {x: -21.789864, y: 69} m_SizeDelta: {x: 54.376, y: 61.11} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &871341731707611719 @@ -29259,7 +29259,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &252139921712663492 RectTransform: m_ObjectHideFlags: 0 @@ -31783,7 +31783,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.6, y: -146} + m_AnchoredPosition: {x: -0.6, y: -308} m_SizeDelta: {x: 400, y: 64.4} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8763394174418918953 @@ -38375,7 +38375,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 200, y: -221.89} + m_AnchoredPosition: {x: 200, y: -238.5} m_SizeDelta: {x: 250, y: 110} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6034950785758288794 @@ -40483,7 +40483,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 94, y: -81.1001} + m_AnchoredPosition: {x: 94, y: 65.8999} m_SizeDelta: {x: 157.13, y: 65.07} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1299252007534824681 diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua index 31bcc22889..e20f9d5d88 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroManager.lua @@ -127,15 +127,8 @@ function this.UpdateHeroDatas(_msgHeroData, isFindHandBook) heroData.jewels = _msgHeroData.jewels heroData.talismanList = _msgHeroData.especialEquipLevel --法宝等级 heroData.sealIdList = _msgHeroData.sealIdList --紫府神印list - if (#_msgHeroData.soulPos >= 1) then - local soulPrintList = {} - for i, v in ipairs(_msgHeroData.soulPos) do - local soulPrint = {equipId = v.equipId, position = v.position} - SoulPrintManager.AddSoulPrintUpHeroDynamicId(v.equipId, heroData.dynamicId) - table.insert(soulPrintList, soulPrint) - end - heroData.soulPrintList = soulPrintList - end + + heroData.soulPrintList = this.SetSoulPrint(_msgHeroData.soulPos) heroData.skillIdList = {} --主动技 this.UpdateSkillIdList(heroData) @@ -268,6 +261,30 @@ end function this.SetTalismanLv(did, lv) heroDatas[did].talismanList = lv end + +function this.SetSoulPrint(soulPos,did) + local soulPrintList = {} + if (#soulPos >= 1) then + local soulPrintList = {} + for i, v in ipairs(soulPos) do + local soulPrint = {equipId = v.equipId, position = v.position} + SoulPrintManager.AddSoulPrintUpHeroDynamicId(v.equipId, did) + table.insert(soulPrintList, soulPrint) + end + end + return soulPrintList +end + +--一键卸下所有魂印 +function this.SetSoulPrintNil(did) + if heroDatas[did] then + for i = 1,#heroDatas[did].soulPrintList do + SoulPrintManager.DelSoulPrintUpHeroDynamicId(heroDatas[did].soulPrintList[i].equipId, did) + end + end + heroDatas[did].soulPrintList = {} +end + function this.GetTalismanLv(did) if heroDatas[did] then return heroDatas[did].talismanList @@ -2597,25 +2614,7 @@ function this.GetHeroReturnItems(selectHeroData, type) ) return dropList elseif type == GENERAL_POPUP_TYPE.TalismanResolve then --法宝回归 - local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 35).Value) / 10000 - local ShowItemlist = {} - for i, v in pairs(selectHeroData) do - local curHeroData = heroDatas[i] - local temp = {} - if 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 - for i = 1,#temp do - if not ShowItemlist[temp[i][1]] then - ShowItemlist[temp[i][1]] = {temp[i][1], temp[i][2] * specificValue} - else - ShowItemlist[temp[i][1]] = {temp[i][1],ShowItemlist[temp[i][1]][2] + temp[i][2] * specificValue} - end - end - end - end - end + local ShowItemlist = this.GetReturnItemsByType(selectHeroData) local dropList = {} for k, v in pairs(ShowItemlist) do local curReward = {} @@ -2661,14 +2660,47 @@ function this.GetHeroReturnItems(selectHeroData, type) curReward.id = tempRankConfig.IsId curReward.num = v curReward.itemConfig = itemConfig[curReward.id] - curReward.star = 5 + curReward.star = 0 table.insert(dropList, curReward) end end end + local ShowItemlist = this.GetReturnItemsByType(selectHeroData) + for k, v in pairs(ShowItemlist) do + local curReward = {} + curReward.id = v[1] + curReward.num = math.floor(v[2]) + curReward.itemConfig = itemConfig[curReward.id] + curReward.star = 0 + table.insert(dropList, curReward) + end return dropList end end + +function this.GetReturnItemsByType(selectHeroData) + local specificValue = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 35).Value) / 10000 + local ShowItemlist = {} + for i, v in pairs(selectHeroData) do + local curHeroData = heroDatas[i] + local temp = {} + if 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 + for i = 1,#temp do + if not ShowItemlist[temp[i][1]] then + ShowItemlist[temp[i][1]] = {temp[i][1], temp[i][2] * specificValue} + else + ShowItemlist[temp[i][1]] = {temp[i][1],ShowItemlist[temp[i][1]][2] + temp[i][2] * specificValue} + end + end + end + end + end + return ShowItemlist +end + function this.GetHeroReturnItems2(ShowItemlist, allRewardData) for i = 1, #ShowItemlist do local curReward = {} diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_ResolveReStar.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_ResolveReStar.lua index 4d4ee4a0cc..41949c572a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_ResolveReStar.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_ResolveReStar.lua @@ -52,7 +52,13 @@ function this:BindEvent() NetManager.HeroRetureEvent(data, function(msg) local oldPowerNum = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL) HeroManager.ResetHeroStar(data) + HeroManager.SetTalismanLv(data, 1) + HeroManager.SetSoulPrintNil(data) PopupTipPanel.ShowTip("回退成功") + HeroPropManager.SetDirtyByType(data, Hero_Prop_Type.Base) + HeroPropManager.SetDirtyByType(data, Hero_Prop_Type.Talisman) + HeroPropManager.SetDirtyByType(data, Hero_Prop_Type.SoulPrint) + HeroPropManager.SetDirtyByType(data, Hero_Prop_Type.PassiveSkill) parent:ClosePanel() UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function () -- ResolvePanel.SwitchView(2,true,true) @@ -65,8 +71,7 @@ function this:BindEvent() end Game.GlobalEvent:DispatchEvent(GameEvent.Role.UpdateRoleInfoPanel) end,0,nil,nil,1) - HeroPropManager.SetDirtyByType(data, Hero_Prop_Type.Base) - HeroPropManager.SetDirtyByType(data, Hero_Prop_Type.PassiveSkill) + end,1) end) end