From 38947760c154c8564284b3a314f43460c173bec0 Mon Sep 17 00:00:00 2001
From: yuanshuai <243578945@qq.com>
Date: Sat, 11 Sep 2021 13:37:26 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=9B=9B=E8=B1=A1=E5=BF=83=E6=B3=95?=
=?UTF-8?q?=E3=80=91bug=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../~Lua/Common/GlobalDefine.lua | 1 +
.../Practice/FourQuadrantGongmingPopup.lua | 18 +++--
.../Modules/Practice/FourQuadrantPopup.lua | 73 +++++++++++++------
.../~Lua/Modules/Practice/PracticeManager.lua | 11 +++
4 files changed, 74 insertions(+), 29 deletions(-)
diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua
index 99a3e2914e..76b4dc0a33 100644
--- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua
+++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua
@@ -1717,6 +1717,7 @@ HELP_TYPE = {
ShanHeShiLian = 96,--山河试炼
XunBaoMiZong = 103,--寻宝迷踪
AgeTip = 104,--适龄提示
+ FourQuadrant=108,--四象心法
}
NumToComplexFont = {
diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantGongmingPopup.lua b/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantGongmingPopup.lua
index 5b08416240..fa0625b381 100644
--- a/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantGongmingPopup.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantGongmingPopup.lua
@@ -9,6 +9,7 @@ local ProfessionType = {
[3] = 3,--控制
[4] = 4,--辅助
}
+
--职业id对应职业名称
local ProfessionName={
[1] = "肉盾",
@@ -17,6 +18,12 @@ local ProfessionName={
[4] = "辅助",
}
+local propertyType = {
+ [1] = 2,--攻击
+ [2] = 1,--生命
+ [3] = 3,--护甲
+ [4] = 4,--魔抗
+}
--属性id对应属性名称
local PropertyName={
[1] = "生命",
@@ -101,21 +108,22 @@ function this.SetPropAdd(_propAddObj,_gongmingLv,isNext)
local curFourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",_gongmingLv)
if curFourQuadConfig then
_propAddObj.transform.parent.gameObject:SetActive(true)
- for i = 1, #PropertyName do
+ for i = 1, #propertyType do
local propertyObj=_propAddObj.transform:GetChild(i-1)
+ local propertyId=propertyType[i]
local propertyText=propertyObj:GetComponent("Text")
local propertyIcon= Util.GetGameObject(propertyObj,"Image"):GetComponent("Image")
local addNum=0
if curFourQuadConfig.PropResonance then
- addNum=curFourQuadConfig.PropResonance[i][2]/10000*100
+ addNum=curFourQuadConfig.PropResonance[propertyId][2]/10000*100
end
if isNext then
- propertyText.text=string.format("全体神将%s +%s%%",PropertyName[i],addNum)
+ propertyText.text=string.format("全体神将%s +%s%%",PropertyName[propertyId],addNum)
else
- propertyText.text=string.format("全体神将%s +%s%%",PropertyName[i],addNum)
+ propertyText.text=string.format("全体神将%s +%s%%",PropertyName[propertyId],addNum)
end
- propertyIcon.sprite= this.spLoader:LoadSprite(PropertyTypeIconDef[i])
+ propertyIcon.sprite= this.spLoader:LoadSprite(PropertyTypeIconDef[propertyId])
end
else
_propAddObj.transform.parent.gameObject:SetActive(false)
diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantPopup.lua b/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantPopup.lua
index 2d99039f05..a9fc34137b 100644
--- a/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantPopup.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Practice/FourQuadrantPopup.lua
@@ -8,6 +8,13 @@ local ProfessionType = {
[3] = 3,--控制
[4] = 4,--辅助
}
+
+local propertyType = {
+ [1] = 2,--攻击
+ [2] = 1,--生命
+ [3] = 3,--护甲
+ [4] = 4,--魔抗
+}
--职业id对应职业名称
local ProfessionName={
[1] = "肉盾",
@@ -112,6 +119,9 @@ function this:BindEvent()
end)
Util.AddClick(this.upBtn, function()
+ if this.CheckIsUpStar() then
+ return
+ end
local costArr=fourQuadConfig.LvupCost
for i = 1, #costArr do
if BagManager.GetTotalItemNum(costArr[i][1])0)
local propertyList=professionInfo and professionInfo.propertyList or nil
fourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",this.professionLv)
- this.upStarCostitem= ConfigManager.GetConfigData(ConfigName.ItemConfig,fourQuadConfig.RankupCost[1][1])
- local itemName=this.upStarCostitem.Name
- local itemIcon=GetResourcePath(this.upStarCostitem.ResourceID)
- LogRed("icon:"..itemIcon)
- this.limitHint.text=string.format("四种属性强化至上限后使用 %s进阶",itemName)
- this.limitCost.sprite=this.spLoader:LoadSprite(itemIcon)
- this.itemView:OnOpen(false, {this.upStarCostitem.Id,1}, 0, false,false,false)
- upStarProperty=PracticeManager.fourQuadrantUpStarPropMap[_professionId]
+
---获取属性上限(属性id:属性上限值)
for i = 1, #fourQuadConfig.PropLimit do
propertyLimit[fourQuadConfig.PropLimit[i][1]]=fourQuadConfig.PropLimit[i][2]
@@ -243,13 +251,28 @@ function this.UpdateData(_professionId)
if this.professionLv>0 then
local lastStarLv=this.professionLv-1
local lastFourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",lastStarLv)
- ---获取属性上限(属性id:属性上限值)
+ ---获取上一级属性上限(属性id:属性上限值)
for i = 1, #lastFourQuadConfig.PropLimit do
lastPropertyLimit[lastFourQuadConfig.PropLimit[i][1]]=lastFourQuadConfig.PropLimit[i][2]
end
else
lastPropertyLimit={}
end
+
+ this.upStarCostitem= ConfigManager.GetConfigData(ConfigName.ItemConfig,fourQuadConfig.RankupCost[1][1])
+ if this.CheckIsUpStar() then
+ this.limitCost.gameObject:SetActive(false)
+ this.limitHint.text=string.format("进阶后,四种属性全部提升%s%%",10)
+ else
+ local itemName=this.upStarCostitem.Name
+ local itemIcon=GetResourcePath(this.upStarCostitem.ResourceID)
+ this.limitHint.text=string.format("四种属性强化至上限后使用 %s进阶",itemName)
+ this.limitCost.gameObject:SetActive(true)
+ this.limitCost.sprite=this.spLoader:LoadSprite(itemIcon)
+ this.itemView:OnOpen(false, {this.upStarCostitem.Id,1}, 0, false,false,false)
+ end
+ upStarProperty=PracticeManager.fourQuadrantUpStarPropMap[_professionId]
+
this.UpdateBtnStateAndCostShow()
this.UpdateProperty(propertyList)
this.UpdateStarLv()
@@ -326,23 +349,25 @@ function this.UpdateProperty(_propertyInfoList)
_propertyInfoMap[_propertyInfoList[i].propertyId]=_propertyInfoList[i].propertyNum
end
end
- for key,limitValue in ipairs(propertyLimit)do
- local obj=this.propertyGrid.transform:GetChild(key-1)
+ for i = 1, #propertyType do
+ local obj=this.propertyGrid.transform:GetChild(i-1)
local bar=Util.GetGameObject(obj.gameObject,"progressBg/progressBar"):GetComponent("Image")
local propertyValueText=Util.GetGameObject(obj.gameObject,"propertyValue"):GetComponent("Text")
local propertyNameText=Util.GetGameObject(obj.gameObject,"propertyName"):GetComponent("Text")
local propertyIcon=Util.GetGameObject(obj.gameObject,"propertyIcon"):GetComponent("Image")
- propertyIcon.sprite=this.spLoader:LoadSprite(PropertyTypeIconDef[key])
- propertyNameText.text=string.format("%s神将%s",this.curProfessionName,PropertyName[key])
- local propertyNum=_propertyInfoMap[key] and _propertyInfoMap[key] or 0;
+ local propertyId=propertyType[i]
+ propertyIcon.sprite=this.spLoader:LoadSprite(PropertyTypeIconDef[propertyId])
+ propertyNameText.text=string.format("%s神将%s",this.curProfessionName,PropertyName[propertyId])
+ local propertyNum=_propertyInfoMap[propertyId] and _propertyInfoMap[propertyId] or 0;
+ local curPropLimit=propertyLimit[propertyId]
if this.professionLv>0 then
- local progressNum=_propertyInfoMap[key]-lastPropertyLimit[key]
- local progressLimit=limitValue-lastPropertyLimit[key]
+ local progressNum=_propertyInfoMap[propertyId]-lastPropertyLimit[propertyId]
+ local progressLimit=curPropLimit-lastPropertyLimit[propertyId]
bar.fillAmount = progressNum/progressLimit
else
- bar.fillAmount = propertyNum/limitValue
+ bar.fillAmount = propertyNum/curPropLimit
end
- propertyValueText.text=string.format("%s/%s",propertyNum,limitValue)
+ propertyValueText.text=string.format("%s/%s",propertyNum,curPropLimit)
end
this.UpdateBtnStateAndCostShow()
_isReqLvUp = false
diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua
index 6ed6a77b81..d3a634a370 100644
--- a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua
@@ -502,6 +502,17 @@ function this.HeroCalculateFourQuaWarForce(_professionId)
end
end
end
+ if this.GetFourQuadrantGongmingLv()>0 then
+ local fourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",this.GetFourQuadrantGongmingLv())
+ for i = 1, #fourQuadConfig.PropResonance do
+ local propAdd=fourQuadConfig.PropResonance[i]
+ if addAllProVal[propAdd[1]] then
+ addAllProVal[propAdd[1]]=addAllProVal[propAdd[1]]+propAdd[2]
+ else
+ addAllProVal[propAdd[1]]=propAdd[2]
+ end
+ end
+ end
return addAllProVal
end